diff options
Diffstat (limited to 'client/src/assets/player/peertube-videojs-typings.ts')
-rw-r--r-- | client/src/assets/player/peertube-videojs-typings.ts | 67 |
1 files changed, 58 insertions, 9 deletions
diff --git a/client/src/assets/player/peertube-videojs-typings.ts b/client/src/assets/player/peertube-videojs-typings.ts index 634c7fdc9..060ea4dce 100644 --- a/client/src/assets/player/peertube-videojs-typings.ts +++ b/client/src/assets/player/peertube-videojs-typings.ts | |||
@@ -3,11 +3,13 @@ | |||
3 | import * as videojs from 'video.js' | 3 | import * as videojs from 'video.js' |
4 | 4 | ||
5 | import { VideoFile } from '../../../../shared/models/videos/video.model' | 5 | import { VideoFile } from '../../../../shared/models/videos/video.model' |
6 | import { PeerTubePlugin } from './peertube-videojs-plugin' | 6 | import { PeerTubePlugin } from './peertube-plugin' |
7 | import { WebTorrentPlugin } from './webtorrent-plugin' | ||
7 | 8 | ||
8 | declare namespace videojs { | 9 | declare namespace videojs { |
9 | interface Player { | 10 | interface Player { |
10 | peertube (): PeerTubePlugin | 11 | peertube (): PeerTubePlugin |
12 | webtorrent (): WebTorrentPlugin | ||
11 | } | 13 | } |
12 | } | 14 | } |
13 | 15 | ||
@@ -30,26 +32,73 @@ type UserWatching = { | |||
30 | authorizationHeader: string | 32 | authorizationHeader: string |
31 | } | 33 | } |
32 | 34 | ||
33 | type PeertubePluginOptions = { | 35 | type PeerTubePluginOptions = { |
34 | videoFiles: VideoFile[] | 36 | autoplay: boolean |
35 | playerElement: HTMLVideoElement | ||
36 | videoViewUrl: string | 37 | videoViewUrl: string |
37 | videoDuration: number | 38 | videoDuration: number |
38 | startTime: number | string | 39 | startTime: number | string |
39 | autoplay: boolean, | ||
40 | videoCaptions: VideoJSCaption[] | ||
41 | 40 | ||
42 | subtitle?: string | ||
43 | userWatching?: UserWatching | 41 | userWatching?: UserWatching |
42 | subtitle?: string | ||
43 | |||
44 | videoCaptions: VideoJSCaption[] | ||
45 | } | ||
46 | |||
47 | type WebtorrentPluginOptions = { | ||
48 | playerElement: HTMLVideoElement | ||
49 | |||
50 | autoplay: boolean | ||
51 | videoDuration: number | ||
52 | |||
53 | videoFiles: VideoFile[] | ||
54 | } | ||
55 | |||
56 | type P2PMediaLoaderPluginOptions = { | ||
57 | type: string | ||
58 | src: string | ||
59 | } | ||
60 | |||
61 | type VideoJSPluginOptions = { | ||
62 | peertube: PeerTubePluginOptions | ||
63 | |||
64 | webtorrent?: WebtorrentPluginOptions | ||
65 | |||
66 | p2pMediaLoader?: P2PMediaLoaderPluginOptions | ||
44 | } | 67 | } |
45 | 68 | ||
46 | // videojs typings don't have some method we need | 69 | // videojs typings don't have some method we need |
47 | const videojsUntyped = videojs as any | 70 | const videojsUntyped = videojs as any |
48 | 71 | ||
72 | type LoadedQualityData = { | ||
73 | qualitySwitchCallback: Function, | ||
74 | qualityData: { | ||
75 | video: { | ||
76 | id: number | ||
77 | label: string | ||
78 | selected: boolean | ||
79 | }[] | ||
80 | } | ||
81 | } | ||
82 | |||
83 | type ResolutionUpdateData = { | ||
84 | auto: boolean, | ||
85 | resolutionId: number | ||
86 | } | ||
87 | |||
88 | type AutoResolutionUpdateData = { | ||
89 | possible: boolean | ||
90 | } | ||
91 | |||
49 | export { | 92 | export { |
93 | ResolutionUpdateData, | ||
94 | AutoResolutionUpdateData, | ||
50 | VideoJSComponentInterface, | 95 | VideoJSComponentInterface, |
51 | PeertubePluginOptions, | ||
52 | videojsUntyped, | 96 | videojsUntyped, |
53 | VideoJSCaption, | 97 | VideoJSCaption, |
54 | UserWatching | 98 | UserWatching, |
99 | PeerTubePluginOptions, | ||
100 | WebtorrentPluginOptions, | ||
101 | P2PMediaLoaderPluginOptions, | ||
102 | VideoJSPluginOptions, | ||
103 | LoadedQualityData | ||
55 | } | 104 | } |