aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-01-28 18:15:50 +0100
committermetamuffin <metamuffin@disroot.org>2024-01-28 18:15:50 +0100
commitf3d1ce1360d8829b987dd3403e821cebcff58d95 (patch)
treea522e55c635b87481d0406e1bb2395c557d8d532
parent14f8f98ff586268bf35193d5b4c64f0362889359 (diff)
downloadjellything-f3d1ce1360d8829b987dd3403e821cebcff58d95.tar
jellything-f3d1ce1360d8829b987dd3403e821cebcff58d95.tar.bz2
jellything-f3d1ce1360d8829b987dd3403e821cebcff58d95.tar.zst
mse problem where sourcebuffer didnt state it was updating fixed.
-rw-r--r--web/script/player/track/mse.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/web/script/player/track/mse.ts b/web/script/player/track/mse.ts
index 623e149..2d17b87 100644
--- a/web/script/player/track/mse.ts
+++ b/web/script/player/track/mse.ts
@@ -55,9 +55,12 @@ export class MSEPlayerTrack extends PlayerTrack {
this.source_buffer.addEventListener("updateend", () => {
if (this.abort.signal.aborted) return;
if (this.current_load) {
- this.current_load.cb();
this.loading.delete(this.current_load.index);
+ const cb = this.current_load.cb;
this.current_load = undefined;
+ cb()
+ } else {
+ console.warn("updateend but nothing is loading")
}
this.update_buf_ranges();
this.tick_append();
@@ -100,7 +103,6 @@ export class MSEPlayerTrack extends PlayerTrack {
if (!this.check_buf_collision(seg.start, seg.end)) continue;
if (seg.start <= target + MIN_BUFFER_DURATION)
blocking.push(this.load(i));
-
else
this.load(i);
}
@@ -126,7 +128,7 @@ export class MSEPlayerTrack extends PlayerTrack {
});
}
tick_append() {
- if (this.source_buffer.updating) return;
+ if (this.source_buffer.updating || this.current_load) return;
if (this.append_queue.length) {
const seg = this.append_queue[0];
this.append_queue.splice(0, 1);