import { Component, EventEmitter, Input, Output } from '@angular/core'
import { ScreenService } from '@app/core'
+import { VideoState } from '@shared/models'
import { Video } from '../shared-main'
@Component({
@Input() video: Video
@Input() nsfw = false
- @Input() videoRouterLink: any[]
+ @Input() videoRouterLink: string | any[]
@Input() queryParams: { [ p: string ]: any }
@Input() videoHref: string
@Input() videoTarget: string
this.addedToWatchLaterText = $localize`Remove from watch later`
}
+ isLiveEnded () {
+ if (!this.video.state) return
+
+ return this.video.state.id === VideoState.LIVE_ENDED
+ }
+
getImageUrl () {
if (!this.video) return ''
getVideoRouterLink () {
if (this.videoRouterLink) return this.videoRouterLink
- return [ '/videos/watch', this.video.uuid ]
+ return Video.buildWatchUrl(this.video)
}
onWatchLaterClick (event: Event) {