diff options
author | metamuffin <metamuffin@disroot.org> | 2025-02-11 14:38:03 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-02-11 14:38:03 +0100 |
commit | 545164925f3d724b9313f8e871dbb444fc016168 (patch) | |
tree | efea90a939e217d2bf7ef6093f7b810a77bab9c7 /web/script/player/track/mse.ts | |
parent | ffe3e9cca5341ff102ac2211e165b908e068be15 (diff) | |
download | jellything-545164925f3d724b9313f8e871dbb444fc016168.tar jellything-545164925f3d724b9313f8e871dbb444fc016168.tar.bz2 jellything-545164925f3d724b9313f8e871dbb444fc016168.tar.zst |
Disable tracks that cant be played
Diffstat (limited to 'web/script/player/track/mse.ts')
-rw-r--r-- | web/script/player/track/mse.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/web/script/player/track/mse.ts b/web/script/player/track/mse.ts index b7a31e0..5d1842f 100644 --- a/web/script/player/track/mse.ts +++ b/web/script/player/track/mse.ts @@ -49,7 +49,8 @@ export class MSEPlayerTrack extends PlayerTrack { } this.buffered.value = [] - await this.profile_selector.select_optimal_profile(this.track_index, this.profile); + const canplay = await this.profile_selector.select_optimal_profile(this.track_index, this.profile); + if (!canplay) return this.player.set_track_enabled(this.track_index, false) const ct = track_to_content_type(this.track_from_profile())!; console.log(`track ${this.track_index} source buffer content-type: ${ct}`); this.source_buffer = this.player.media_source.addSourceBuffer(ct); |