hls.js 1.6.5-0.canary.11268 → 1.6.5
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 +12 -6
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +12 -6
- 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 +12 -6
- 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 +12 -6
- package/dist/hls.mjs.map +1 -1
- package/dist/hls.worker.js +1 -1
- package/dist/hls.worker.js.map +1 -1
- package/package.json +1 -1
- package/src/loader/m3u8-parser.ts +3 -0
- package/src/utils/level-helper.ts +12 -5
package/package.json
CHANGED
@@ -758,6 +758,9 @@ export function mapDateRanges(
|
|
758
758
|
) {
|
759
759
|
// Make sure DateRanges are mapped to a ProgramDateTime tag that applies a date to a segment that overlaps with its start date
|
760
760
|
const programDateTimeCount = programDateTimes.length;
|
761
|
+
if (!programDateTimeCount) {
|
762
|
+
return;
|
763
|
+
}
|
761
764
|
const lastProgramDateTime = programDateTimes[programDateTimeCount - 1];
|
762
765
|
const playlistEnd = details.live ? Infinity : details.totalduration;
|
763
766
|
const dateRangeIds = Object.keys(details.dateRanges);
|
@@ -168,14 +168,14 @@ export function mergeDetails(
|
|
168
168
|
oldDetails,
|
169
169
|
newDetails,
|
170
170
|
(oldFrag, newFrag, newFragIndex, newFragments) => {
|
171
|
-
if (
|
171
|
+
if (
|
172
|
+
(!newDetails.startCC || newDetails.skippedSegments) &&
|
173
|
+
newFrag.cc !== oldFrag.cc
|
174
|
+
) {
|
172
175
|
const ccOffset = oldFrag.cc - newFrag.cc;
|
173
176
|
for (let i = newFragIndex; i < newFragments.length; i++) {
|
174
177
|
newFragments[i].cc += ccOffset;
|
175
178
|
}
|
176
|
-
newDetails.startCC =
|
177
|
-
getFragmentWithSN(oldDetails, newDetails.startSN - 1)?.cc ??
|
178
|
-
newFragments[0].cc;
|
179
179
|
newDetails.endCC = newFragments[newFragments.length - 1].cc;
|
180
180
|
}
|
181
181
|
if (
|
@@ -243,7 +243,6 @@ export function mergeDetails(
|
|
243
243
|
}
|
244
244
|
newDetails.startSN = newFragments[0].sn;
|
245
245
|
} else {
|
246
|
-
newDetails.endCC = newFragments[newFragments.length - 1].cc;
|
247
246
|
if (newDetails.canSkipDateRanges) {
|
248
247
|
newDetails.dateRanges = mergeDateRanges(
|
249
248
|
oldDetails.dateRanges,
|
@@ -266,6 +265,14 @@ export function mergeDetails(
|
|
266
265
|
}
|
267
266
|
mapDateRanges(programDateTimes, newDetails);
|
268
267
|
}
|
268
|
+
newDetails.endCC = newFragments[newFragments.length - 1].cc;
|
269
|
+
}
|
270
|
+
if (!newDetails.startCC) {
|
271
|
+
const fragPriorToNewStart = getFragmentWithSN(
|
272
|
+
oldDetails,
|
273
|
+
newDetails.startSN - 1,
|
274
|
+
);
|
275
|
+
newDetails.startCC = fragPriorToNewStart?.cc ?? newFragments[0].cc;
|
269
276
|
}
|
270
277
|
|
271
278
|
// Merge parts
|