aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-watch/shared/information/video-alert.component.ts
blob: 8a46ba0d59e4ab28817711318a59c62407fa317d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { Component, Input } from '@angular/core'
import { VideoDetails } from '@app/shared/shared-main'
import { VideoState } from '@shared/models'

@Component({
  selector: 'my-video-alert',
  templateUrl: './video-alert.component.html',
  styleUrls: [ './video-alert.component.scss' ]
})
export class VideoAlertComponent {
  @Input() video: VideoDetails

  isVideoToTranscode () {
    return this.video && this.video.state.id === VideoState.TO_TRANSCODE
  }

  isVideoToImport () {
    return this.video && this.video.state.id === VideoState.TO_IMPORT
  }

  hasVideoScheduledPublication () {
    return this.video && this.video.scheduledUpdate !== undefined
  }

  isWaitingForLive () {
    return this.video?.state.id === VideoState.WAITING_FOR_LIVE
  }

  isLiveEnded () {
    return this.video?.state.id === VideoState.LIVE_ENDED
  }
}