PLEASE JUST FUCKING WORK WHAT

This commit is contained in:
Samidy 2026-03-11 09:28:03 +03:00
parent d0fff02e64
commit 6fd334f74d

View file

@ -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) {