From e81238038e7a6514d37567ab8ee1cb69ed5ea9fa Mon Sep 17 00:00:00 2001 From: fidoriel <49869342+fidoriel@users.noreply.github.com> Date: Sun, 19 Mar 2023 22:26:36 +0000 Subject: [PATCH] m3u8url --- client/players/LocalAudioPlayer.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/client/players/LocalAudioPlayer.js b/client/players/LocalAudioPlayer.js index 77dbb474..5a76bc5b 100644 --- a/client/players/LocalAudioPlayer.js +++ b/client/players/LocalAudioPlayer.js @@ -28,11 +28,6 @@ export default class LocalAudioPlayer extends EventEmitter { return this.audioTracks[this.currentTrackIndex] || {} } - get hslContentUrl() { - // the hls stream playlist is the same for all tracks - return this.audioTracks[0].relativeContentUrl - } - initialize() { if (document.getElementById('audio-player')) { document.getElementById('audio-player').remove() @@ -132,12 +127,13 @@ export default class LocalAudioPlayer extends EventEmitter { setHlsStream() { this.trackStartTime = 0 + let m3u8Url = this.audioTracks[0].relativeContentUrl // iOS does not support Media Elements but allows for HLS in the native audio player if (!Hls.isSupported()) { console.warn('HLS is not supported - fallback to using audio element') this.usingNativeplayer = true - this.player.src = this.hslContentUrl + this.player.src = m3u8Url this.player.currentTime = this.startTime return } @@ -153,7 +149,7 @@ export default class LocalAudioPlayer extends EventEmitter { this.hlsInstance.attachMedia(this.player) this.hlsInstance.on(Hls.Events.MEDIA_ATTACHED, () => { - this.hlsInstance.loadSource(this.hslContentUrl) + this.hlsInstance.loadSource(m3u8Url) this.hlsInstance.on(Hls.Events.MANIFEST_PARSED, () => { console.log('[HLS] Manifest Parsed')