From de39012c5b020a2b98c21fd3540dde9929ce8c71 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 26 Jan 2024 05:25:55 +0100 Subject: position subs --- web/script/player/profiles.ts | 4 ++-- web/script/player/track.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'web') diff --git a/web/script/player/profiles.ts b/web/script/player/profiles.ts index 726e4ba..fe0e64d 100644 --- a/web/script/player/profiles.ts +++ b/web/script/player/profiles.ts @@ -8,7 +8,7 @@ import { OVar } from "../jshelper/mod.ts"; import { EncodingProfile } from "./jhls.d.ts"; import { profile_to_partial_track, test_media_capability } from "./mediacaps.ts"; import { Player } from "./player.ts"; -import { PlayerTrack } from "./track.ts"; +import { MSEPlayerTrack } from "./track.ts"; const PROFILE_UP_FAC = 0.6 const PROFILE_DOWN_FAC = 0.8 @@ -20,7 +20,7 @@ export class ProfileSelector { constructor( private player: Player, - private track: PlayerTrack, + private track: MSEPlayerTrack, private bandwidth: OVar ) { } diff --git a/web/script/player/track.ts b/web/script/player/track.ts index 75ffdca..b6a280f 100644 --- a/web/script/player/track.ts +++ b/web/script/player/track.ts @@ -62,7 +62,9 @@ export class VttPlayerTrack extends PlayerTrack { super(track_index) this.track = this.player.video.addTextTrack("subtitles", metadata.name, metadata.language) for (const cue of cues) { - this.track.addCue(new VTTCue(cue.start, cue.end, cue.content)) + const c = new VTTCue(cue.start, cue.end, cue.content); + c.line = -2; + this.track.addCue(c) } this.track.mode = "showing" this.abort.signal.addEventListener("abort", () => { -- cgit v1.2.3-70-g09d2