aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/peertube-videojs-typings.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/assets/player/peertube-videojs-typings.ts')
-rw-r--r--client/src/assets/player/peertube-videojs-typings.ts38
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
4import { HlsConfig, Level } from 'hls.js' 1import { HlsConfig, Level } from 'hls.js'
5import videojs from 'video.js' 2import videojs from 'video.js'
6import { VideoFile, VideoPlaylist, VideoPlaylistElement } from '@shared/models' 3import { VideoFile, VideoPlaylist, VideoPlaylistElement } from '@shared/models'
@@ -8,11 +5,12 @@ import { P2pMediaLoaderPlugin } from './p2p-media-loader/p2p-media-loader-plugin
8import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager' 5import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager'
9import { PlayerMode } from './peertube-player-manager' 6import { PlayerMode } from './peertube-player-manager'
10import { PeerTubePlugin } from './peertube-plugin' 7import { PeerTubePlugin } from './peertube-plugin'
8import { PeerTubeResolutionsPlugin } from './peertube-resolutions-plugin'
11import { PlaylistPlugin } from './playlist/playlist-plugin' 9import { PlaylistPlugin } from './playlist/playlist-plugin'
12import { EndCardOptions } from './upnext/end-card'
13import { StatsCardOptions } from './stats/stats-card' 10import { StatsCardOptions } from './stats/stats-card'
14import { WebTorrentPlugin } from './webtorrent/webtorrent-plugin'
15import { StatsForNerdsPlugin } from './stats/stats-plugin' 11import { StatsForNerdsPlugin } from './stats/stats-plugin'
12import { EndCardOptions } from './upnext/end-card'
13import { WebTorrentPlugin } from './webtorrent/webtorrent-plugin'
16 14
17declare module 'video.js' { 15declare 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
72type QualityLevelRepresentation = { 69type 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
85type QualityLevels = QualityLevelRepresentation[] & {
86 selectedIndex: number
87 selectedIndex_: number
88
89 addQualityLevel (representation: QualityLevelRepresentation): void
90} 79}
91 80
92type VideoJSCaption = { 81type VideoJSCaption = {
@@ -131,7 +120,7 @@ type PlaylistPluginOptions = {
131 120
132type NextPreviousVideoButtonOptions = { 121type 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 = {
214type PlaylistItemOptions = { 203type PlaylistItemOptions = {
215 element: VideoPlaylistElement 204 element: VideoPlaylistElement
216 205
217 onClicked: Function 206 onClicked: () => void
218} 207}
219 208
220export { 209export {
@@ -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}