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