]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - shared/models/videos/studio/video-studio-create-edit.model.ts
Bumped to version v5.2.1
[github/Chocobozzz/PeerTube.git] / shared / models / videos / studio / video-studio-create-edit.model.ts
... / ...
CommitLineData
1export interface VideoStudioCreateEdition {
2 tasks: VideoStudioTask[]
3}
4
5export type VideoStudioTask =
6 VideoStudioTaskCut |
7 VideoStudioTaskIntro |
8 VideoStudioTaskOutro |
9 VideoStudioTaskWatermark
10
11export interface VideoStudioTaskCut {
12 name: 'cut'
13
14 options: {
15 start?: number
16 end?: number
17 }
18}
19
20export interface VideoStudioTaskIntro {
21 name: 'add-intro'
22
23 options: {
24 file: Blob | string
25 }
26}
27
28export interface VideoStudioTaskOutro {
29 name: 'add-outro'
30
31 options: {
32 file: Blob | string
33 }
34}
35
36export interface VideoStudioTaskWatermark {
37 name: 'add-watermark'
38
39 options: {
40 file: Blob | string
41 }
42}
43
44// ---------------------------------------------------------------------------
45
46export function isVideoStudioTaskIntro (v: VideoStudioTask): v is VideoStudioTaskIntro {
47 return v.name === 'add-intro'
48}
49
50export function isVideoStudioTaskOutro (v: VideoStudioTask): v is VideoStudioTaskOutro {
51 return v.name === 'add-outro'
52}
53
54export function isVideoStudioTaskWatermark (v: VideoStudioTask): v is VideoStudioTaskWatermark {
55 return v.name === 'add-watermark'
56}
57
58export function hasVideoStudioTaskFile (v: VideoStudioTask): v is VideoStudioTaskIntro | VideoStudioTaskOutro | VideoStudioTaskWatermark {
59 return isVideoStudioTaskIntro(v) || isVideoStudioTaskOutro(v) || isVideoStudioTaskWatermark(v)
60}