diff options
author | metamuffin <metamuffin@disroot.org> | 2023-12-10 11:45:58 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-12-10 11:46:08 +0100 |
commit | b6f7531cdd50132cfa35023e1755e656e4189999 (patch) | |
tree | b75bed618aa6f6734d2e978f46dfa67070981e1f /web/script/player/track.ts | |
parent | 74fb6b5835f233d7cdb2952bcf8e29068ff81b60 (diff) | |
download | jellything-b6f7531cdd50132cfa35023e1755e656e4189999.tar jellything-b6f7531cdd50132cfa35023e1755e656e4189999.tar.bz2 jellything-b6f7531cdd50132cfa35023e1755e656e4189999.tar.zst |
add some useless buttons for a/v/s config
Diffstat (limited to 'web/script/player/track.ts')
-rw-r--r-- | web/script/player/track.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/web/script/player/track.ts b/web/script/player/track.ts index cc21763..c7d90da 100644 --- a/web/script/player/track.ts +++ b/web/script/player/track.ts @@ -32,7 +32,7 @@ export class PlayerTrack { async init() { await this.player.profile_selector.select_optimal_profile(this.track_index, this.profile); const ct = track_to_content_type(this.track_from_profile())! - console.log("source buffer content-type: " + ct); + console.log(`track ${this.track_index} source buffer content-type: ${ct}`); this.source_buffer = this.player.media_source.addSourceBuffer(ct); this.source_buffer.mode = "segments"; this.source_buffer.addEventListener("updateend", () => { @@ -51,6 +51,10 @@ export class PlayerTrack { console.error("sourcebuffer abort", e); }); } + destroy() { + console.log(`destroy source buffer for track ${this.track_index}`); + this.player.media_source.removeSourceBuffer(this.source_buffer) + } track_from_profile(): SourceTrack { if (this.profile.value) return profile_to_partial_track(this.profile.value) |