-import { Component, Input } from '@angular/core'
+import { Component, EventEmitter, Input, Output } from '@angular/core'
import { Video } from './video.model'
import { ScreenService } from '@app/shared/misc/screen.service'
+import { I18n } from '@ngx-translate/i18n-polyfill'
@Component({
selector: 'my-video-thumbnail',
@Input() routerLink: any[]
@Input() queryParams: any[]
- constructor (private screenService: ScreenService) {
+ @Input() displayWatchLaterPlaylist: boolean
+ @Input() inWatchLaterPlaylist: boolean
+
+ @Output() watchLaterClick = new EventEmitter<boolean>()
+
+ addToWatchLaterText: string
+ addedToWatchLaterText: string
+
+ constructor (
+ private screenService: ScreenService,
+ private i18n: I18n
+ ) {
+ this.addToWatchLaterText = this.i18n('Add to watch later')
+ this.addedToWatchLaterText = this.i18n('Remove from watch later')
}
getImageUrl () {
return [ '/videos/watch', this.video.uuid ]
}
+
+ onWatchLaterClick (event: Event) {
+ this.watchLaterClick.emit(this.inWatchLaterPlaylist)
+
+ event.stopPropagation()
+ return false
+ }
}