|
1 | | -import { VimeoEvent } from './event'; |
| 1 | +import type { VimeoEvent } from './event'; |
2 | 2 | import type { VimeoChapter, VimeoQuality, VimeoTextTrack } from './misc'; |
3 | 3 |
|
4 | 4 | /** |
5 | 5 | * @see https://github.com/vimeo/player.js#methods |
6 | 6 | */ |
7 | | -export const enum VimeoCommand { |
8 | | - AddEventListener = 'addEventListener', |
9 | | - DisableTextTrack = 'disableTextTrack', |
10 | | - EnableTextTrack = 'enableTextTrack', |
11 | | - ExitFullscreen = 'exitFullscreen', |
12 | | - ExitPictureInPicture = 'exitPictureInPicture', |
13 | | - GetBuffered = 'getBuffered', |
14 | | - GetCuePoints = 'getCuePoints', |
15 | | - GetChapters = 'getChapters', |
16 | | - GetCurrentTime = 'getCurrentTime', |
17 | | - GetDuration = 'getDuration', |
18 | | - GetFullscreen = 'getFullscreen', |
19 | | - GetPictureInPicture = 'getPictureInPicture', |
20 | | - GetPlayed = 'getPlayed', |
21 | | - GetQualities = 'getQualities', |
22 | | - GetQuality = 'getQuality', |
23 | | - GetSeekable = 'getSeekable', |
24 | | - GetSeeking = 'getSeeking', |
25 | | - GetTextTracks = 'getTextTracks', |
26 | | - GetVideoTitle = 'getVideoTitle', |
27 | | - HideOverlay = '_hideOverlay', |
28 | | - Pause = 'pause', |
29 | | - Play = 'play', |
30 | | - RequestFullscreen = 'requestFullscreen', |
31 | | - RequestPictureInPicture = 'requestPictureInPicture', |
32 | | - SeekTo = 'seekTo', |
33 | | - SetMuted = 'setMuted', |
34 | | - SetPlaybackRate = 'setPlaybackRate', |
35 | | - SetQuality = 'setQuality', |
36 | | - SetVolume = 'setVolume', |
37 | | - ShowOverlay = '_showOverlay', |
38 | | - Destroy = 'destroy', |
39 | | - LoadVideo = 'loadVideo', |
40 | | - Unload = 'unload', |
41 | | -} |
| 7 | +export type VimeoCommand = |
| 8 | + | 'addEventListener' |
| 9 | + | 'disableTextTrack' |
| 10 | + | 'enableTextTrack' |
| 11 | + | 'exitFullscreen' |
| 12 | + | 'exitPictureInPicture' |
| 13 | + | 'getBuffered' |
| 14 | + | 'getCuePoints' |
| 15 | + | 'getChapters' |
| 16 | + | 'getCurrentTime' |
| 17 | + | 'getDuration' |
| 18 | + | 'getFullscreen' |
| 19 | + | 'getPictureInPicture' |
| 20 | + | 'getPlayed' |
| 21 | + | 'getQualities' |
| 22 | + | 'getQuality' |
| 23 | + | 'getSeekable' |
| 24 | + | 'getSeeking' |
| 25 | + | 'getTextTracks' |
| 26 | + | 'getVideoTitle' |
| 27 | + | '_hideOverlay' |
| 28 | + | 'pause' |
| 29 | + | 'play' |
| 30 | + | 'requestFullscreen' |
| 31 | + | 'requestPictureInPicture' |
| 32 | + | 'seekTo' |
| 33 | + | 'setMuted' |
| 34 | + | 'setPlaybackRate' |
| 35 | + | 'setQuality' |
| 36 | + | 'setVolume' |
| 37 | + | '_showOverlay' |
| 38 | + | 'destroy' |
| 39 | + | 'loadVideo' |
| 40 | + | 'unload'; |
42 | 41 |
|
43 | 42 | export interface VimeoCommandArg { |
44 | | - [VimeoCommand.Play]: void; |
45 | | - [VimeoCommand.Pause]: void; |
46 | | - [VimeoCommand.SetMuted]: boolean; |
47 | | - [VimeoCommand.SetVolume]: number; |
48 | | - [VimeoCommand.GetDuration]: void; |
49 | | - [VimeoCommand.GetChapters]: void; |
50 | | - [VimeoCommand.GetCurrentTime]: void; |
51 | | - [VimeoCommand.SeekTo]: number; |
52 | | - [VimeoCommand.SetPlaybackRate]: number; |
53 | | - [VimeoCommand.AddEventListener]: VimeoEvent; |
54 | | - [VimeoCommand.GetCuePoints]: void; |
55 | | - [VimeoCommand.GetVideoTitle]: string; |
56 | | - [VimeoCommand.GetTextTracks]: void; |
57 | | - [VimeoCommand.EnableTextTrack]: { |
| 43 | + play: void; |
| 44 | + pause: void; |
| 45 | + setMuted: boolean; |
| 46 | + setVolume: number; |
| 47 | + getDuration: void; |
| 48 | + getChapters: void; |
| 49 | + getCurrentTime: void; |
| 50 | + seekTo: number; |
| 51 | + setPlaybackRate: number; |
| 52 | + addEventListener: VimeoEvent; |
| 53 | + getCuePoints: void; |
| 54 | + getVideoTitle: string; |
| 55 | + getTextTracks: void; |
| 56 | + enableTextTrack: { |
58 | 57 | language: string; |
59 | 58 | kind: string; |
60 | 59 | }; |
61 | | - [VimeoCommand.DisableTextTrack]: string; |
62 | | - [VimeoCommand.SetQuality]: string; |
63 | | - [VimeoCommand.ShowOverlay]: void; |
64 | | - [VimeoCommand.HideOverlay]: void; |
65 | | - [VimeoCommand.GetBuffered]: void; |
66 | | - [VimeoCommand.RequestFullscreen]: void; |
67 | | - [VimeoCommand.ExitFullscreen]: void; |
68 | | - [VimeoCommand.RequestPictureInPicture]: void; |
69 | | - [VimeoCommand.ExitPictureInPicture]: void; |
70 | | - [VimeoCommand.GetQuality]: void; |
71 | | - [VimeoCommand.GetQualities]: void; |
72 | | - [VimeoCommand.GetPlayed]: void; |
73 | | - [VimeoCommand.GetSeekable]: void; |
74 | | - [VimeoCommand.GetSeeking]: void; |
75 | | - [VimeoCommand.GetFullscreen]: void; |
76 | | - [VimeoCommand.GetPictureInPicture]: void; |
77 | | - [VimeoCommand.Destroy]: void; |
78 | | - [VimeoCommand.LoadVideo]: number; |
79 | | - [VimeoCommand.Unload]: void; |
| 60 | + disableTextTrack: string; |
| 61 | + setQuality: string; |
| 62 | + _showOverlay: void; |
| 63 | + _hideOverlay: void; |
| 64 | + getBuffered: void; |
| 65 | + requestFullscreen: void; |
| 66 | + exitFullscreen: void; |
| 67 | + requestPictureInPicture: void; |
| 68 | + exitPictureInPicture: void; |
| 69 | + getQuality: void; |
| 70 | + getQualities: void; |
| 71 | + getPlayed: void; |
| 72 | + getSeekable: void; |
| 73 | + getSeeking: void; |
| 74 | + getFullscreen: void; |
| 75 | + getPictureInPicture: void; |
| 76 | + destroy: void; |
| 77 | + loadVideo: number; |
| 78 | + unload: void; |
80 | 79 | } |
81 | 80 |
|
82 | 81 | export interface VimeoCommandData { |
83 | | - [VimeoCommand.Play]: void; |
84 | | - [VimeoCommand.Pause]: void; |
85 | | - [VimeoCommand.SetMuted]: void; |
86 | | - [VimeoCommand.SetVolume]: void; |
87 | | - [VimeoCommand.GetDuration]: number; |
88 | | - [VimeoCommand.GetChapters]: VimeoChapter[]; |
89 | | - [VimeoCommand.GetCurrentTime]: number; |
90 | | - [VimeoCommand.SeekTo]: void; |
91 | | - [VimeoCommand.SetPlaybackRate]: void; |
92 | | - [VimeoCommand.AddEventListener]: void; |
93 | | - [VimeoCommand.GetCuePoints]: void; |
94 | | - [VimeoCommand.GetVideoTitle]: string; |
95 | | - [VimeoCommand.GetTextTracks]: VimeoTextTrack[]; |
96 | | - [VimeoCommand.EnableTextTrack]: void; |
97 | | - [VimeoCommand.DisableTextTrack]: void; |
98 | | - [VimeoCommand.SetQuality]: void; |
99 | | - [VimeoCommand.ShowOverlay]: void; |
100 | | - [VimeoCommand.HideOverlay]: void; |
101 | | - [VimeoCommand.GetBuffered]: number; |
102 | | - [VimeoCommand.RequestFullscreen]: void; |
103 | | - [VimeoCommand.ExitFullscreen]: void; |
104 | | - [VimeoCommand.RequestPictureInPicture]: void; |
105 | | - [VimeoCommand.ExitPictureInPicture]: void; |
106 | | - [VimeoCommand.GetQuality]: string; |
107 | | - [VimeoCommand.GetQualities]: VimeoQuality[]; |
108 | | - [VimeoCommand.GetPlayed]: number[]; |
109 | | - [VimeoCommand.GetSeekable]: number[]; |
110 | | - [VimeoCommand.GetSeeking]: boolean; |
111 | | - [VimeoCommand.GetFullscreen]: boolean; |
112 | | - [VimeoCommand.GetPictureInPicture]: boolean; |
113 | | - [VimeoCommand.Destroy]: void; |
114 | | - [VimeoCommand.LoadVideo]: void; |
115 | | - [VimeoCommand.Unload]: void; |
| 82 | + play: void; |
| 83 | + pause: void; |
| 84 | + setMuted: void; |
| 85 | + setVolume: void; |
| 86 | + getDuration: number; |
| 87 | + getChapters: VimeoChapter[]; |
| 88 | + getCurrentTime: number; |
| 89 | + seekTo: void; |
| 90 | + setPlaybackRate: void; |
| 91 | + addEventListener: void; |
| 92 | + getCuePoints: void; |
| 93 | + getVideoTitle: string; |
| 94 | + getTextTracks: VimeoTextTrack[]; |
| 95 | + enableTextTrack: void; |
| 96 | + disableTextTrack: void; |
| 97 | + setQuality: void; |
| 98 | + showOverlay: void; |
| 99 | + hideOverlay: void; |
| 100 | + getBuffered: number; |
| 101 | + requestFullscreen: void; |
| 102 | + exitFullscreen: void; |
| 103 | + requestPictureInPicture: void; |
| 104 | + exitPictureInPicture: void; |
| 105 | + getQuality: string; |
| 106 | + getQualities: VimeoQuality[]; |
| 107 | + getPlayed: number[]; |
| 108 | + getSeekable: number[]; |
| 109 | + getSeeking: boolean; |
| 110 | + getFullscreen: boolean; |
| 111 | + getPictureInPicture: boolean; |
| 112 | + destroy: void; |
| 113 | + loadVideo: void; |
| 114 | + unload: void; |
116 | 115 | } |
0 commit comments