diff options
author | Chocobozzz <me@florianbigard.com> | 2020-03-31 15:43:17 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-04-01 14:06:46 +0200 |
commit | 4adebd513ec207d54e76a09cd4a8554d1900d34a (patch) | |
tree | 1c141b43b47609522e6290e8b02a3389b72d1a6b /client/src/assets/player | |
parent | 6541071b4acfff9df7b1ddba53000f0e1bba3257 (diff) | |
download | PeerTube-4adebd513ec207d54e76a09cd4a8554d1900d34a.tar.gz PeerTube-4adebd513ec207d54e76a09cd4a8554d1900d34a.tar.zst PeerTube-4adebd513ec207d54e76a09cd4a8554d1900d34a.zip |
Client dependencies upgrade
Diffstat (limited to 'client/src/assets/player')
-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) { |