hls.js 1.6.1-0.canary.11104 → 1.6.1-0.canary.11107
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 +35 -25
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +35 -25
- 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 +18 -9
- 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 +18 -9
- package/dist/hls.mjs.map +1 -1
- package/dist/hls.worker.js +1 -1
- package/package.json +2 -2
- package/src/controller/buffer-controller.ts +19 -8
package/dist/hls.light.js
CHANGED
@@ -1165,7 +1165,7 @@
|
|
1165
1165
|
// Some browsers don't allow to use bind on console object anyway
|
1166
1166
|
// fallback to default if needed
|
1167
1167
|
try {
|
1168
|
-
newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.1-0.canary.
|
1168
|
+
newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.1-0.canary.11107");
|
1169
1169
|
} catch (e) {
|
1170
1170
|
/* log fn threw an exception. All logger methods are no-ops. */
|
1171
1171
|
return createLogger();
|
@@ -6000,7 +6000,10 @@
|
|
6000
6000
|
if (buffersAppendedTo.length === 0) {
|
6001
6001
|
this.warn("Fragments must have at least one ElementaryStreamType set. type: " + frag.type + " level: " + frag.level + " sn: " + frag.sn);
|
6002
6002
|
}
|
6003
|
-
this.blockBuffers(onUnblocked, buffersAppendedTo)
|
6003
|
+
this.blockBuffers(onUnblocked, buffersAppendedTo).catch(function (error) {
|
6004
|
+
_this15.warn("Fragment buffered callback " + error);
|
6005
|
+
_this15.stepOperationQueue(_this15.sourceBufferTypes);
|
6006
|
+
});
|
6004
6007
|
};
|
6005
6008
|
_proto.onFragChanged = function onFragChanged(event, data) {
|
6006
6009
|
this.trimBuffers();
|
@@ -6483,10 +6486,18 @@
|
|
6483
6486
|
sb.appendBuffer(data);
|
6484
6487
|
};
|
6485
6488
|
_proto.blockUntilOpen = function blockUntilOpen(callback) {
|
6489
|
+
var _this23 = this;
|
6486
6490
|
if (this.isUpdating() || this.isQueued()) {
|
6487
|
-
this.blockBuffers(callback)
|
6491
|
+
this.blockBuffers(callback).catch(function (error) {
|
6492
|
+
_this23.warn("SourceBuffer blocked callback " + error);
|
6493
|
+
_this23.stepOperationQueue(_this23.sourceBufferTypes);
|
6494
|
+
});
|
6488
6495
|
} else {
|
6489
|
-
|
6496
|
+
try {
|
6497
|
+
callback();
|
6498
|
+
} catch (error) {
|
6499
|
+
this.warn("Callback run without blocking " + this.operationQueue + " " + error);
|
6500
|
+
}
|
6490
6501
|
}
|
6491
6502
|
};
|
6492
6503
|
_proto.isUpdating = function isUpdating() {
|
@@ -6497,10 +6508,10 @@
|
|
6497
6508
|
});
|
6498
6509
|
};
|
6499
6510
|
_proto.isQueued = function isQueued() {
|
6500
|
-
var
|
6511
|
+
var _this24 = this;
|
6501
6512
|
return this.sourceBuffers.some(function (_ref15) {
|
6502
6513
|
var type = _ref15[0];
|
6503
|
-
return type && !!
|
6514
|
+
return type && !!_this24.currentOp(type);
|
6504
6515
|
});
|
6505
6516
|
};
|
6506
6517
|
_proto.isPending = function isPending(track) {
|
@@ -6512,46 +6523,45 @@
|
|
6512
6523
|
// upon completion, since we already do it here
|
6513
6524
|
;
|
6514
6525
|
_proto.blockBuffers = function blockBuffers(onUnblocked, bufferNames) {
|
6515
|
-
var
|
6526
|
+
var _this25 = this;
|
6516
6527
|
if (bufferNames === void 0) {
|
6517
6528
|
bufferNames = this.sourceBufferTypes;
|
6518
6529
|
}
|
6519
6530
|
if (!bufferNames.length) {
|
6520
6531
|
this.log('Blocking operation requested, but no SourceBuffers exist');
|
6521
|
-
Promise.resolve().then(onUnblocked);
|
6522
|
-
return;
|
6532
|
+
return Promise.resolve().then(onUnblocked);
|
6523
6533
|
}
|
6524
6534
|
var operationQueue = this.operationQueue;
|
6525
6535
|
|
6526
6536
|
// logger.debug(`[buffer-controller]: Blocking ${buffers} SourceBuffer`);
|
6527
6537
|
var blockingOperations = bufferNames.map(function (type) {
|
6528
|
-
return
|
6538
|
+
return _this25.appendBlocker(type);
|
6529
6539
|
});
|
6530
6540
|
var audioBlocked = bufferNames.length > 1 && !!this.blockedAudioAppend;
|
6531
6541
|
if (audioBlocked) {
|
6532
6542
|
this.unblockAudio();
|
6533
6543
|
}
|
6534
|
-
Promise.all(blockingOperations).then(function (result) {
|
6535
|
-
if (operationQueue !==
|
6544
|
+
return Promise.all(blockingOperations).then(function (result) {
|
6545
|
+
if (operationQueue !== _this25.operationQueue) {
|
6536
6546
|
return;
|
6537
6547
|
}
|
6538
6548
|
// logger.debug(`[buffer-controller]: Blocking operation resolved; unblocking ${buffers} SourceBuffer`);
|
6539
6549
|
onUnblocked();
|
6540
|
-
|
6550
|
+
_this25.stepOperationQueue(_this25.sourceBufferTypes);
|
6541
6551
|
});
|
6542
6552
|
};
|
6543
6553
|
_proto.stepOperationQueue = function stepOperationQueue(bufferNames) {
|
6544
|
-
var
|
6554
|
+
var _this26 = this;
|
6545
6555
|
bufferNames.forEach(function (type) {
|
6546
|
-
var
|
6547
|
-
var sb = (
|
6556
|
+
var _this26$tracks$type;
|
6557
|
+
var sb = (_this26$tracks$type = _this26.tracks[type]) == null ? void 0 : _this26$tracks$type.buffer;
|
6548
6558
|
// Only cycle the queue if the SB is not updating. There's a bug in Chrome which sets the SB updating flag to
|
6549
6559
|
// true when changing the MediaSource duration (https://bugs.chromium.org/p/chromium/issues/detail?id=959359&can=2&q=mediasource%20duration)
|
6550
6560
|
// While this is a workaround, it's probably useful to have around
|
6551
6561
|
if (!sb || sb.updating) {
|
6552
6562
|
return;
|
6553
6563
|
}
|
6554
|
-
|
6564
|
+
_this26.shiftAndExecuteNext(type);
|
6555
6565
|
});
|
6556
6566
|
};
|
6557
6567
|
_proto.append = function append(operation, type, pending) {
|
@@ -6620,9 +6630,9 @@
|
|
6620
6630
|
}, {
|
6621
6631
|
key: "sourceBufferTracks",
|
6622
6632
|
get: function get() {
|
6623
|
-
var
|
6633
|
+
var _this27 = this;
|
6624
6634
|
return Object.keys(this.tracks).reduce(function (baseTracks, type) {
|
6625
|
-
var track =
|
6635
|
+
var track = _this27.tracks[type];
|
6626
6636
|
baseTracks[type] = {
|
6627
6637
|
id: track.id,
|
6628
6638
|
container: track.container,
|
@@ -6635,11 +6645,11 @@
|
|
6635
6645
|
}, {
|
6636
6646
|
key: "bufferedToEnd",
|
6637
6647
|
get: function get() {
|
6638
|
-
var
|
6648
|
+
var _this28 = this;
|
6639
6649
|
return this.sourceBufferCount > 0 && !this.sourceBuffers.some(function (_ref16) {
|
6640
|
-
var
|
6650
|
+
var _this28$tracks$type, _this28$tracks$type2;
|
6641
6651
|
var type = _ref16[0];
|
6642
|
-
return type && (!((
|
6652
|
+
return type && (!((_this28$tracks$type = _this28.tracks[type]) != null && _this28$tracks$type.ended) || ((_this28$tracks$type2 = _this28.tracks[type]) == null ? void 0 : _this28$tracks$type2.ending));
|
6643
6653
|
});
|
6644
6654
|
}
|
6645
6655
|
}, {
|
@@ -6658,9 +6668,9 @@
|
|
6658
6668
|
}, {
|
6659
6669
|
key: "pendingTrackCount",
|
6660
6670
|
get: function get() {
|
6661
|
-
var
|
6671
|
+
var _this29 = this;
|
6662
6672
|
return Object.keys(this.tracks).reduce(function (acc, type) {
|
6663
|
-
return acc + (
|
6673
|
+
return acc + (_this29.isPending(_this29.tracks[type]) ? 1 : 0);
|
6664
6674
|
}, 0);
|
6665
6675
|
}
|
6666
6676
|
}, {
|
@@ -20414,7 +20424,7 @@
|
|
20414
20424
|
return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;
|
20415
20425
|
}
|
20416
20426
|
|
20417
|
-
var version = "1.6.1-0.canary.
|
20427
|
+
var version = "1.6.1-0.canary.11107";
|
20418
20428
|
|
20419
20429
|
// ensure the worker ends up in the bundle
|
20420
20430
|
// If the worker should not be included this gets aliased to empty.js
|