diff options
Diffstat (limited to 'web/script/player/track.ts')
-rw-r--r-- | web/script/player/track.ts | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/web/script/player/track.ts b/web/script/player/track.ts index bcff607..890176c 100644 --- a/web/script/player/track.ts +++ b/web/script/player/track.ts @@ -21,7 +21,7 @@ export class PlayerTrack { private track_index: number, private metadata: JhlsTrack ) { - this.source_buffer = this.player.media_source.addSourceBuffer("video/webm") + this.source_buffer = this.player.media_source.addSourceBuffer("video/webm; codecs=\"opus,vorbis,vp8,vp9,av1\"") this.source_buffer.mode = "segments" this.source_buffer.addEventListener("updateend", () => { if (this.current_load) { @@ -35,6 +35,9 @@ export class PlayerTrack { this.source_buffer.addEventListener("error", e => { console.error("sourcebuffer error", e); }) + this.source_buffer.addEventListener("abort", e => { + console.error("sourcebuffer abort", e); + }) } update_buf_ranges() { @@ -90,11 +93,13 @@ export class PlayerTrack { if (this.source_buffer.updating) return if (this.append_queue.length) { const seg = this.append_queue[0]; - this.source_buffer.timestampOffset = seg.start - // TODO why is pushing so unreliable?! sometimes it does not add it - this.source_buffer.appendBuffer(seg.buf); this.append_queue.splice(0, 1) this.current_load = seg + // TODO why is appending so unreliable?! sometimes it does not add it + this.source_buffer.changeType("video/webm; codecs=\"opus,vorbis,vp8,vp9,av1\"") + this.source_buffer.timestampOffset = seg.start + this.source_buffer.appendBuffer(seg.buf); + } } } |