style: auto-fix linting issues
This commit is contained in:
parent
6fd334f74d
commit
a35b51f8cd
1 changed files with 23 additions and 17 deletions
24
js/player.js
24
js/player.js
|
|
@ -109,10 +109,14 @@ export class Player {
|
||||||
this._setupVideoSync();
|
this._setupVideoSync();
|
||||||
}
|
}
|
||||||
|
|
||||||
_resetDashPlayer() {
|
_resetDashPlayer() {
|
||||||
if (this.dashInitialized && this.dashPlayer) {
|
if (this.dashInitialized && this.dashPlayer) {
|
||||||
try { this.dashPlayer.attachView(null); } catch (e) {}
|
try {
|
||||||
try { this.dashPlayer.destroy(); } catch (e) {}
|
this.dashPlayer.attachView(null);
|
||||||
|
} catch (e) {}
|
||||||
|
try {
|
||||||
|
this.dashPlayer.destroy();
|
||||||
|
} catch (e) {}
|
||||||
this.dashPlayer = MediaPlayer().create();
|
this.dashPlayer = MediaPlayer().create();
|
||||||
this.dashPlayer.updateSettings({
|
this.dashPlayer.updateSettings({
|
||||||
streaming: {
|
streaming: {
|
||||||
|
|
@ -121,7 +125,7 @@ _resetDashPlayer() {
|
||||||
});
|
});
|
||||||
this.dashInitialized = false;
|
this.dashInitialized = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_setupVideoSync() {
|
_setupVideoSync() {
|
||||||
if (!this.video || !this.audio) return;
|
if (!this.video || !this.audio) return;
|
||||||
|
|
||||||
|
|
@ -898,7 +902,10 @@ _resetDashPlayer() {
|
||||||
console.error('DashPlayer initialize failed for audio:', e);
|
console.error('DashPlayer initialize failed for audio:', e);
|
||||||
throw new Error('DASH initialization failed');
|
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.setupHlsVideo(activeElement, streamUrl, null);
|
||||||
this.applyAudioEffects();
|
this.applyAudioEffects();
|
||||||
|
|
||||||
|
|
@ -1063,9 +1070,8 @@ _resetDashPlayer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const shuffledSeeds = [...this.radioSeeds].sort(() => 0.5 - Math.random());
|
const shuffledSeeds = [...this.radioSeeds].sort(() => 0.5 - Math.random());
|
||||||
const seeds = shuffledSeeds.length > 0
|
const seeds =
|
||||||
? shuffledSeeds.slice(0, 5)
|
shuffledSeeds.length > 0 ? shuffledSeeds.slice(0, 5) : this.currentTrack ? [this.currentTrack] : [];
|
||||||
: this.currentTrack ? [this.currentTrack] : [];
|
|
||||||
|
|
||||||
if (seeds.length === 0) {
|
if (seeds.length === 0) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -1084,7 +1090,7 @@ _resetDashPlayer() {
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const recommendations = await this.api.getRecommendedTracksForPlaylist(seeds, 20, {
|
const recommendations = await this.api.getRecommendedTracksForPlaylist(seeds, 20, {
|
||||||
knownTrackIds: knownTrackIds
|
knownTrackIds: knownTrackIds,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (recommendations && recommendations.length > 0) {
|
if (recommendations && recommendations.length > 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue