aboutsummaryrefslogtreecommitdiff
path: root/web/script
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-10-09 15:15:45 +0200
committermetamuffin <metamuffin@disroot.org>2025-10-09 15:15:45 +0200
commitd9aa1005b589ae5eae93f00b25852166226bb9fd (patch)
tree5c70c7720af4b511a92d05e8f9d3bdb852482afc /web/script
parentf7e3841426ed4661ede6ccfff9c306141735d465 (diff)
downloadjellything-d9aa1005b589ae5eae93f00b25852166226bb9fd.tar
jellything-d9aa1005b589ae5eae93f00b25852166226bb9fd.tar.bz2
jellything-d9aa1005b589ae5eae93f00b25852166226bb9fd.tar.zst
remove multisegment support from jsp
Diffstat (limited to 'web/script')
-rw-r--r--web/script/player/player.ts2
-rw-r--r--web/script/player/track/create.ts4
-rw-r--r--web/script/player/track/mse.ts5
3 files changed, 5 insertions, 6 deletions
diff --git a/web/script/player/player.ts b/web/script/player/player.ts
index 2991d27..5f70418 100644
--- a/web/script/player/player.ts
+++ b/web/script/player/player.ts
@@ -149,7 +149,7 @@ export class Player {
track.abort.abort()
} else if (state && active_index == -1) {
this.logger?.log(`Enabled track ${index}: ${display_track(this.tracks![index])}`)
- this.active_tracks.value.push(create_track(this, this.base_url, 0, index, this.tracks![index])!)
+ this.active_tracks.value.push(create_track(this, this.base_url, index, this.tracks![index])!)
if (update) await this.update()
}
this.active_tracks.change()
diff --git a/web/script/player/track/create.ts b/web/script/player/track/create.ts
index e3b0f17..7a5db0e 100644
--- a/web/script/player/track/create.ts
+++ b/web/script/player/track/create.ts
@@ -9,7 +9,7 @@ import { Player } from "../player.ts";
import { PlayerTrack } from "./mod.ts";
import { TrackInfo } from "../types_stream.ts";
-export function create_track(player: Player, base_url: string, segment_index: number, track_index: number, track_info: TrackInfo): PlayerTrack | undefined {
+export function create_track(player: Player, base_url: string, track_index: number, track_info: TrackInfo): PlayerTrack | undefined {
if (track_info.kind == "subtitle") return new VttPlayerTrack(player, base_url, track_index, track_info)
- else return new MSEPlayerTrack(player, base_url, segment_index, track_index, track_info)
+ else return new MSEPlayerTrack(player, base_url, track_index, track_info)
}
diff --git a/web/script/player/track/mse.ts b/web/script/player/track/mse.ts
index 72aa0c3..468fbf8 100644
--- a/web/script/player/track/mse.ts
+++ b/web/script/player/track/mse.ts
@@ -25,7 +25,6 @@ export class MSEPlayerTrack extends PlayerTrack {
constructor(
private player: Player,
private base_url: string,
- private segment_index: number,
track_index: number,
public trackinfo: TrackInfo,
) {
@@ -36,7 +35,7 @@ export class MSEPlayerTrack extends PlayerTrack {
async init() {
this.buffered.value = [{ start: 0, end: this.player.duration.value, status: "loading" }]
try {
- const res = await fetch(`${this.base_url}?fragmentindex&segment=${this.segment_index}&track=${this.track_index}`, { headers: { "Accept": "application/json" } });
+ const res = await fetch(`${this.base_url}?fragmentindex&t=${this.track_index}`, { headers: { "Accept": "application/json" } });
if (!res.ok) return this.player.error.value = "Cannot download index.", undefined;
let index!: FragmentIndex & { error: string; };
try { index = await res.json(); }
@@ -164,7 +163,7 @@ export class MSEPlayerTrack extends PlayerTrack {
this.loading.add(index);
this.update_buf_ranges()
// TODO update format selection
- const url = `${this.base_url}?fragment&segment=${this.segment_index}&track=${this.track_index}&format=${this.active_format.value!.format_index}&index=${index}&container=${this.active_format.value!.container}`;
+ const url = `${this.base_url}?fragment&t=${this.track_index}&f=${this.active_format.value!.format_index}&i=${index}&c=${this.active_format.value!.container}`;
const buf = await this.player.downloader.download(url);
await new Promise<void>(cb => {
if (!this.index) return;