blob: 95bcccad51b43911821372c317a79a6079a43e18 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
/*
This file is part of jellything (https://codeberg.org/metamuffin/jellything)
which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
Copyright (C) 2025 metamuffin <metamuffin.org>
*/
import { VttPlayerTrack } from "./vtt.ts";
import { MSEPlayerTrack } from "./mse.ts";
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 {
if (track_info.kind == "subtitles") return new VttPlayerTrack(player, base_url, track_index, track_info)
else return new MSEPlayerTrack(player, base_url, segment_index, track_index, track_info)
}
|