diff --git a/js/player.js b/js/player.js index f787274..1f31739 100644 --- a/js/player.js +++ b/js/player.js @@ -109,23 +109,19 @@ export class Player { this._setupVideoSync(); } - _resetDashPlayer() { - if (this.dashInitialized && this.dashPlayer) { - try { - this.dashPlayer.attachView(null); - } catch (e) {} - try { - this.dashPlayer.destroy(); - } catch (e) {} - this.dashPlayer = MediaPlayer().create(); - this.dashPlayer.updateSettings({ - streaming: { - buffer: { fastSwitchEnabled: true }, - }, - }); - this.dashInitialized = false; - } +_resetDashPlayer() { + if (this.dashInitialized && this.dashPlayer) { + try { this.dashPlayer.attachView(null); } catch (e) {} + try { this.dashPlayer.destroy(); } catch (e) {} + this.dashPlayer = MediaPlayer().create(); + this.dashPlayer.updateSettings({ + streaming: { + buffer: { fastSwitchEnabled: true }, + }, + }); + this.dashInitialized = false; } +} _setupVideoSync() { if (!this.video || !this.audio) return; @@ -902,10 +898,7 @@ export class Player { console.error('DashPlayer initialize failed for audio:', e); throw new Error('DASH initialization failed'); } - } else if ( - streamUrl && - (streamUrl.includes('.m3u8') || streamUrl.includes('application/vnd.apple.mpegurl')) - ) { + } else if (streamUrl && (streamUrl.includes('.m3u8') || streamUrl.includes('application/vnd.apple.mpegurl'))) { this.setupHlsVideo(activeElement, streamUrl, null); this.applyAudioEffects(); @@ -1070,8 +1063,9 @@ export class Player { } const shuffledSeeds = [...this.radioSeeds].sort(() => 0.5 - Math.random()); - const seeds = - shuffledSeeds.length > 0 ? shuffledSeeds.slice(0, 5) : this.currentTrack ? [this.currentTrack] : []; + const seeds = shuffledSeeds.length > 0 + ? shuffledSeeds.slice(0, 5) + : this.currentTrack ? [this.currentTrack] : []; if (seeds.length === 0) { return; @@ -1090,7 +1084,7 @@ export class Player { ]); const recommendations = await this.api.getRecommendedTracksForPlaylist(seeds, 20, { - knownTrackIds: knownTrackIds, + knownTrackIds: knownTrackIds }); if (recommendations && recommendations.length > 0) {