diff options
Diffstat (limited to 'client/src/assets')
-rw-r--r-- | client/src/assets/player/p2p-media-loader/hls-plugin.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/client/src/assets/player/p2p-media-loader/hls-plugin.ts b/client/src/assets/player/p2p-media-loader/hls-plugin.ts index d78e1ab90..5bfa39cfa 100644 --- a/client/src/assets/player/p2p-media-loader/hls-plugin.ts +++ b/client/src/assets/player/p2p-media-loader/hls-plugin.ts | |||
@@ -13,6 +13,8 @@ type Metadata = { | |||
13 | levels: Hlsjs.Level[] | 13 | levels: Hlsjs.Level[] |
14 | } | 14 | } |
15 | 15 | ||
16 | type CustomAudioTrack = AudioTrack & { name?: string, lang?: string } | ||
17 | |||
16 | const registerSourceHandler = function (vjs: typeof videojs) { | 18 | const registerSourceHandler = function (vjs: typeof videojs) { |
17 | if (!Hlsjs.isSupported()) { | 19 | if (!Hlsjs.isSupported()) { |
18 | console.warn('Hls.js is not supported in this browser!') | 20 | console.warn('Hls.js is not supported in this browser!') |
@@ -91,7 +93,7 @@ class Html5Hlsjs { | |||
91 | private readonly source: videojs.Tech.SourceObject | 93 | private readonly source: videojs.Tech.SourceObject |
92 | private readonly vjs: typeof videojs | 94 | private readonly vjs: typeof videojs |
93 | 95 | ||
94 | private hls: Hlsjs & { manualLevel?: number } // FIXME: typings | 96 | private hls: Hlsjs & { manualLevel?: number, audioTrack?: any, audioTracks?: CustomAudioTrack[] } // FIXME: typings |
95 | private hlsjsConfig: Partial<Hlsjs.Config & { cueHandler: any }> = null | 97 | private hlsjsConfig: Partial<Hlsjs.Config & { cueHandler: any }> = null |
96 | 98 | ||
97 | private _duration: number = null | 99 | private _duration: number = null |
@@ -393,7 +395,7 @@ class Html5Hlsjs { | |||
393 | } | 395 | } |
394 | 396 | ||
395 | private _onAudioTracks () { | 397 | private _onAudioTracks () { |
396 | const hlsAudioTracks = this.hls.audioTracks as (AudioTrack & { name?: string, lang?: string })[] // FIXME typings | 398 | const hlsAudioTracks = this.hls.audioTracks |
397 | const playerAudioTracks = this.tech.audioTracks() | 399 | const playerAudioTracks = this.tech.audioTracks() |
398 | 400 | ||
399 | if (hlsAudioTracks.length > 1 && playerAudioTracks.length === 0) { | 401 | if (hlsAudioTracks.length > 1 && playerAudioTracks.length === 0) { |