@byteplus/veplayer-plugin 2.4.0-rc.3 → 2.4.0-rc.4
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/esm/index.development.js +133 -43
- package/esm/index.production.js +3 -3
- package/esm/veplayer.plugin.flv.development.js +21 -7
- package/esm/veplayer.plugin.flv.production.js +1 -1
- package/esm/veplayer.plugin.hls.development.js +104 -28
- package/esm/veplayer.plugin.hls.production.js +1 -1
- package/package.json +1 -1
- package/umd/veplayer.plugin.flv.development.js +21 -7
- package/umd/veplayer.plugin.flv.production.js +1 -1
- package/umd/veplayer.plugin.hls.development.js +104 -28
- package/umd/veplayer.plugin.hls.production.js +1 -1
package/esm/index.development.js
CHANGED
|
@@ -1695,7 +1695,7 @@ var sniffer = {
|
|
|
1695
1695
|
}
|
|
1696
1696
|
}
|
|
1697
1697
|
};
|
|
1698
|
-
var version$3 = "3.0.
|
|
1698
|
+
var version$3 = "3.0.19-rc.0";
|
|
1699
1699
|
var ERROR_MAP = {
|
|
1700
1700
|
1: 5101,
|
|
1701
1701
|
2: 5102,
|
|
@@ -2950,6 +2950,7 @@ var ERR$3 = {
|
|
|
2950
2950
|
MSE_APPEND_BUFFER: "MSE_APPEND_BUFFER",
|
|
2951
2951
|
MSE_OTHER: "MSE_OTHER",
|
|
2952
2952
|
MSE_FULL: "MSE_FULL",
|
|
2953
|
+
MSE_CHANGE_TYPE: "MSE_CHANGE_TYPE",
|
|
2953
2954
|
OPTION: "OPTION",
|
|
2954
2955
|
DASH: "DASH",
|
|
2955
2956
|
LICENSE: "LICENSE",
|
|
@@ -2992,6 +2993,7 @@ var ERR_CODE$3 = (_ERR_CODE$3 = {}, _defineProperty$f(_ERR_CODE$3, ERR$3.MANIFES
|
|
|
2992
2993
|
MSE_OTHER: 5202,
|
|
2993
2994
|
MSE_FULL: 5203,
|
|
2994
2995
|
MSE_HIJACK: 5204,
|
|
2996
|
+
MSE_CHANGE_TYPE: 5205,
|
|
2995
2997
|
EME_HIJACK: 5301
|
|
2996
2998
|
}), _defineProperty$f(_ERR_CODE$3, ERR$3.DRM, {
|
|
2997
2999
|
LICENSE: 7100,
|
|
@@ -3327,7 +3329,7 @@ var MSE$3 = /* @__PURE__ */ function() {
|
|
|
3327
3329
|
queue.shift();
|
|
3328
3330
|
}
|
|
3329
3331
|
if (op) {
|
|
3330
|
-
var _this2$_sourceBuffer
|
|
3332
|
+
var _this2$_sourceBuffer$, _op$context;
|
|
3331
3333
|
var costtime = nowTime$6() - _this2._opst;
|
|
3332
3334
|
_this2._logger.debug("UpdateEnd(".concat(type, "/").concat(op.opName, ")"), SafeJSON$1.stringify(getTimeRanges$1((_this2$_sourceBuffer$ = _this2._sourceBuffer[type]) === null || _this2$_sourceBuffer$ === void 0 ? void 0 : _this2$_sourceBuffer$.buffered)), costtime, op.context);
|
|
3333
3335
|
op.promise.resolve({
|
|
@@ -3335,6 +3337,10 @@ var MSE$3 = /* @__PURE__ */ function() {
|
|
|
3335
3337
|
context: op.context,
|
|
3336
3338
|
costtime
|
|
3337
3339
|
});
|
|
3340
|
+
var callback = (_op$context = op.context) === null || _op$context === void 0 ? void 0 : _op$context.callback;
|
|
3341
|
+
if (callback && typeof callback === "function") {
|
|
3342
|
+
callback(op.context);
|
|
3343
|
+
}
|
|
3338
3344
|
_this2._startQueue(type);
|
|
3339
3345
|
}
|
|
3340
3346
|
}
|
|
@@ -3596,10 +3602,15 @@ var MSE$3 = /* @__PURE__ */ function() {
|
|
|
3596
3602
|
var sb = this._sourceBuffer[type];
|
|
3597
3603
|
if (!this.mediaSource || !sb || sb.mimeType === mimeType)
|
|
3598
3604
|
return Promise.resolve();
|
|
3599
|
-
if (typeof sb.changeType !== "function")
|
|
3600
|
-
return Promise.reject();
|
|
3605
|
+
if (typeof sb.changeType !== "function") {
|
|
3606
|
+
return Promise.reject(new StreamingError$3(ERR$3.MEDIA, ERR$3.SUB_TYPES.MSE_CHANGE_TYPE, new Error("changeType is not a function")));
|
|
3607
|
+
}
|
|
3601
3608
|
return this._enqueueOp(type, function() {
|
|
3602
|
-
|
|
3609
|
+
try {
|
|
3610
|
+
sb.changeType(mimeType);
|
|
3611
|
+
} catch (e) {
|
|
3612
|
+
throw new StreamingError$3(ERR$3.MEDIA, ERR$3.SUB_TYPES.MSE_CHANGE_TYPE, e);
|
|
3613
|
+
}
|
|
3603
3614
|
sb.mimeType = mimeType;
|
|
3604
3615
|
_this8._onSBUpdateEnd(type);
|
|
3605
3616
|
}, "changeType", {
|
|
@@ -3849,11 +3860,14 @@ var MSE$3 = /* @__PURE__ */ function() {
|
|
|
3849
3860
|
} catch (error) {
|
|
3850
3861
|
if (error && error.message && error.message.indexOf("SourceBuffer is full") >= 0) {
|
|
3851
3862
|
this._mseFullFlag[type] = true;
|
|
3863
|
+
if (op.context && _typeof$8(op.context) === "object") {
|
|
3864
|
+
op.context.isFull = true;
|
|
3865
|
+
}
|
|
3852
3866
|
this._logger.error("[MSE error], context,", op.context, " ,name,", op.opName, ",err,SourceBuffer is full");
|
|
3853
3867
|
op.promise.reject(new StreamingError$3(ERR$3.MEDIA, ERR$3.SUB_TYPES.MSE_FULL, error));
|
|
3854
3868
|
} else {
|
|
3855
3869
|
this._logger.error(error);
|
|
3856
|
-
op.promise.reject(new StreamingError$3(ERR$3.MEDIA, ERR$3.SUB_TYPES.MSE_OTHER, error));
|
|
3870
|
+
op.promise.reject(error.constructor === StreamingError$3 ? error : new StreamingError$3(ERR$3.MEDIA, ERR$3.SUB_TYPES.MSE_OTHER, error));
|
|
3857
3871
|
queue.shift();
|
|
3858
3872
|
this._startQueue(type);
|
|
3859
3873
|
}
|
|
@@ -5203,10 +5217,10 @@ var SeiService$1 = /* @__PURE__ */ function() {
|
|
|
5203
5217
|
}]);
|
|
5204
5218
|
return SeiService2;
|
|
5205
5219
|
}();
|
|
5206
|
-
var SKIP_SMALL_CHUNK = 1e3;
|
|
5207
|
-
var MAX_CHUNK_SAVE_SIZE = 50;
|
|
5208
|
-
var MAX_SEGMENT_SAVE_SIZE = 3;
|
|
5209
|
-
var LONGTIME_NO_RECEIVE = 3e3;
|
|
5220
|
+
var SKIP_SMALL_CHUNK$1 = 1e3;
|
|
5221
|
+
var MAX_CHUNK_SAVE_SIZE$1 = 50;
|
|
5222
|
+
var MAX_SEGMENT_SAVE_SIZE$1 = 3;
|
|
5223
|
+
var LONGTIME_NO_RECEIVE$1 = 3e3;
|
|
5210
5224
|
var BandwidthService$1 = /* @__PURE__ */ function() {
|
|
5211
5225
|
function BandwidthService2(opts) {
|
|
5212
5226
|
_classCallCheck$h(this, BandwidthService2);
|
|
@@ -5223,13 +5237,13 @@ var BandwidthService$1 = /* @__PURE__ */ function() {
|
|
|
5223
5237
|
if (!totalByte || !ms)
|
|
5224
5238
|
return;
|
|
5225
5239
|
this._speeds.push(8e3 * totalByte / ms);
|
|
5226
|
-
this._speeds = this._speeds.slice(-MAX_SEGMENT_SAVE_SIZE);
|
|
5240
|
+
this._speeds = this._speeds.slice(-MAX_SEGMENT_SAVE_SIZE$1);
|
|
5227
5241
|
}
|
|
5228
5242
|
}, {
|
|
5229
5243
|
key: "addChunkRecord",
|
|
5230
5244
|
value: function addChunkRecord(totalByte, ms) {
|
|
5231
5245
|
var _this$_opts, _this$_opts2;
|
|
5232
|
-
if (!totalByte || !ms || totalByte < (((_this$_opts = this._opts) === null || _this$_opts === void 0 ? void 0 : _this$_opts.skipChunkSize) || SKIP_SMALL_CHUNK))
|
|
5246
|
+
if (!totalByte || !ms || totalByte < (((_this$_opts = this._opts) === null || _this$_opts === void 0 ? void 0 : _this$_opts.skipChunkSize) || SKIP_SMALL_CHUNK$1))
|
|
5233
5247
|
return;
|
|
5234
5248
|
this._totalSize += totalByte;
|
|
5235
5249
|
this._totalCost += ms;
|
|
@@ -5239,7 +5253,7 @@ var BandwidthService$1 = /* @__PURE__ */ function() {
|
|
|
5239
5253
|
duration: ms,
|
|
5240
5254
|
timestamp: performance.now()
|
|
5241
5255
|
});
|
|
5242
|
-
var size = ((_this$_opts2 = this._opts) === null || _this$_opts2 === void 0 ? void 0 : _this$_opts2.chunkCountForSpeed) || MAX_CHUNK_SAVE_SIZE;
|
|
5256
|
+
var size = ((_this$_opts2 = this._opts) === null || _this$_opts2 === void 0 ? void 0 : _this$_opts2.chunkCountForSpeed) || MAX_CHUNK_SAVE_SIZE$1;
|
|
5243
5257
|
if (this._chunkCache.length > size) {
|
|
5244
5258
|
this._chunkCache = this._chunkCache.slice(-size);
|
|
5245
5259
|
}
|
|
@@ -5257,7 +5271,7 @@ var BandwidthService$1 = /* @__PURE__ */ function() {
|
|
|
5257
5271
|
}
|
|
5258
5272
|
var lastSample = this._chunkCache[this._chunkCache.length - 1];
|
|
5259
5273
|
var cost = performance.now() - lastSample.timestamp;
|
|
5260
|
-
if (cost > (((_this$_opts3 = this._opts) === null || _this$_opts3 === void 0 ? void 0 : _this$_opts3.longtimeNoReceived) || LONGTIME_NO_RECEIVE)) {
|
|
5274
|
+
if (cost > (((_this$_opts3 = this._opts) === null || _this$_opts3 === void 0 ? void 0 : _this$_opts3.longtimeNoReceived) || LONGTIME_NO_RECEIVE$1)) {
|
|
5261
5275
|
this._chunkCache.push({
|
|
5262
5276
|
size: 0,
|
|
5263
5277
|
duration: cost,
|
|
@@ -12296,7 +12310,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
12296
12310
|
_createClass$j(Flv2, [{
|
|
12297
12311
|
key: "version",
|
|
12298
12312
|
get: function get3() {
|
|
12299
|
-
return "3.0.
|
|
12313
|
+
return "3.0.19-rc.0";
|
|
12300
12314
|
}
|
|
12301
12315
|
}, {
|
|
12302
12316
|
key: "isLive",
|
|
@@ -32566,6 +32580,7 @@ var ERR$1 = {
|
|
|
32566
32580
|
MSE_APPEND_BUFFER: "MSE_APPEND_BUFFER",
|
|
32567
32581
|
MSE_OTHER: "MSE_OTHER",
|
|
32568
32582
|
MSE_FULL: "MSE_FULL",
|
|
32583
|
+
MSE_CHANGE_TYPE: "MSE_CHANGE_TYPE",
|
|
32569
32584
|
OPTION: "OPTION",
|
|
32570
32585
|
DASH: "DASH",
|
|
32571
32586
|
LICENSE: "LICENSE",
|
|
@@ -32608,6 +32623,7 @@ var ERR_CODE$1 = (_ERR_CODE$1 = {}, _defineProperty$9(_ERR_CODE$1, ERR$1.MANIFES
|
|
|
32608
32623
|
MSE_OTHER: 5202,
|
|
32609
32624
|
MSE_FULL: 5203,
|
|
32610
32625
|
MSE_HIJACK: 5204,
|
|
32626
|
+
MSE_CHANGE_TYPE: 5205,
|
|
32611
32627
|
EME_HIJACK: 5301
|
|
32612
32628
|
}), _defineProperty$9(_ERR_CODE$1, ERR$1.DRM, {
|
|
32613
32629
|
LICENSE: 7100,
|
|
@@ -32943,7 +32959,7 @@ var MSE$2 = /* @__PURE__ */ function() {
|
|
|
32943
32959
|
queue.shift();
|
|
32944
32960
|
}
|
|
32945
32961
|
if (op) {
|
|
32946
|
-
var _this2$_sourceBuffer
|
|
32962
|
+
var _this2$_sourceBuffer$, _op$context;
|
|
32947
32963
|
var costtime = nowTime$3() - _this2._opst;
|
|
32948
32964
|
_this2._logger.debug("UpdateEnd(".concat(type, "/").concat(op.opName, ")"), SafeJSON.stringify(getTimeRanges((_this2$_sourceBuffer$ = _this2._sourceBuffer[type]) === null || _this2$_sourceBuffer$ === void 0 ? void 0 : _this2$_sourceBuffer$.buffered)), costtime, op.context);
|
|
32949
32965
|
op.promise.resolve({
|
|
@@ -32951,6 +32967,10 @@ var MSE$2 = /* @__PURE__ */ function() {
|
|
|
32951
32967
|
context: op.context,
|
|
32952
32968
|
costtime
|
|
32953
32969
|
});
|
|
32970
|
+
var callback = (_op$context = op.context) === null || _op$context === void 0 ? void 0 : _op$context.callback;
|
|
32971
|
+
if (callback && typeof callback === "function") {
|
|
32972
|
+
callback(op.context);
|
|
32973
|
+
}
|
|
32954
32974
|
_this2._startQueue(type);
|
|
32955
32975
|
}
|
|
32956
32976
|
}
|
|
@@ -33212,10 +33232,15 @@ var MSE$2 = /* @__PURE__ */ function() {
|
|
|
33212
33232
|
var sb = this._sourceBuffer[type];
|
|
33213
33233
|
if (!this.mediaSource || !sb || sb.mimeType === mimeType)
|
|
33214
33234
|
return Promise.resolve();
|
|
33215
|
-
if (typeof sb.changeType !== "function")
|
|
33216
|
-
return Promise.reject();
|
|
33235
|
+
if (typeof sb.changeType !== "function") {
|
|
33236
|
+
return Promise.reject(new StreamingError$1(ERR$1.MEDIA, ERR$1.SUB_TYPES.MSE_CHANGE_TYPE, new Error("changeType is not a function")));
|
|
33237
|
+
}
|
|
33217
33238
|
return this._enqueueOp(type, function() {
|
|
33218
|
-
|
|
33239
|
+
try {
|
|
33240
|
+
sb.changeType(mimeType);
|
|
33241
|
+
} catch (e) {
|
|
33242
|
+
throw new StreamingError$1(ERR$1.MEDIA, ERR$1.SUB_TYPES.MSE_CHANGE_TYPE, e);
|
|
33243
|
+
}
|
|
33219
33244
|
sb.mimeType = mimeType;
|
|
33220
33245
|
_this8._onSBUpdateEnd(type);
|
|
33221
33246
|
}, "changeType", {
|
|
@@ -33465,11 +33490,14 @@ var MSE$2 = /* @__PURE__ */ function() {
|
|
|
33465
33490
|
} catch (error) {
|
|
33466
33491
|
if (error && error.message && error.message.indexOf("SourceBuffer is full") >= 0) {
|
|
33467
33492
|
this._mseFullFlag[type] = true;
|
|
33493
|
+
if (op.context && _typeof$4(op.context) === "object") {
|
|
33494
|
+
op.context.isFull = true;
|
|
33495
|
+
}
|
|
33468
33496
|
this._logger.error("[MSE error], context,", op.context, " ,name,", op.opName, ",err,SourceBuffer is full");
|
|
33469
33497
|
op.promise.reject(new StreamingError$1(ERR$1.MEDIA, ERR$1.SUB_TYPES.MSE_FULL, error));
|
|
33470
33498
|
} else {
|
|
33471
33499
|
this._logger.error(error);
|
|
33472
|
-
op.promise.reject(new StreamingError$1(ERR$1.MEDIA, ERR$1.SUB_TYPES.MSE_OTHER, error));
|
|
33500
|
+
op.promise.reject(error.constructor === StreamingError$1 ? error : new StreamingError$1(ERR$1.MEDIA, ERR$1.SUB_TYPES.MSE_OTHER, error));
|
|
33473
33501
|
queue.shift();
|
|
33474
33502
|
this._startQueue(type);
|
|
33475
33503
|
}
|
|
@@ -34819,11 +34847,19 @@ var SeiService = /* @__PURE__ */ function() {
|
|
|
34819
34847
|
}]);
|
|
34820
34848
|
return SeiService2;
|
|
34821
34849
|
}();
|
|
34850
|
+
var SKIP_SMALL_CHUNK = 1e3;
|
|
34851
|
+
var MAX_CHUNK_SAVE_SIZE = 50;
|
|
34852
|
+
var MAX_SEGMENT_SAVE_SIZE = 3;
|
|
34853
|
+
var LONGTIME_NO_RECEIVE = 3e3;
|
|
34822
34854
|
var BandwidthService = /* @__PURE__ */ function() {
|
|
34823
|
-
function BandwidthService2() {
|
|
34855
|
+
function BandwidthService2(opts) {
|
|
34824
34856
|
_classCallCheck$b(this, BandwidthService2);
|
|
34825
|
-
_defineProperty$9(this, "
|
|
34857
|
+
_defineProperty$9(this, "_chunkSpeed", 0);
|
|
34858
|
+
_defineProperty$9(this, "_chunkCache", []);
|
|
34826
34859
|
_defineProperty$9(this, "_speeds", []);
|
|
34860
|
+
_defineProperty$9(this, "_totalSize", 0);
|
|
34861
|
+
_defineProperty$9(this, "_totalCost", 0);
|
|
34862
|
+
this._opts = opts || {};
|
|
34827
34863
|
}
|
|
34828
34864
|
_createClass$b(BandwidthService2, [{
|
|
34829
34865
|
key: "addRecord",
|
|
@@ -34831,45 +34867,82 @@ var BandwidthService = /* @__PURE__ */ function() {
|
|
|
34831
34867
|
if (!totalByte || !ms)
|
|
34832
34868
|
return;
|
|
34833
34869
|
this._speeds.push(8e3 * totalByte / ms);
|
|
34834
|
-
this._speeds = this._speeds.slice(-
|
|
34870
|
+
this._speeds = this._speeds.slice(-MAX_SEGMENT_SAVE_SIZE);
|
|
34835
34871
|
}
|
|
34836
34872
|
}, {
|
|
34837
34873
|
key: "addChunkRecord",
|
|
34838
34874
|
value: function addChunkRecord(totalByte, ms) {
|
|
34839
|
-
|
|
34875
|
+
var _this$_opts, _this$_opts2;
|
|
34876
|
+
if (!totalByte || !ms || totalByte < (((_this$_opts = this._opts) === null || _this$_opts === void 0 ? void 0 : _this$_opts.skipChunkSize) || SKIP_SMALL_CHUNK))
|
|
34840
34877
|
return;
|
|
34841
|
-
this.
|
|
34842
|
-
this.
|
|
34878
|
+
this._totalSize += totalByte;
|
|
34879
|
+
this._totalCost += ms;
|
|
34880
|
+
this._chunkSpeed = 8e3 * totalByte / ms;
|
|
34881
|
+
this._chunkCache.push({
|
|
34882
|
+
size: totalByte,
|
|
34883
|
+
duration: ms,
|
|
34884
|
+
timestamp: performance.now()
|
|
34885
|
+
});
|
|
34886
|
+
var size = ((_this$_opts2 = this._opts) === null || _this$_opts2 === void 0 ? void 0 : _this$_opts2.chunkCountForSpeed) || MAX_CHUNK_SAVE_SIZE;
|
|
34887
|
+
if (this._chunkCache.length > size) {
|
|
34888
|
+
this._chunkCache = this._chunkCache.slice(-size);
|
|
34889
|
+
}
|
|
34843
34890
|
}
|
|
34844
34891
|
}, {
|
|
34845
34892
|
key: "getAvgSpeed",
|
|
34846
34893
|
value: function getAvgSpeed() {
|
|
34847
|
-
|
|
34894
|
+
var _this$_opts3;
|
|
34895
|
+
if (!this._chunkCache.length && !this._speeds.length)
|
|
34848
34896
|
return 0;
|
|
34849
34897
|
if (this._speeds.length) {
|
|
34850
34898
|
return this._speeds.reduce(function(a, c) {
|
|
34851
34899
|
return a += c;
|
|
34852
34900
|
}) / this._speeds.length;
|
|
34853
34901
|
}
|
|
34854
|
-
|
|
34855
|
-
|
|
34856
|
-
|
|
34902
|
+
var lastSample = this._chunkCache[this._chunkCache.length - 1];
|
|
34903
|
+
var cost = performance.now() - lastSample.timestamp;
|
|
34904
|
+
if (cost > (((_this$_opts3 = this._opts) === null || _this$_opts3 === void 0 ? void 0 : _this$_opts3.longtimeNoReceived) || LONGTIME_NO_RECEIVE)) {
|
|
34905
|
+
this._chunkCache.push({
|
|
34906
|
+
size: 0,
|
|
34907
|
+
duration: cost,
|
|
34908
|
+
timestamp: performance.now()
|
|
34909
|
+
});
|
|
34910
|
+
}
|
|
34911
|
+
var totalSize = this._chunkCache.reduce(function(a, c) {
|
|
34912
|
+
return a += c.size;
|
|
34913
|
+
}, 0);
|
|
34914
|
+
var totalDuration = this._chunkCache.reduce(function(a, c) {
|
|
34915
|
+
return a += c.duration;
|
|
34916
|
+
}, 0);
|
|
34917
|
+
return 8e3 * totalSize / totalDuration;
|
|
34857
34918
|
}
|
|
34858
34919
|
}, {
|
|
34859
34920
|
key: "getLatestSpeed",
|
|
34860
34921
|
value: function getLatestSpeed() {
|
|
34861
|
-
if (!this.
|
|
34922
|
+
if (!this._chunkCache.length && !this._speeds.length)
|
|
34862
34923
|
return 0;
|
|
34863
34924
|
if (this._speeds.length) {
|
|
34864
34925
|
return this._speeds[this._speeds.length - 1];
|
|
34865
34926
|
}
|
|
34866
|
-
return this.
|
|
34927
|
+
return this._chunkSpeed;
|
|
34928
|
+
}
|
|
34929
|
+
}, {
|
|
34930
|
+
key: "getTotalSize",
|
|
34931
|
+
value: function getTotalSize() {
|
|
34932
|
+
return this._totalSize;
|
|
34933
|
+
}
|
|
34934
|
+
}, {
|
|
34935
|
+
key: "getTotalCost",
|
|
34936
|
+
value: function getTotalCost() {
|
|
34937
|
+
return this._totalCost;
|
|
34867
34938
|
}
|
|
34868
34939
|
}, {
|
|
34869
34940
|
key: "reset",
|
|
34870
34941
|
value: function reset() {
|
|
34871
|
-
this.
|
|
34942
|
+
this._chunkCache = [];
|
|
34872
34943
|
this._speeds = [];
|
|
34944
|
+
this._totalSize = 0;
|
|
34945
|
+
this._totalCost = 0;
|
|
34873
34946
|
}
|
|
34874
34947
|
}]);
|
|
34875
34948
|
return BandwidthService2;
|
|
@@ -34998,13 +35071,15 @@ var MediaStatsService = /* @__PURE__ */ function() {
|
|
|
34998
35071
|
_createClass$b(MediaStatsService2, [{
|
|
34999
35072
|
key: "getStats",
|
|
35000
35073
|
value: function getStats2() {
|
|
35001
|
-
var _this$_core, _this$_core2, _this$_core2$speedInf, _this$_core3, _this$_core3$speedInf, _this$_core4, _this$_core4$bufferIn;
|
|
35074
|
+
var _this$_core, _this$_core2, _this$_core2$speedInf, _this$_core3, _this$_core3$speedInf, _this$_core4, _this$_core4$speedInf, _this$_core5, _this$_core5$speedInf, _this$_core6, _this$_core6$bufferIn;
|
|
35002
35075
|
var _ref2 = ((_this$_core = this._core) === null || _this$_core === void 0 ? void 0 : _this$_core.media) || {}, _ref2$currentTime = _ref2.currentTime, currentTime = _ref2$currentTime === void 0 ? 0 : _ref2$currentTime, _ref2$decodeFps = _ref2.decodeFps, decodeFps = _ref2$decodeFps === void 0 ? 0 : _ref2$decodeFps;
|
|
35003
35076
|
return _objectSpread2$4(_objectSpread2$4({}, this._stats.getStats()), {}, {
|
|
35004
35077
|
downloadSpeed: ((_this$_core2 = this._core) === null || _this$_core2 === void 0 ? void 0 : (_this$_core2$speedInf = _this$_core2.speedInfo) === null || _this$_core2$speedInf === void 0 ? void 0 : _this$_core2$speedInf.call(_this$_core2).speed) || 0,
|
|
35005
35078
|
avgSpeed: ((_this$_core3 = this._core) === null || _this$_core3 === void 0 ? void 0 : (_this$_core3$speedInf = _this$_core3.speedInfo) === null || _this$_core3$speedInf === void 0 ? void 0 : _this$_core3$speedInf.call(_this$_core3).avgSpeed) || 0,
|
|
35079
|
+
totalReceivedByte: ((_this$_core4 = this._core) === null || _this$_core4 === void 0 ? void 0 : (_this$_core4$speedInf = _this$_core4.speedInfo) === null || _this$_core4$speedInf === void 0 ? void 0 : _this$_core4$speedInf.call(_this$_core4).totalSize) || 0,
|
|
35080
|
+
totalReceivedCost: ((_this$_core5 = this._core) === null || _this$_core5 === void 0 ? void 0 : (_this$_core5$speedInf = _this$_core5.speedInfo) === null || _this$_core5$speedInf === void 0 ? void 0 : _this$_core5$speedInf.call(_this$_core5).totalCost) || 0,
|
|
35006
35081
|
currentTime,
|
|
35007
|
-
bufferEnd: ((_this$
|
|
35082
|
+
bufferEnd: ((_this$_core6 = this._core) === null || _this$_core6 === void 0 ? void 0 : (_this$_core6$bufferIn = _this$_core6.bufferInfo()) === null || _this$_core6$bufferIn === void 0 ? void 0 : _this$_core6$bufferIn.remaining) || 0,
|
|
35008
35083
|
decodeFps
|
|
35009
35084
|
});
|
|
35010
35085
|
}
|
|
@@ -40880,7 +40955,9 @@ var BufferService = /* @__PURE__ */ function() {
|
|
|
40880
40955
|
mse = this._mse;
|
|
40881
40956
|
_p = [];
|
|
40882
40957
|
if (needInit && !isFirstAppend) {
|
|
40883
|
-
this._handleCodecChange(video, audio)
|
|
40958
|
+
this._handleCodecChange(video, audio).forEach(function(task2) {
|
|
40959
|
+
return _p.push(task2);
|
|
40960
|
+
});
|
|
40884
40961
|
}
|
|
40885
40962
|
if (video) {
|
|
40886
40963
|
videoData = video.data, videoRest = _objectWithoutProperties$3(video, _excluded$2);
|
|
@@ -41153,6 +41230,7 @@ var BufferService = /* @__PURE__ */ function() {
|
|
|
41153
41230
|
}, {
|
|
41154
41231
|
key: "_handleCodecChange",
|
|
41155
41232
|
value: function _handleCodecChange(video, audio) {
|
|
41233
|
+
var tasks = [];
|
|
41156
41234
|
var mse = this._mse;
|
|
41157
41235
|
var codecList = [{
|
|
41158
41236
|
type: MSE$2.VIDEO,
|
|
@@ -41169,10 +41247,11 @@ var BufferService = /* @__PURE__ */ function() {
|
|
|
41169
41247
|
if (sourceBuffer) {
|
|
41170
41248
|
var codec = codecs.split(",")[0];
|
|
41171
41249
|
if (!new RegExp(codec, "ig").test(sourceBuffer.mimeType)) {
|
|
41172
|
-
mse.changeType(type, "".concat(type, "/mp4;codecs=").concat(codecs));
|
|
41250
|
+
tasks.push(mse.changeType(type, "".concat(type, "/mp4;codecs=").concat(codecs)));
|
|
41173
41251
|
}
|
|
41174
41252
|
}
|
|
41175
41253
|
});
|
|
41254
|
+
return tasks;
|
|
41176
41255
|
}
|
|
41177
41256
|
}, {
|
|
41178
41257
|
key: "seamlessSwitch",
|
|
@@ -41231,10 +41310,21 @@ var MediaType = {
|
|
|
41231
41310
|
};
|
|
41232
41311
|
var KeySystems = {
|
|
41233
41312
|
CLEAR_KEY: "org.w3.clearkey",
|
|
41234
|
-
FAIRPLAY: "com.apple.streamingkeydelivery",
|
|
41235
|
-
WIDEVINE: "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",
|
|
41236
|
-
PLAYREADY: "com.microsoft.playready"
|
|
41237
|
-
};
|
|
41313
|
+
FAIRPLAY: ["urn:uuid:94ce86fb-07ff-4f43-adb8-93d2fa968ca2", "com.apple.streamingkeydelivery"],
|
|
41314
|
+
WIDEVINE: ["urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed", "com.widevine.alpha", "com.widevine"],
|
|
41315
|
+
PLAYREADY: ["urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95", "com.microsoft.playready"]
|
|
41316
|
+
};
|
|
41317
|
+
function flatArray(arr) {
|
|
41318
|
+
var ret = [];
|
|
41319
|
+
for (var i = 0; i < arr.length; i++) {
|
|
41320
|
+
if (Array.isArray(arr[i])) {
|
|
41321
|
+
ret = ret.concat(flatArray(arr[i]));
|
|
41322
|
+
} else {
|
|
41323
|
+
ret.push(arr[i]);
|
|
41324
|
+
}
|
|
41325
|
+
}
|
|
41326
|
+
return ret;
|
|
41327
|
+
}
|
|
41238
41328
|
var MediaStream$1 = /* @__PURE__ */ _createClass$c(function MediaStream2() {
|
|
41239
41329
|
_classCallCheck$c(this, MediaStream2);
|
|
41240
41330
|
_defineProperty$a(this, "id", 0);
|
|
@@ -41411,7 +41501,7 @@ var MediaSegmentKey = /* @__PURE__ */ function() {
|
|
|
41411
41501
|
}, {
|
|
41412
41502
|
key: "isValidKeySystem",
|
|
41413
41503
|
value: function isValidKeySystem() {
|
|
41414
|
-
var isKeyFormatValid = [KeySystems.CLEAR_KEY, KeySystems.FAIRPLAY, KeySystems.WIDEVINE, KeySystems.PLAYREADY].indexOf(this.keyFormat) > -1;
|
|
41504
|
+
var isKeyFormatValid = flatArray([KeySystems.CLEAR_KEY, KeySystems.FAIRPLAY, KeySystems.WIDEVINE, KeySystems.PLAYREADY]).indexOf(this.keyFormat) > -1;
|
|
41415
41505
|
if (!isKeyFormatValid) {
|
|
41416
41506
|
return false;
|
|
41417
41507
|
}
|
|
@@ -44196,7 +44286,7 @@ var Hls = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
44196
44286
|
}]);
|
|
44197
44287
|
return Hls2;
|
|
44198
44288
|
}(EventEmitter$1);
|
|
44199
|
-
_defineProperty$a(Hls, "version", "3.0.
|
|
44289
|
+
_defineProperty$a(Hls, "version", "3.0.19-rc.0");
|
|
44200
44290
|
try {
|
|
44201
44291
|
if (localStorage.getItem("xgd")) {
|
|
44202
44292
|
Hls.enableLogger();
|