aboutsummaryrefslogtreecommitdiff
path: root/web/script/player/track/mod.ts
blob: 78a987bdc1efe0f7925f128f9f945aaac592abe4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
    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>
*/
/// <reference lib="dom" />
import { TimeRange } from "../types_stream.ts";
import { OVar } from "../../jshelper/mod.ts";
import { BufferRange } from "../player.ts";

export const TARGET_BUFFER_DURATION = 20
export const MIN_BUFFER_DURATION = 1

export interface AppendRange extends TimeRange { buf: ArrayBuffer, index: number, cb: () => void }

export abstract class PlayerTrack {
    constructor(
        public track_index: number,
    ) { }
    public buffered = new OVar<BufferRange[]>([]);
    public abort = new AbortController()
    async update(_target: number) { }
    public abstract debug(): HTMLElement | OVar<HTMLElement>
}