aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/peertube-videojs-typings.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-01-31 11:39:50 +0100
committerChocobozzz <me@florianbigard.com>2020-01-31 14:13:00 +0100
commit83fcadac86da0bc6120a5b93850bb9a7fc069fba (patch)
treec05e52c22d27d24c84f00630ad58427cf092ed2c /client/src/assets/player/peertube-videojs-typings.ts
parente40afb5bc486ff2ce1e5f0a21df7e4e32c344b47 (diff)
downloadPeerTube-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.ts57
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 @@
1import videojs from 'video.js'
2import { PeerTubePlugin } from './peertube-plugin' 1import { PeerTubePlugin } from './peertube-plugin'
3import { WebTorrentPlugin } from './webtorrent/webtorrent-plugin' 2import { WebTorrentPlugin } from './webtorrent/webtorrent-plugin'
4import { P2pMediaLoaderPlugin } from './p2p-media-loader/p2p-media-loader-plugin' 3import { P2pMediaLoaderPlugin } from './p2p-media-loader/p2p-media-loader-plugin'
5import { PlayerMode } from './peertube-player-manager' 4import { PlayerMode } from './peertube-player-manager'
6import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager' 5import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager'
7import { VideoFile } from '@shared/models' 6import { VideoFile } from '@shared/models'
7import videojs from 'video.js'
8import { Config, Level } from 'hls.js'
8 9
9declare module 'video.js' { 10declare 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
48export interface VideoJSTechHLS extends videojs.Tech {
49 hlsProvider: any // FIXME: typings
50}
51
52export interface HlsjsConfigHandlerOptions {
53 hlsjsConfig?: Config & { cueHandler: any }// FIXME: typings
54 captionConfig?: any // FIXME: typings
55
56 levelLabelHandler?: (level: Level) => string
57}
58
59type 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
72type QualityLevels = QualityLevelRepresentation[] & {
73 selectedIndex: number
74 selectedIndex_: number
75
76 addQualityLevel (representation: QualityLevelRepresentation): void
77}
78
50type VideoJSCaption = { 79type 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}