diff options
author | Chocobozzz <me@florianbigard.com> | 2020-01-31 11:39:50 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-01-31 14:13:00 +0100 |
commit | 83fcadac86da0bc6120a5b93850bb9a7fc069fba (patch) | |
tree | c05e52c22d27d24c84f00630ad58427cf092ed2c /client/src/assets/player/peertube-videojs-typings.ts | |
parent | e40afb5bc486ff2ce1e5f0a21df7e4e32c344b47 (diff) | |
download | PeerTube-83fcadac86da0bc6120a5b93850bb9a7fc069fba.tar.gz PeerTube-83fcadac86da0bc6120a5b93850bb9a7fc069fba.tar.zst PeerTube-83fcadac86da0bc6120a5b93850bb9a7fc069fba.zip |
Move streamroot plugin in core project
To avoid an already bundled HLS.js library, and adapt some parts of the
code
Diffstat (limited to 'client/src/assets/player/peertube-videojs-typings.ts')
-rw-r--r-- | client/src/assets/player/peertube-videojs-typings.ts | 57 |
1 files changed, 44 insertions, 13 deletions
diff --git a/client/src/assets/player/peertube-videojs-typings.ts b/client/src/assets/player/peertube-videojs-typings.ts index e45722661..8f3d76cac 100644 --- a/client/src/assets/player/peertube-videojs-typings.ts +++ b/client/src/assets/player/peertube-videojs-typings.ts | |||
@@ -1,13 +1,17 @@ | |||
1 | import videojs from 'video.js' | ||
2 | import { PeerTubePlugin } from './peertube-plugin' | 1 | import { PeerTubePlugin } from './peertube-plugin' |
3 | import { WebTorrentPlugin } from './webtorrent/webtorrent-plugin' | 2 | import { WebTorrentPlugin } from './webtorrent/webtorrent-plugin' |
4 | import { P2pMediaLoaderPlugin } from './p2p-media-loader/p2p-media-loader-plugin' | 3 | import { P2pMediaLoaderPlugin } from './p2p-media-loader/p2p-media-loader-plugin' |
5 | import { PlayerMode } from './peertube-player-manager' | 4 | import { PlayerMode } from './peertube-player-manager' |
6 | import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager' | 5 | import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager' |
7 | import { VideoFile } from '@shared/models' | 6 | import { VideoFile } from '@shared/models' |
7 | import videojs from 'video.js' | ||
8 | import { Config, Level } from 'hls.js' | ||
8 | 9 | ||
9 | declare module 'video.js' { | 10 | declare module 'video.js' { |
11 | |||
10 | export interface VideoJsPlayer { | 12 | export interface VideoJsPlayer { |
13 | srOptions_: HlsjsConfigHandlerOptions | ||
14 | |||
11 | theaterEnabled: boolean | 15 | theaterEnabled: boolean |
12 | 16 | ||
13 | // FIXME: add it to upstream typings | 17 | // FIXME: add it to upstream typings |
@@ -21,32 +25,57 @@ declare module 'video.js' { | |||
21 | // Plugins | 25 | // Plugins |
22 | 26 | ||
23 | peertube (): PeerTubePlugin | 27 | peertube (): PeerTubePlugin |
28 | |||
24 | webtorrent (): WebTorrentPlugin | 29 | webtorrent (): WebTorrentPlugin |
30 | |||
25 | p2pMediaLoader (): P2pMediaLoaderPlugin | 31 | p2pMediaLoader (): P2pMediaLoaderPlugin |
26 | 32 | ||
27 | contextmenuUI (options: any): any | 33 | contextmenuUI (options: any): any |
28 | 34 | ||
29 | bezels (): void | 35 | bezels (): void |
30 | 36 | ||
31 | qualityLevels (): { height: number, id: number }[] & { | 37 | qualityLevels (): QualityLevels |
32 | selectedIndex: number | ||
33 | selectedIndex_: number | ||
34 | |||
35 | addQualityLevel (representation: { | ||
36 | id: number | ||
37 | label: string | ||
38 | height: number | ||
39 | _enabled: boolean | ||
40 | }): void | ||
41 | } | ||
42 | 38 | ||
43 | textTracks (): TextTrackList & { | 39 | textTracks (): TextTrackList & { |
44 | on: Function | 40 | on: Function |
45 | tracks_: { kind: string, mode: string, language: string }[] | 41 | tracks_: { kind: string, mode: string, language: string }[] |
46 | } | 42 | } |
43 | |||
44 | audioTracks (): AudioTrackList | ||
47 | } | 45 | } |
48 | } | 46 | } |
49 | 47 | ||
48 | export interface VideoJSTechHLS extends videojs.Tech { | ||
49 | hlsProvider: any // FIXME: typings | ||
50 | } | ||
51 | |||
52 | export interface HlsjsConfigHandlerOptions { | ||
53 | hlsjsConfig?: Config & { cueHandler: any }// FIXME: typings | ||
54 | captionConfig?: any // FIXME: typings | ||
55 | |||
56 | levelLabelHandler?: (level: Level) => string | ||
57 | } | ||
58 | |||
59 | type QualityLevelRepresentation = { | ||
60 | id: number | ||
61 | height: number | ||
62 | |||
63 | label?: string | ||
64 | width?: number | ||
65 | bandwidth?: number | ||
66 | bitrate?: number | ||
67 | |||
68 | enabled?: Function | ||
69 | _enabled: boolean | ||
70 | } | ||
71 | |||
72 | type QualityLevels = QualityLevelRepresentation[] & { | ||
73 | selectedIndex: number | ||
74 | selectedIndex_: number | ||
75 | |||
76 | addQualityLevel (representation: QualityLevelRepresentation): void | ||
77 | } | ||
78 | |||
50 | type VideoJSCaption = { | 79 | type VideoJSCaption = { |
51 | label: string | 80 | label: string |
52 | language: string | 81 | language: string |
@@ -148,5 +177,7 @@ export { | |||
148 | WebtorrentPluginOptions, | 177 | WebtorrentPluginOptions, |
149 | P2PMediaLoaderPluginOptions, | 178 | P2PMediaLoaderPluginOptions, |
150 | VideoJSPluginOptions, | 179 | VideoJSPluginOptions, |
151 | LoadedQualityData | 180 | LoadedQualityData, |
181 | QualityLevelRepresentation, | ||
182 | QualityLevels | ||
152 | } | 183 | } |