diff options
Diffstat (limited to 'client/src/assets/player/peertube-videojs-typings.ts')
-rw-r--r-- | client/src/assets/player/peertube-videojs-typings.ts | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/client/src/assets/player/peertube-videojs-typings.ts b/client/src/assets/player/peertube-videojs-typings.ts index 97828c802..bd6db4ffc 100644 --- a/client/src/assets/player/peertube-videojs-typings.ts +++ b/client/src/assets/player/peertube-videojs-typings.ts | |||
@@ -1,6 +1,3 @@ | |||
1 | // FIXME: lint | ||
2 | /* eslint-disable @typescript-eslint/ban-types */ | ||
3 | |||
4 | import { HlsConfig, Level } from 'hls.js' | 1 | import { HlsConfig, Level } from 'hls.js' |
5 | import videojs from 'video.js' | 2 | import videojs from 'video.js' |
6 | import { VideoFile, VideoPlaylist, VideoPlaylistElement } from '@shared/models' | 3 | import { VideoFile, VideoPlaylist, VideoPlaylistElement } from '@shared/models' |
@@ -8,11 +5,12 @@ import { P2pMediaLoaderPlugin } from './p2p-media-loader/p2p-media-loader-plugin | |||
8 | import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager' | 5 | import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager' |
9 | import { PlayerMode } from './peertube-player-manager' | 6 | import { PlayerMode } from './peertube-player-manager' |
10 | import { PeerTubePlugin } from './peertube-plugin' | 7 | import { PeerTubePlugin } from './peertube-plugin' |
8 | import { PeerTubeResolutionsPlugin } from './peertube-resolutions-plugin' | ||
11 | import { PlaylistPlugin } from './playlist/playlist-plugin' | 9 | import { PlaylistPlugin } from './playlist/playlist-plugin' |
12 | import { EndCardOptions } from './upnext/end-card' | ||
13 | import { StatsCardOptions } from './stats/stats-card' | 10 | import { StatsCardOptions } from './stats/stats-card' |
14 | import { WebTorrentPlugin } from './webtorrent/webtorrent-plugin' | ||
15 | import { StatsForNerdsPlugin } from './stats/stats-plugin' | 11 | import { StatsForNerdsPlugin } from './stats/stats-plugin' |
12 | import { EndCardOptions } from './upnext/end-card' | ||
13 | import { WebTorrentPlugin } from './webtorrent/webtorrent-plugin' | ||
16 | 14 | ||
17 | declare module 'video.js' { | 15 | declare module 'video.js' { |
18 | 16 | ||
@@ -37,16 +35,15 @@ declare module 'video.js' { | |||
37 | 35 | ||
38 | p2pMediaLoader (): P2pMediaLoaderPlugin | 36 | p2pMediaLoader (): P2pMediaLoaderPlugin |
39 | 37 | ||
38 | peertubeResolutions (): PeerTubeResolutionsPlugin | ||
39 | |||
40 | contextmenuUI (options: any): any | 40 | contextmenuUI (options: any): any |
41 | 41 | ||
42 | bezels (): void | 42 | bezels (): void |
43 | 43 | ||
44 | stats (options?: StatsCardOptions): StatsForNerdsPlugin | 44 | stats (options?: StatsCardOptions): StatsForNerdsPlugin |
45 | 45 | ||
46 | qualityLevels (): QualityLevels | ||
47 | |||
48 | textTracks (): TextTrackList & { | 46 | textTracks (): TextTrackList & { |
49 | on: Function | ||
50 | tracks_: (TextTrack & { id: string, label: string, src: string })[] | 47 | tracks_: (TextTrack & { id: string, label: string, src: string })[] |
51 | } | 48 | } |
52 | 49 | ||
@@ -69,24 +66,16 @@ export interface HlsjsConfigHandlerOptions { | |||
69 | levelLabelHandler?: (level: Level) => string | 66 | levelLabelHandler?: (level: Level) => string |
70 | } | 67 | } |
71 | 68 | ||
72 | type QualityLevelRepresentation = { | 69 | type PeerTubeResolution = { |
73 | id: number | 70 | id: number |
74 | height: number | ||
75 | 71 | ||
72 | height?: number | ||
76 | label?: string | 73 | label?: string |
77 | width?: number | 74 | width?: number |
78 | bandwidth?: number | ||
79 | bitrate?: number | 75 | bitrate?: number |
80 | 76 | ||
81 | enabled?: Function | 77 | selected: boolean |
82 | _enabled: boolean | 78 | selectCallback: () => void |
83 | } | ||
84 | |||
85 | type QualityLevels = QualityLevelRepresentation[] & { | ||
86 | selectedIndex: number | ||
87 | selectedIndex_: number | ||
88 | |||
89 | addQualityLevel (representation: QualityLevelRepresentation): void | ||
90 | } | 79 | } |
91 | 80 | ||
92 | type VideoJSCaption = { | 81 | type VideoJSCaption = { |
@@ -131,7 +120,7 @@ type PlaylistPluginOptions = { | |||
131 | 120 | ||
132 | type NextPreviousVideoButtonOptions = { | 121 | type NextPreviousVideoButtonOptions = { |
133 | type: 'next' | 'previous' | 122 | type: 'next' | 'previous' |
134 | handler: Function | 123 | handler: () => void |
135 | isDisabled: () => boolean | 124 | isDisabled: () => boolean |
136 | } | 125 | } |
137 | 126 | ||
@@ -214,7 +203,7 @@ type PlayerNetworkInfo = { | |||
214 | type PlaylistItemOptions = { | 203 | type PlaylistItemOptions = { |
215 | element: VideoPlaylistElement | 204 | element: VideoPlaylistElement |
216 | 205 | ||
217 | onClicked: Function | 206 | onClicked: () => void |
218 | } | 207 | } |
219 | 208 | ||
220 | export { | 209 | export { |
@@ -229,9 +218,8 @@ export { | |||
229 | PeerTubePluginOptions, | 218 | PeerTubePluginOptions, |
230 | WebtorrentPluginOptions, | 219 | WebtorrentPluginOptions, |
231 | P2PMediaLoaderPluginOptions, | 220 | P2PMediaLoaderPluginOptions, |
221 | PeerTubeResolution, | ||
232 | VideoJSPluginOptions, | 222 | VideoJSPluginOptions, |
233 | LoadedQualityData, | 223 | LoadedQualityData, |
234 | QualityLevelRepresentation, | 224 | PeerTubeLinkButtonOptions |
235 | PeerTubeLinkButtonOptions, | ||
236 | QualityLevels | ||
237 | } | 225 | } |