Skip to content

Commit

Permalink
Fix transcript cue text formatting in TranscriptController
Browse files Browse the repository at this point in the history
  • Loading branch information
carlobortolan committed Nov 12, 2024
1 parent 485f5d8 commit 080a3bf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/ts/transcript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class TranscriptController {
}

getTranscriptFromTracks(textTracks: TextTrackList, label?: string): VTTCue[] {
let transcript: VTTCue[] = [];
const transcript: VTTCue[] = [];
for (let i = 0; i < textTracks.length; i++) {
const track = textTracks[i];
if ((track.kind === "captions" || track.kind === "subtitles") && (!label || track.label === label)) {
Expand Down Expand Up @@ -105,7 +105,7 @@ export class TranscriptController {
}
}

onUpdate(data: any) {
onUpdate(data: VTTCue[]) {
this.updateTranscript(data);
}

Expand Down Expand Up @@ -133,7 +133,7 @@ export class TranscriptController {
if ((track.kind === "captions" || track.kind === "subtitles") && (!label || track.label === label)) {
for (let j = 0; j < track.cues.length; j++) {
const cue = track.cues[j];
transcript += `${cue.text}\n\n`;
transcript += `${(cue as VTTCue).text}\n\n`;
}
if (label && transcript !== "") {
return transcript;
Expand Down

0 comments on commit 080a3bf

Please sign in to comment.