mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-04 02:09:22 +02:00
This commit is contained in:
parent
cb46edfe52
commit
1aae4c9c1b
35 changed files with 725 additions and 181 deletions
14
node_modules/hls.js/src/utils/webvtt-parser.ts
generated
vendored
14
node_modules/hls.js/src/utils/webvtt-parser.ts
generated
vendored
|
@ -92,7 +92,7 @@ const calculateOffset = function (vttCCs: VTTCCs, cc, presentationTime) {
|
|||
|
||||
export function parseWebVTT(
|
||||
vttByteArray: ArrayBuffer,
|
||||
initPTS: RationalTimestamp,
|
||||
initPTS: RationalTimestamp | undefined,
|
||||
vttCCs: VTTCCs,
|
||||
cc: number,
|
||||
timeOffset: number,
|
||||
|
@ -107,10 +107,9 @@ export function parseWebVTT(
|
|||
.replace(LINEBREAKS, '\n')
|
||||
.split('\n');
|
||||
const cues: VTTCue[] = [];
|
||||
const init90kHz = toMpegTsClockFromTimescale(
|
||||
initPTS.baseTime,
|
||||
initPTS.timescale
|
||||
);
|
||||
const init90kHz = initPTS
|
||||
? toMpegTsClockFromTimescale(initPTS.baseTime, initPTS.timescale)
|
||||
: 0;
|
||||
let cueTime = '00:00.000';
|
||||
let timestampMapMPEGTS = 0;
|
||||
let timestampMapLOCAL = 0;
|
||||
|
@ -134,8 +133,11 @@ export function parseWebVTT(
|
|||
calculateOffset(vttCCs, cc, webVttMpegTsMapOffset);
|
||||
}
|
||||
}
|
||||
|
||||
if (webVttMpegTsMapOffset) {
|
||||
if (!initPTS) {
|
||||
parsingError = new Error('Missing initPTS for VTT MPEGTS');
|
||||
return;
|
||||
}
|
||||
// If we have MPEGTS, offset = presentation time + discontinuity offset
|
||||
cueOffset = webVttMpegTsMapOffset - vttCCs.presentationOffset;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue