aboutsummaryrefslogtreecommitdiff
path: root/web/script/player/track
diff options
context:
space:
mode:
Diffstat (limited to 'web/script/player/track')
-rw-r--r--web/script/player/track/create.ts4
-rw-r--r--web/script/player/track/mse.ts5
2 files changed, 4 insertions, 5 deletions
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;