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.js
CHANGED
@@ -1194,7 +1194,7 @@
|
|
1194
1194
|
// Some browsers don't allow to use bind on console object anyway
|
1195
1195
|
// fallback to default if needed
|
1196
1196
|
try {
|
1197
|
-
newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.1-0.canary.
|
1197
|
+
newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.1-0.canary.11107");
|
1198
1198
|
} catch (e) {
|
1199
1199
|
/* log fn threw an exception. All logger methods are no-ops. */
|
1200
1200
|
return createLogger();
|
@@ -16716,7 +16716,7 @@
|
|
16716
16716
|
return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;
|
16717
16717
|
}
|
16718
16718
|
|
16719
|
-
var version = "1.6.1-0.canary.
|
16719
|
+
var version = "1.6.1-0.canary.11107";
|
16720
16720
|
|
16721
16721
|
// ensure the worker ends up in the bundle
|
16722
16722
|
// If the worker should not be included this gets aliased to empty.js
|
@@ -19505,7 +19505,10 @@
|
|
19505
19505
|
if (buffersAppendedTo.length === 0) {
|
19506
19506
|
this.warn("Fragments must have at least one ElementaryStreamType set. type: " + frag.type + " level: " + frag.level + " sn: " + frag.sn);
|
19507
19507
|
}
|
19508
|
-
this.blockBuffers(onUnblocked, buffersAppendedTo)
|
19508
|
+
this.blockBuffers(onUnblocked, buffersAppendedTo).catch(function (error) {
|
19509
|
+
_this15.warn("Fragment buffered callback " + error);
|
19510
|
+
_this15.stepOperationQueue(_this15.sourceBufferTypes);
|
19511
|
+
});
|
19509
19512
|
};
|
19510
19513
|
_proto.onFragChanged = function onFragChanged(event, data) {
|
19511
19514
|
this.trimBuffers();
|
@@ -19988,10 +19991,18 @@
|
|
19988
19991
|
sb.appendBuffer(data);
|
19989
19992
|
};
|
19990
19993
|
_proto.blockUntilOpen = function blockUntilOpen(callback) {
|
19994
|
+
var _this23 = this;
|
19991
19995
|
if (this.isUpdating() || this.isQueued()) {
|
19992
|
-
this.blockBuffers(callback)
|
19996
|
+
this.blockBuffers(callback).catch(function (error) {
|
19997
|
+
_this23.warn("SourceBuffer blocked callback " + error);
|
19998
|
+
_this23.stepOperationQueue(_this23.sourceBufferTypes);
|
19999
|
+
});
|
19993
20000
|
} else {
|
19994
|
-
|
20001
|
+
try {
|
20002
|
+
callback();
|
20003
|
+
} catch (error) {
|
20004
|
+
this.warn("Callback run without blocking " + this.operationQueue + " " + error);
|
20005
|
+
}
|
19995
20006
|
}
|
19996
20007
|
};
|
19997
20008
|
_proto.isUpdating = function isUpdating() {
|
@@ -20002,10 +20013,10 @@
|
|
20002
20013
|
});
|
20003
20014
|
};
|
20004
20015
|
_proto.isQueued = function isQueued() {
|
20005
|
-
var
|
20016
|
+
var _this24 = this;
|
20006
20017
|
return this.sourceBuffers.some(function (_ref15) {
|
20007
20018
|
var type = _ref15[0];
|
20008
|
-
return type && !!
|
20019
|
+
return type && !!_this24.currentOp(type);
|
20009
20020
|
});
|
20010
20021
|
};
|
20011
20022
|
_proto.isPending = function isPending(track) {
|
@@ -20017,46 +20028,45 @@
|
|
20017
20028
|
// upon completion, since we already do it here
|
20018
20029
|
;
|
20019
20030
|
_proto.blockBuffers = function blockBuffers(onUnblocked, bufferNames) {
|
20020
|
-
var
|
20031
|
+
var _this25 = this;
|
20021
20032
|
if (bufferNames === void 0) {
|
20022
20033
|
bufferNames = this.sourceBufferTypes;
|
20023
20034
|
}
|
20024
20035
|
if (!bufferNames.length) {
|
20025
20036
|
this.log('Blocking operation requested, but no SourceBuffers exist');
|
20026
|
-
Promise.resolve().then(onUnblocked);
|
20027
|
-
return;
|
20037
|
+
return Promise.resolve().then(onUnblocked);
|
20028
20038
|
}
|
20029
20039
|
var operationQueue = this.operationQueue;
|
20030
20040
|
|
20031
20041
|
// logger.debug(`[buffer-controller]: Blocking ${buffers} SourceBuffer`);
|
20032
20042
|
var blockingOperations = bufferNames.map(function (type) {
|
20033
|
-
return
|
20043
|
+
return _this25.appendBlocker(type);
|
20034
20044
|
});
|
20035
20045
|
var audioBlocked = bufferNames.length > 1 && !!this.blockedAudioAppend;
|
20036
20046
|
if (audioBlocked) {
|
20037
20047
|
this.unblockAudio();
|
20038
20048
|
}
|
20039
|
-
Promise.all(blockingOperations).then(function (result) {
|
20040
|
-
if (operationQueue !==
|
20049
|
+
return Promise.all(blockingOperations).then(function (result) {
|
20050
|
+
if (operationQueue !== _this25.operationQueue) {
|
20041
20051
|
return;
|
20042
20052
|
}
|
20043
20053
|
// logger.debug(`[buffer-controller]: Blocking operation resolved; unblocking ${buffers} SourceBuffer`);
|
20044
20054
|
onUnblocked();
|
20045
|
-
|
20055
|
+
_this25.stepOperationQueue(_this25.sourceBufferTypes);
|
20046
20056
|
});
|
20047
20057
|
};
|
20048
20058
|
_proto.stepOperationQueue = function stepOperationQueue(bufferNames) {
|
20049
|
-
var
|
20059
|
+
var _this26 = this;
|
20050
20060
|
bufferNames.forEach(function (type) {
|
20051
|
-
var
|
20052
|
-
var sb = (
|
20061
|
+
var _this26$tracks$type;
|
20062
|
+
var sb = (_this26$tracks$type = _this26.tracks[type]) == null ? void 0 : _this26$tracks$type.buffer;
|
20053
20063
|
// Only cycle the queue if the SB is not updating. There's a bug in Chrome which sets the SB updating flag to
|
20054
20064
|
// true when changing the MediaSource duration (https://bugs.chromium.org/p/chromium/issues/detail?id=959359&can=2&q=mediasource%20duration)
|
20055
20065
|
// While this is a workaround, it's probably useful to have around
|
20056
20066
|
if (!sb || sb.updating) {
|
20057
20067
|
return;
|
20058
20068
|
}
|
20059
|
-
|
20069
|
+
_this26.shiftAndExecuteNext(type);
|
20060
20070
|
});
|
20061
20071
|
};
|
20062
20072
|
_proto.append = function append(operation, type, pending) {
|
@@ -20125,9 +20135,9 @@
|
|
20125
20135
|
}, {
|
20126
20136
|
key: "sourceBufferTracks",
|
20127
20137
|
get: function get() {
|
20128
|
-
var
|
20138
|
+
var _this27 = this;
|
20129
20139
|
return Object.keys(this.tracks).reduce(function (baseTracks, type) {
|
20130
|
-
var track =
|
20140
|
+
var track = _this27.tracks[type];
|
20131
20141
|
baseTracks[type] = {
|
20132
20142
|
id: track.id,
|
20133
20143
|
container: track.container,
|
@@ -20140,11 +20150,11 @@
|
|
20140
20150
|
}, {
|
20141
20151
|
key: "bufferedToEnd",
|
20142
20152
|
get: function get() {
|
20143
|
-
var
|
20153
|
+
var _this28 = this;
|
20144
20154
|
return this.sourceBufferCount > 0 && !this.sourceBuffers.some(function (_ref16) {
|
20145
|
-
var
|
20155
|
+
var _this28$tracks$type, _this28$tracks$type2;
|
20146
20156
|
var type = _ref16[0];
|
20147
|
-
return type && (!((
|
20157
|
+
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));
|
20148
20158
|
});
|
20149
20159
|
}
|
20150
20160
|
}, {
|
@@ -20163,9 +20173,9 @@
|
|
20163
20173
|
}, {
|
20164
20174
|
key: "pendingTrackCount",
|
20165
20175
|
get: function get() {
|
20166
|
-
var
|
20176
|
+
var _this29 = this;
|
20167
20177
|
return Object.keys(this.tracks).reduce(function (acc, type) {
|
20168
|
-
return acc + (
|
20178
|
+
return acc + (_this29.isPending(_this29.tracks[type]) ? 1 : 0);
|
20169
20179
|
}, 0);
|
20170
20180
|
}
|
20171
20181
|
}, {
|