hls.js 1.4.6 → 1.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hls.js +48 -43
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +5 -2
- package/dist/hls.light.js.map +1 -1
- package/dist/hls.light.min.js +1 -1
- package/dist/hls.light.min.js.map +1 -1
- package/dist/hls.light.mjs +5 -2
- package/dist/hls.light.mjs.map +1 -1
- package/dist/hls.min.js +1 -1
- package/dist/hls.min.js.map +1 -1
- package/dist/hls.mjs +52 -49
- package/dist/hls.mjs.map +1 -1
- package/dist/hls.worker.js +1 -1
- package/package.json +1 -1
- package/src/controller/base-stream-controller.ts +4 -0
- package/src/controller/subtitle-stream-controller.ts +21 -20
- package/src/controller/timeline-controller.ts +23 -24
- package/src/utils/webvtt-parser.ts +8 -6
- package/src/utils/xhr-loader.ts +1 -0
|
@@ -92,7 +92,7 @@ const calculateOffset = function (vttCCs: VTTCCs, cc, presentationTime) {
|
|
|
92
92
|
|
|
93
93
|
export function parseWebVTT(
|
|
94
94
|
vttByteArray: ArrayBuffer,
|
|
95
|
-
initPTS: RationalTimestamp,
|
|
95
|
+
initPTS: RationalTimestamp | undefined,
|
|
96
96
|
vttCCs: VTTCCs,
|
|
97
97
|
cc: number,
|
|
98
98
|
timeOffset: number,
|
|
@@ -107,10 +107,9 @@ export function parseWebVTT(
|
|
|
107
107
|
.replace(LINEBREAKS, '\n')
|
|
108
108
|
.split('\n');
|
|
109
109
|
const cues: VTTCue[] = [];
|
|
110
|
-
const init90kHz =
|
|
111
|
-
initPTS.baseTime,
|
|
112
|
-
|
|
113
|
-
);
|
|
110
|
+
const init90kHz = initPTS
|
|
111
|
+
? toMpegTsClockFromTimescale(initPTS.baseTime, initPTS.timescale)
|
|
112
|
+
: 0;
|
|
114
113
|
let cueTime = '00:00.000';
|
|
115
114
|
let timestampMapMPEGTS = 0;
|
|
116
115
|
let timestampMapLOCAL = 0;
|
|
@@ -134,8 +133,11 @@ export function parseWebVTT(
|
|
|
134
133
|
calculateOffset(vttCCs, cc, webVttMpegTsMapOffset);
|
|
135
134
|
}
|
|
136
135
|
}
|
|
137
|
-
|
|
138
136
|
if (webVttMpegTsMapOffset) {
|
|
137
|
+
if (!initPTS) {
|
|
138
|
+
parsingError = new Error('Missing initPTS for VTT MPEGTS');
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
139
141
|
// If we have MPEGTS, offset = presentation time + discontinuity offset
|
|
140
142
|
cueOffset = webVttMpegTsMapOffset - vttCCs.presentationOffset;
|
|
141
143
|
}
|