hls.js 1.6.0-beta.1.0.canary.10770 → 1.6.0-beta.1.0.canary.10773
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 +34 -24
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +10 -10
- 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 +10 -12
- 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 +34 -26
- package/dist/hls.mjs.map +1 -1
- package/dist/hls.worker.js +1 -1
- package/package.json +2 -2
- package/src/controller/audio-stream-controller.ts +32 -18
- package/src/controller/base-stream-controller.ts +2 -5
- package/src/loader/m3u8-parser.ts +2 -2
- package/src/utils/discontinuities.ts +0 -2
- package/src/utils/level-helper.ts +3 -1
package/dist/hls.mjs
CHANGED
@@ -400,7 +400,7 @@ function enableLogs(debugConfig, context, id) {
|
|
400
400
|
// Some browsers don't allow to use bind on console object anyway
|
401
401
|
// fallback to default if needed
|
402
402
|
try {
|
403
|
-
newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.1.0.canary.
|
403
|
+
newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.1.0.canary.10773"}`);
|
404
404
|
} catch (e) {
|
405
405
|
/* log fn threw an exception. All logger methods are no-ops. */
|
406
406
|
return createLogger();
|
@@ -7146,7 +7146,7 @@ class M3U8Parser {
|
|
7146
7146
|
break;
|
7147
7147
|
}
|
7148
7148
|
case 'DISCONTINUITY-SEQUENCE':
|
7149
|
-
discontinuityCounter = parseInt(value1);
|
7149
|
+
level.startCC = discontinuityCounter = parseInt(value1);
|
7150
7150
|
break;
|
7151
7151
|
case 'KEY':
|
7152
7152
|
{
|
@@ -7276,7 +7276,7 @@ class M3U8Parser {
|
|
7276
7276
|
if (!level.live) {
|
7277
7277
|
lastFragment.endList = true;
|
7278
7278
|
}
|
7279
|
-
if (firstFragment) {
|
7279
|
+
if (firstFragment && !level.startCC) {
|
7280
7280
|
level.startCC = firstFragment.cc;
|
7281
7281
|
}
|
7282
7282
|
/**
|
@@ -7610,7 +7610,9 @@ function mergeDetails(oldDetails, newDetails) {
|
|
7610
7610
|
newDetails.fragments.shift();
|
7611
7611
|
}
|
7612
7612
|
newDetails.startSN = newDetails.fragments[0].sn;
|
7613
|
-
newDetails.startCC
|
7613
|
+
if (!newDetails.startCC) {
|
7614
|
+
newDetails.startCC = newDetails.fragments[0].cc;
|
7615
|
+
}
|
7614
7616
|
} else {
|
7615
7617
|
if (newDetails.canSkipDateRanges) {
|
7616
7618
|
newDetails.dateRanges = mergeDateRanges(oldDetails.dateRanges, newDetails);
|
@@ -7875,11 +7877,10 @@ function adjustSlidingStart(sliding, details) {
|
|
7875
7877
|
* The PTS of a fragment lets Hls.js know where it fits into a stream - by knowing every PTS, we know which fragment to
|
7876
7878
|
* download at any given time. PTS is normally computed when the fragment is demuxed, so taking this step saves us time
|
7877
7879
|
* and an extra download.
|
7878
|
-
* @param lastFrag
|
7879
7880
|
* @param lastLevel
|
7880
7881
|
* @param details
|
7881
7882
|
*/
|
7882
|
-
function alignStream(
|
7883
|
+
function alignStream(switchDetails, details) {
|
7883
7884
|
if (!switchDetails) {
|
7884
7885
|
return;
|
7885
7886
|
}
|
@@ -9096,12 +9097,9 @@ class BaseStreamController extends TaskLoop {
|
|
9096
9097
|
const firstLevelLoad = !previousDetails;
|
9097
9098
|
const aligned = details.alignedSliding && isFiniteNumber(slidingStart);
|
9098
9099
|
if (firstLevelLoad || !aligned && !slidingStart) {
|
9099
|
-
|
9100
|
-
fragPrevious
|
9101
|
-
} = this;
|
9102
|
-
alignStream(fragPrevious, switchDetails, details);
|
9100
|
+
alignStream(switchDetails, details);
|
9103
9101
|
const alignedSlidingStart = details.fragmentStart;
|
9104
|
-
this.log(`Live playlist sliding: ${alignedSlidingStart.toFixed(2)} start-sn: ${previousDetails ? previousDetails.startSN : 'na'}->${details.startSN}
|
9102
|
+
this.log(`Live playlist sliding: ${alignedSlidingStart.toFixed(2)} start-sn: ${previousDetails ? previousDetails.startSN : 'na'}->${details.startSN} fragments: ${length}`);
|
9105
9103
|
return alignedSlidingStart;
|
9106
9104
|
}
|
9107
9105
|
return slidingStart;
|
@@ -9803,7 +9801,7 @@ var eventemitter3 = {exports: {}};
|
|
9803
9801
|
var eventemitter3Exports = eventemitter3.exports;
|
9804
9802
|
var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
|
9805
9803
|
|
9806
|
-
const version = "1.6.0-beta.1.0.canary.
|
9804
|
+
const version = "1.6.0-beta.1.0.canary.10773";
|
9807
9805
|
|
9808
9806
|
// ensure the worker ends up in the bundle
|
9809
9807
|
// If the worker should not be included this gets aliased to empty.js
|
@@ -16248,7 +16246,7 @@ class AudioStreamController extends BaseStreamController {
|
|
16248
16246
|
this.nextLoadPosition = this.findSyncFrag(videoAnchor).start;
|
16249
16247
|
this.clearWaitingFragment();
|
16250
16248
|
}
|
16251
|
-
} else
|
16249
|
+
} else {
|
16252
16250
|
this.state = State.IDLE;
|
16253
16251
|
}
|
16254
16252
|
}
|
@@ -16438,17 +16436,14 @@ class AudioStreamController extends BaseStreamController {
|
|
16438
16436
|
}
|
16439
16437
|
onLevelLoaded(event, data) {
|
16440
16438
|
this.mainDetails = data.details;
|
16441
|
-
|
16442
|
-
|
16439
|
+
const cachedTrackLoadedData = this.cachedTrackLoadedData;
|
16440
|
+
if (cachedTrackLoadedData) {
|
16443
16441
|
this.cachedTrackLoadedData = null;
|
16442
|
+
this.hls.trigger(Events.AUDIO_TRACK_LOADED, cachedTrackLoadedData);
|
16444
16443
|
}
|
16445
16444
|
}
|
16446
16445
|
onAudioTrackLoaded(event, data) {
|
16447
16446
|
var _track$details;
|
16448
|
-
if (this.mainDetails == null) {
|
16449
|
-
this.cachedTrackLoadedData = data;
|
16450
|
-
return;
|
16451
|
-
}
|
16452
16447
|
const {
|
16453
16448
|
levels
|
16454
16449
|
} = this;
|
@@ -16456,6 +16451,13 @@ class AudioStreamController extends BaseStreamController {
|
|
16456
16451
|
details: newDetails,
|
16457
16452
|
id: trackId
|
16458
16453
|
} = data;
|
16454
|
+
if (this.mainDetails == null || this.mainDetails.expired || newDetails.endCC > this.mainDetails.endCC) {
|
16455
|
+
this.cachedTrackLoadedData = data;
|
16456
|
+
if (this.state !== State.STOPPED) {
|
16457
|
+
this.state = State.WAITING_TRACK;
|
16458
|
+
}
|
16459
|
+
return;
|
16460
|
+
}
|
16459
16461
|
if (!levels) {
|
16460
16462
|
this.warn(`Audio tracks were reset while loading level ${trackId}`);
|
16461
16463
|
return;
|
@@ -16469,15 +16471,19 @@ class AudioStreamController extends BaseStreamController {
|
|
16469
16471
|
if (newDetails.deltaUpdateFailed || !mainDetails) {
|
16470
16472
|
return;
|
16471
16473
|
}
|
16472
|
-
if (
|
16473
|
-
// Make sure our audio rendition is aligned with the "main" rendition, using
|
16474
|
-
// pdt as our reference times.
|
16475
|
-
alignMediaPlaylistByPDT(newDetails, mainDetails);
|
16476
|
-
sliding = newDetails.fragmentStart;
|
16477
|
-
} else {
|
16474
|
+
if (track.details) {
|
16478
16475
|
var _this$levelLastLoaded;
|
16479
16476
|
sliding = this.alignPlaylists(newDetails, track.details, (_this$levelLastLoaded = this.levelLastLoaded) == null ? void 0 : _this$levelLastLoaded.details);
|
16480
16477
|
}
|
16478
|
+
if (!newDetails.alignedSliding) {
|
16479
|
+
// Align audio rendition with the "main" playlist on discontinuity change
|
16480
|
+
// or program-date-time (PDT)
|
16481
|
+
alignDiscontinuities(newDetails, mainDetails);
|
16482
|
+
if (!newDetails.alignedSliding) {
|
16483
|
+
alignMediaPlaylistByPDT(newDetails, mainDetails);
|
16484
|
+
}
|
16485
|
+
sliding = newDetails.fragmentStart;
|
16486
|
+
}
|
16481
16487
|
}
|
16482
16488
|
track.details = newDetails;
|
16483
16489
|
this.levelLastLoaded = track;
|
@@ -16556,7 +16562,9 @@ class AudioStreamController extends BaseStreamController {
|
|
16556
16562
|
complete: false
|
16557
16563
|
};
|
16558
16564
|
cache.push(new Uint8Array(payload));
|
16559
|
-
this.state
|
16565
|
+
if (this.state !== State.STOPPED) {
|
16566
|
+
this.state = State.WAITING_INIT_PTS;
|
16567
|
+
}
|
16560
16568
|
}
|
16561
16569
|
}
|
16562
16570
|
_handleFragmentLoadComplete(fragLoadedData) {
|