diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-30 08:55:11 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-30 08:56:14 +0200 |
commit | 2453589a286e1f65843af582512387b2fa17b502 (patch) | |
tree | 57d41d8c432ca4e793a16d3b51f665b34aafec52 /client/src/app/+videos/+video-watch/shared/information/video-alert.component.ts | |
parent | d4f0b2ecec221b6cdd75b5d87ba800c6301a15df (diff) | |
download | PeerTube-2453589a286e1f65843af582512387b2fa17b502.tar.gz PeerTube-2453589a286e1f65843af582512387b2fa17b502.tar.zst PeerTube-2453589a286e1f65843af582512387b2fa17b502.zip |
Move video alert in a dedicated component
Diffstat (limited to 'client/src/app/+videos/+video-watch/shared/information/video-alert.component.ts')
-rw-r--r-- | client/src/app/+videos/+video-watch/shared/information/video-alert.component.ts | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/client/src/app/+videos/+video-watch/shared/information/video-alert.component.ts b/client/src/app/+videos/+video-watch/shared/information/video-alert.component.ts new file mode 100644 index 000000000..8a46ba0d5 --- /dev/null +++ b/client/src/app/+videos/+video-watch/shared/information/video-alert.component.ts | |||
@@ -0,0 +1,32 @@ | |||
1 | import { Component, Input } from '@angular/core' | ||
2 | import { VideoDetails } from '@app/shared/shared-main' | ||
3 | import { VideoState } from '@shared/models' | ||
4 | |||
5 | @Component({ | ||
6 | selector: 'my-video-alert', | ||
7 | templateUrl: './video-alert.component.html', | ||
8 | styleUrls: [ './video-alert.component.scss' ] | ||
9 | }) | ||
10 | export class VideoAlertComponent { | ||
11 | @Input() video: VideoDetails | ||
12 | |||
13 | isVideoToTranscode () { | ||
14 | return this.video && this.video.state.id === VideoState.TO_TRANSCODE | ||
15 | } | ||
16 | |||
17 | isVideoToImport () { | ||
18 | return this.video && this.video.state.id === VideoState.TO_IMPORT | ||
19 | } | ||
20 | |||
21 | hasVideoScheduledPublication () { | ||
22 | return this.video && this.video.scheduledUpdate !== undefined | ||
23 | } | ||
24 | |||
25 | isWaitingForLive () { | ||
26 | return this.video?.state.id === VideoState.WAITING_FOR_LIVE | ||
27 | } | ||
28 | |||
29 | isLiveEnded () { | ||
30 | return this.video?.state.id === VideoState.LIVE_ENDED | ||
31 | } | ||
32 | } | ||