@volcengine/veplayer-plugin 2.7.1-rc.0 → 2.7.1-rc.2
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 +1046 -348
- package/esm/index.production.js +4 -4
- package/esm/veplayer.plugin.rtm.development.js +903 -205
- package/esm/veplayer.plugin.rtm.production.js +1 -1
- package/package.json +1 -1
- package/umd/veplayer.plugin.rtm.development.js +877 -179
- package/umd/veplayer.plugin.rtm.production.js +1 -1
package/esm/index.development.js
CHANGED
|
@@ -379,33 +379,33 @@ function _asyncToGenerator$b(fn) {
|
|
|
379
379
|
});
|
|
380
380
|
};
|
|
381
381
|
}
|
|
382
|
-
function _classCallCheck$
|
|
382
|
+
function _classCallCheck$m(instance, Constructor2) {
|
|
383
383
|
if (!(instance instanceof Constructor2)) {
|
|
384
384
|
throw new TypeError("Cannot call a class as a function");
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
|
-
function _defineProperties$
|
|
387
|
+
function _defineProperties$m(target, props) {
|
|
388
388
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
389
389
|
var descriptor = props[i2];
|
|
390
390
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
391
391
|
descriptor.configurable = true;
|
|
392
392
|
if ("value" in descriptor)
|
|
393
393
|
descriptor.writable = true;
|
|
394
|
-
Object.defineProperty(target, _toPropertyKey$
|
|
394
|
+
Object.defineProperty(target, _toPropertyKey$c(descriptor.key), descriptor);
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
function _createClass$
|
|
397
|
+
function _createClass$m(Constructor2, protoProps, staticProps) {
|
|
398
398
|
if (protoProps)
|
|
399
|
-
_defineProperties$
|
|
399
|
+
_defineProperties$m(Constructor2.prototype, protoProps);
|
|
400
400
|
if (staticProps)
|
|
401
|
-
_defineProperties$
|
|
401
|
+
_defineProperties$m(Constructor2, staticProps);
|
|
402
402
|
Object.defineProperty(Constructor2, "prototype", {
|
|
403
403
|
writable: false
|
|
404
404
|
});
|
|
405
405
|
return Constructor2;
|
|
406
406
|
}
|
|
407
407
|
function _defineProperty$j(obj, key2, value2) {
|
|
408
|
-
key2 = _toPropertyKey$
|
|
408
|
+
key2 = _toPropertyKey$c(key2);
|
|
409
409
|
if (key2 in obj) {
|
|
410
410
|
Object.defineProperty(obj, key2, {
|
|
411
411
|
value: value2,
|
|
@@ -490,7 +490,7 @@ function _createSuper$g(Derived) {
|
|
|
490
490
|
return _possibleConstructorReturn$h(this, result);
|
|
491
491
|
};
|
|
492
492
|
}
|
|
493
|
-
function _toPrimitive$
|
|
493
|
+
function _toPrimitive$c(input, hint) {
|
|
494
494
|
if (typeof input !== "object" || input === null)
|
|
495
495
|
return input;
|
|
496
496
|
var prim = input[Symbol.toPrimitive];
|
|
@@ -502,8 +502,8 @@ function _toPrimitive$b(input, hint) {
|
|
|
502
502
|
}
|
|
503
503
|
return (hint === "string" ? String : Number)(input);
|
|
504
504
|
}
|
|
505
|
-
function _toPropertyKey$
|
|
506
|
-
var key2 = _toPrimitive$
|
|
505
|
+
function _toPropertyKey$c(arg) {
|
|
506
|
+
var key2 = _toPrimitive$c(arg, "string");
|
|
507
507
|
return typeof key2 === "symbol" ? key2 : String(key2);
|
|
508
508
|
}
|
|
509
509
|
function ownKeys$e(object, enumerableOnly) {
|
|
@@ -535,33 +535,33 @@ function _typeof$b(obj) {
|
|
|
535
535
|
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
536
536
|
}, _typeof$b(obj);
|
|
537
537
|
}
|
|
538
|
-
function _classCallCheck$
|
|
538
|
+
function _classCallCheck$l(instance, Constructor2) {
|
|
539
539
|
if (!(instance instanceof Constructor2)) {
|
|
540
540
|
throw new TypeError("Cannot call a class as a function");
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
|
-
function _defineProperties$
|
|
543
|
+
function _defineProperties$l(target, props) {
|
|
544
544
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
545
545
|
var descriptor = props[i2];
|
|
546
546
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
547
547
|
descriptor.configurable = true;
|
|
548
548
|
if ("value" in descriptor)
|
|
549
549
|
descriptor.writable = true;
|
|
550
|
-
Object.defineProperty(target, _toPropertyKey$
|
|
550
|
+
Object.defineProperty(target, _toPropertyKey$b(descriptor.key), descriptor);
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
|
-
function _createClass$
|
|
553
|
+
function _createClass$l(Constructor2, protoProps, staticProps) {
|
|
554
554
|
if (protoProps)
|
|
555
|
-
_defineProperties$
|
|
555
|
+
_defineProperties$l(Constructor2.prototype, protoProps);
|
|
556
556
|
if (staticProps)
|
|
557
|
-
_defineProperties$
|
|
557
|
+
_defineProperties$l(Constructor2, staticProps);
|
|
558
558
|
Object.defineProperty(Constructor2, "prototype", {
|
|
559
559
|
writable: false
|
|
560
560
|
});
|
|
561
561
|
return Constructor2;
|
|
562
562
|
}
|
|
563
563
|
function _defineProperty$i(obj, key2, value2) {
|
|
564
|
-
key2 = _toPropertyKey$
|
|
564
|
+
key2 = _toPropertyKey$b(key2);
|
|
565
565
|
if (key2 in obj) {
|
|
566
566
|
Object.defineProperty(obj, key2, {
|
|
567
567
|
value: value2,
|
|
@@ -705,7 +705,7 @@ function _arrayLikeToArray$e(arr, len) {
|
|
|
705
705
|
function _nonIterableSpread$9() {
|
|
706
706
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
707
707
|
}
|
|
708
|
-
function _toPrimitive$
|
|
708
|
+
function _toPrimitive$b(input, hint) {
|
|
709
709
|
if (typeof input !== "object" || input === null)
|
|
710
710
|
return input;
|
|
711
711
|
var prim = input[Symbol.toPrimitive];
|
|
@@ -717,8 +717,8 @@ function _toPrimitive$a(input, hint) {
|
|
|
717
717
|
}
|
|
718
718
|
return (hint === "string" ? String : Number)(input);
|
|
719
719
|
}
|
|
720
|
-
function _toPropertyKey$
|
|
721
|
-
var key2 = _toPrimitive$
|
|
720
|
+
function _toPropertyKey$b(arg) {
|
|
721
|
+
var key2 = _toPrimitive$b(arg, "string");
|
|
722
722
|
return typeof key2 === "symbol" ? key2 : String(key2);
|
|
723
723
|
}
|
|
724
724
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
@@ -943,10 +943,10 @@ var XG_DEBUG = {
|
|
|
943
943
|
};
|
|
944
944
|
var XgplayerTimeRange = /* @__PURE__ */ function() {
|
|
945
945
|
function XgplayerTimeRange2(bufferedList) {
|
|
946
|
-
_classCallCheck$
|
|
946
|
+
_classCallCheck$l(this, XgplayerTimeRange2);
|
|
947
947
|
this.bufferedList = bufferedList;
|
|
948
948
|
}
|
|
949
|
-
_createClass$
|
|
949
|
+
_createClass$l(XgplayerTimeRange2, [{
|
|
950
950
|
key: "start",
|
|
951
951
|
value: function start(index2) {
|
|
952
952
|
return this.bufferedList[index2].start;
|
|
@@ -1801,7 +1801,7 @@ var ERROR_MAP = {
|
|
|
1801
1801
|
5: 5105,
|
|
1802
1802
|
6: 5106
|
|
1803
1803
|
};
|
|
1804
|
-
var Errors = /* @__PURE__ */ _createClass$
|
|
1804
|
+
var Errors = /* @__PURE__ */ _createClass$l(
|
|
1805
1805
|
function Errors2(player) {
|
|
1806
1806
|
var errorInfo = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
1807
1807
|
errorType: "",
|
|
@@ -1811,7 +1811,7 @@ var Errors = /* @__PURE__ */ _createClass$k(
|
|
|
1811
1811
|
ext: {},
|
|
1812
1812
|
mediaError: null
|
|
1813
1813
|
};
|
|
1814
|
-
_classCallCheck$
|
|
1814
|
+
_classCallCheck$l(this, Errors2);
|
|
1815
1815
|
var ERROR_TYPES2 = player && player.i18n ? player.i18n.ERROR_TYPES : null;
|
|
1816
1816
|
if (player.media) {
|
|
1817
1817
|
var mediaError = errorInfo.mediaError ? errorInfo.mediaError : player.media.error || {};
|
|
@@ -2046,7 +2046,7 @@ function showErrorMsg(pluginName, msg) {
|
|
|
2046
2046
|
}
|
|
2047
2047
|
var BasePlugin = /* @__PURE__ */ function() {
|
|
2048
2048
|
function BasePlugin2(args) {
|
|
2049
|
-
_classCallCheck$
|
|
2049
|
+
_classCallCheck$l(this, BasePlugin2);
|
|
2050
2050
|
if (util$5.checkIsFunction(this.beforeCreate)) {
|
|
2051
2051
|
this.beforeCreate(args);
|
|
2052
2052
|
}
|
|
@@ -2060,7 +2060,7 @@ var BasePlugin = /* @__PURE__ */ function() {
|
|
|
2060
2060
|
this.pluginName = "";
|
|
2061
2061
|
this.__init(args);
|
|
2062
2062
|
}
|
|
2063
|
-
_createClass$
|
|
2063
|
+
_createClass$l(BasePlugin2, [{
|
|
2064
2064
|
key: "beforeCreate",
|
|
2065
2065
|
value: function beforeCreate(args) {
|
|
2066
2066
|
}
|
|
@@ -2471,12 +2471,12 @@ var Plugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
2471
2471
|
function Plugin2() {
|
|
2472
2472
|
var _this;
|
|
2473
2473
|
var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2474
|
-
_classCallCheck$
|
|
2474
|
+
_classCallCheck$l(this, Plugin2);
|
|
2475
2475
|
_this = _super.call(this, args);
|
|
2476
2476
|
_this.__delegates = [];
|
|
2477
2477
|
return _this;
|
|
2478
2478
|
}
|
|
2479
|
-
_createClass$
|
|
2479
|
+
_createClass$l(Plugin2, [{
|
|
2480
2480
|
key: "__init",
|
|
2481
2481
|
value: function __init(args) {
|
|
2482
2482
|
_get$6(_getPrototypeOf$g(Plugin2.prototype), "__init", this).call(this, args);
|
|
@@ -2970,7 +2970,7 @@ var TPL = [{
|
|
|
2970
2970
|
}];
|
|
2971
2971
|
var InnerList = /* @__PURE__ */ function() {
|
|
2972
2972
|
function InnerList2(args) {
|
|
2973
|
-
_classCallCheck$
|
|
2973
|
+
_classCallCheck$l(this, InnerList2);
|
|
2974
2974
|
this.fragments = args.fragments || [];
|
|
2975
2975
|
if (this.fragments.length === 0) {
|
|
2976
2976
|
this.fragments.push({
|
|
@@ -2993,7 +2993,7 @@ var InnerList = /* @__PURE__ */ function() {
|
|
|
2993
2993
|
this.playedIndex = 0;
|
|
2994
2994
|
this.focusIndex = -1;
|
|
2995
2995
|
}
|
|
2996
|
-
_createClass$
|
|
2996
|
+
_createClass$l(InnerList2, [{
|
|
2997
2997
|
key: "updateDuration",
|
|
2998
2998
|
value: function updateDuration(duration) {
|
|
2999
2999
|
var _this = this;
|
|
@@ -3248,7 +3248,7 @@ var Progress = /* @__PURE__ */ function(_Plugin) {
|
|
|
3248
3248
|
var _super = _createSuper$f(Progress2);
|
|
3249
3249
|
function Progress2(args) {
|
|
3250
3250
|
var _this;
|
|
3251
|
-
_classCallCheck$
|
|
3251
|
+
_classCallCheck$l(this, Progress2);
|
|
3252
3252
|
_this = _super.call(this, args);
|
|
3253
3253
|
_defineProperty$i(_assertThisInitialized$g(_this), "onMoveOnly", function(e4, data2) {
|
|
3254
3254
|
var _assertThisInitialize = _assertThisInitialized$g(_this), pos = _assertThisInitialize.pos, config = _assertThisInitialize.config, player = _assertThisInitialize.player;
|
|
@@ -3453,7 +3453,7 @@ var Progress = /* @__PURE__ */ function(_Plugin) {
|
|
|
3453
3453
|
}
|
|
3454
3454
|
return _this;
|
|
3455
3455
|
}
|
|
3456
|
-
_createClass$
|
|
3456
|
+
_createClass$l(Progress2, [{
|
|
3457
3457
|
key: "offsetDuration",
|
|
3458
3458
|
get: function get3() {
|
|
3459
3459
|
return this.playerConfig.customDuration || this.player.offsetDuration || this.player.duration;
|
|
@@ -3915,7 +3915,7 @@ var Icon = /* @__PURE__ */ function(_Plugin) {
|
|
|
3915
3915
|
var _super = _createSuper$f(Icon2);
|
|
3916
3916
|
function Icon2() {
|
|
3917
3917
|
var _this;
|
|
3918
|
-
_classCallCheck$
|
|
3918
|
+
_classCallCheck$l(this, Icon2);
|
|
3919
3919
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3920
3920
|
args[_key] = arguments[_key];
|
|
3921
3921
|
}
|
|
@@ -3932,7 +3932,7 @@ var Icon = /* @__PURE__ */ function(_Plugin) {
|
|
|
3932
3932
|
});
|
|
3933
3933
|
return _this;
|
|
3934
3934
|
}
|
|
3935
|
-
_createClass$
|
|
3935
|
+
_createClass$l(Icon2, [{
|
|
3936
3936
|
key: "afterCreate",
|
|
3937
3937
|
value: function afterCreate() {
|
|
3938
3938
|
this.bind("mouseenter", this._onMouseenter);
|
|
@@ -3955,7 +3955,7 @@ var Play = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
3955
3955
|
var _super = _createSuper$f(Play2);
|
|
3956
3956
|
function Play2() {
|
|
3957
3957
|
var _this;
|
|
3958
|
-
_classCallCheck$
|
|
3958
|
+
_classCallCheck$l(this, Play2);
|
|
3959
3959
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3960
3960
|
args[_key] = arguments[_key];
|
|
3961
3961
|
}
|
|
@@ -3982,7 +3982,7 @@ var Play = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
3982
3982
|
});
|
|
3983
3983
|
return _this;
|
|
3984
3984
|
}
|
|
3985
|
-
_createClass$
|
|
3985
|
+
_createClass$l(Play2, [{
|
|
3986
3986
|
key: "afterCreate",
|
|
3987
3987
|
value: function afterCreate() {
|
|
3988
3988
|
_get$6(_getPrototypeOf$g(Play2.prototype), "afterCreate", this).call(this);
|
|
@@ -4079,10 +4079,10 @@ var TopBackIcon = /* @__PURE__ */ function(_Plugin) {
|
|
|
4079
4079
|
_inherits$g(TopBackIcon2, _Plugin);
|
|
4080
4080
|
var _super = _createSuper$f(TopBackIcon2);
|
|
4081
4081
|
function TopBackIcon2() {
|
|
4082
|
-
_classCallCheck$
|
|
4082
|
+
_classCallCheck$l(this, TopBackIcon2);
|
|
4083
4083
|
return _super.apply(this, arguments);
|
|
4084
4084
|
}
|
|
4085
|
-
_createClass$
|
|
4085
|
+
_createClass$l(TopBackIcon2, [{
|
|
4086
4086
|
key: "afterCreate",
|
|
4087
4087
|
value: function afterCreate() {
|
|
4088
4088
|
var _this = this;
|
|
@@ -4152,7 +4152,7 @@ var Fullscreen = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
4152
4152
|
var _super = _createSuper$f(Fullscreen2);
|
|
4153
4153
|
function Fullscreen2() {
|
|
4154
4154
|
var _this;
|
|
4155
|
-
_classCallCheck$
|
|
4155
|
+
_classCallCheck$l(this, Fullscreen2);
|
|
4156
4156
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4157
4157
|
args[_key] = arguments[_key];
|
|
4158
4158
|
}
|
|
@@ -4168,7 +4168,7 @@ var Fullscreen = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
4168
4168
|
});
|
|
4169
4169
|
return _this;
|
|
4170
4170
|
}
|
|
4171
|
-
_createClass$
|
|
4171
|
+
_createClass$l(Fullscreen2, [{
|
|
4172
4172
|
key: "afterCreate",
|
|
4173
4173
|
value: function afterCreate() {
|
|
4174
4174
|
var _this2 = this;
|
|
@@ -4358,12 +4358,12 @@ var Time = /* @__PURE__ */ function(_Plugin) {
|
|
|
4358
4358
|
var _super = _createSuper$f(Time2);
|
|
4359
4359
|
function Time2(args) {
|
|
4360
4360
|
var _this;
|
|
4361
|
-
_classCallCheck$
|
|
4361
|
+
_classCallCheck$l(this, Time2);
|
|
4362
4362
|
_this = _super.call(this, args);
|
|
4363
4363
|
_this.isActiving = false;
|
|
4364
4364
|
return _this;
|
|
4365
4365
|
}
|
|
4366
|
-
_createClass$
|
|
4366
|
+
_createClass$l(Time2, [{
|
|
4367
4367
|
key: "duration",
|
|
4368
4368
|
get: function get3() {
|
|
4369
4369
|
var _this$player = this.player, offsetDuration = _this$player.offsetDuration, duration = _this$player.duration;
|
|
@@ -4594,7 +4594,7 @@ var Volume = /* @__PURE__ */ function(_Plugin) {
|
|
|
4594
4594
|
var _super = _createSuper$f(Volume2);
|
|
4595
4595
|
function Volume2() {
|
|
4596
4596
|
var _this;
|
|
4597
|
-
_classCallCheck$
|
|
4597
|
+
_classCallCheck$l(this, Volume2);
|
|
4598
4598
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4599
4599
|
args[_key] = arguments[_key];
|
|
4600
4600
|
}
|
|
@@ -4670,7 +4670,7 @@ var Volume = /* @__PURE__ */ function(_Plugin) {
|
|
|
4670
4670
|
});
|
|
4671
4671
|
return _this;
|
|
4672
4672
|
}
|
|
4673
|
-
_createClass$
|
|
4673
|
+
_createClass$l(Volume2, [{
|
|
4674
4674
|
key: "registerIcons",
|
|
4675
4675
|
value: function registerIcons() {
|
|
4676
4676
|
return {
|
|
@@ -4911,10 +4911,10 @@ var CssFullScreen = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
4911
4911
|
_inherits$g(CssFullScreen2, _IconPlugin);
|
|
4912
4912
|
var _super = _createSuper$f(CssFullScreen2);
|
|
4913
4913
|
function CssFullScreen2() {
|
|
4914
|
-
_classCallCheck$
|
|
4914
|
+
_classCallCheck$l(this, CssFullScreen2);
|
|
4915
4915
|
return _super.apply(this, arguments);
|
|
4916
4916
|
}
|
|
4917
|
-
_createClass$
|
|
4917
|
+
_createClass$l(CssFullScreen2, [{
|
|
4918
4918
|
key: "beforeCreate",
|
|
4919
4919
|
value: function beforeCreate(args) {
|
|
4920
4920
|
if (typeof args.player.config.cssFullscreen === "boolean") {
|
|
@@ -5407,33 +5407,33 @@ function _asyncToGenerator$a(fn) {
|
|
|
5407
5407
|
});
|
|
5408
5408
|
};
|
|
5409
5409
|
}
|
|
5410
|
-
function _classCallCheck$
|
|
5410
|
+
function _classCallCheck$k(instance, Constructor2) {
|
|
5411
5411
|
if (!(instance instanceof Constructor2)) {
|
|
5412
5412
|
throw new TypeError("Cannot call a class as a function");
|
|
5413
5413
|
}
|
|
5414
5414
|
}
|
|
5415
|
-
function _defineProperties$
|
|
5415
|
+
function _defineProperties$k(target, props) {
|
|
5416
5416
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
5417
5417
|
var descriptor = props[i2];
|
|
5418
5418
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
5419
5419
|
descriptor.configurable = true;
|
|
5420
5420
|
if ("value" in descriptor)
|
|
5421
5421
|
descriptor.writable = true;
|
|
5422
|
-
Object.defineProperty(target, _toPropertyKey$
|
|
5422
|
+
Object.defineProperty(target, _toPropertyKey$a(descriptor.key), descriptor);
|
|
5423
5423
|
}
|
|
5424
5424
|
}
|
|
5425
|
-
function _createClass$
|
|
5425
|
+
function _createClass$k(Constructor2, protoProps, staticProps) {
|
|
5426
5426
|
if (protoProps)
|
|
5427
|
-
_defineProperties$
|
|
5427
|
+
_defineProperties$k(Constructor2.prototype, protoProps);
|
|
5428
5428
|
if (staticProps)
|
|
5429
|
-
_defineProperties$
|
|
5429
|
+
_defineProperties$k(Constructor2, staticProps);
|
|
5430
5430
|
Object.defineProperty(Constructor2, "prototype", {
|
|
5431
5431
|
writable: false
|
|
5432
5432
|
});
|
|
5433
5433
|
return Constructor2;
|
|
5434
5434
|
}
|
|
5435
5435
|
function _defineProperty$h(obj, key2, value2) {
|
|
5436
|
-
key2 = _toPropertyKey$
|
|
5436
|
+
key2 = _toPropertyKey$a(key2);
|
|
5437
5437
|
if (key2 in obj) {
|
|
5438
5438
|
Object.defineProperty(obj, key2, {
|
|
5439
5439
|
value: value2,
|
|
@@ -5696,7 +5696,7 @@ function _createForOfIteratorHelper$4(o2, allowArrayLike) {
|
|
|
5696
5696
|
}
|
|
5697
5697
|
};
|
|
5698
5698
|
}
|
|
5699
|
-
function _toPrimitive$
|
|
5699
|
+
function _toPrimitive$a(input, hint) {
|
|
5700
5700
|
if (typeof input !== "object" || input === null)
|
|
5701
5701
|
return input;
|
|
5702
5702
|
var prim = input[Symbol.toPrimitive];
|
|
@@ -5708,15 +5708,15 @@ function _toPrimitive$9(input, hint) {
|
|
|
5708
5708
|
}
|
|
5709
5709
|
return (hint === "string" ? String : Number)(input);
|
|
5710
5710
|
}
|
|
5711
|
-
function _toPropertyKey$
|
|
5712
|
-
var key2 = _toPrimitive$
|
|
5711
|
+
function _toPropertyKey$a(arg) {
|
|
5712
|
+
var key2 = _toPrimitive$a(arg, "string");
|
|
5713
5713
|
return typeof key2 === "symbol" ? key2 : String(key2);
|
|
5714
5714
|
}
|
|
5715
5715
|
var Buffer$6 = /* @__PURE__ */ function() {
|
|
5716
5716
|
function Buffer22() {
|
|
5717
|
-
_classCallCheck$
|
|
5717
|
+
_classCallCheck$k(this, Buffer22);
|
|
5718
5718
|
}
|
|
5719
|
-
_createClass$
|
|
5719
|
+
_createClass$k(Buffer22, null, [{
|
|
5720
5720
|
key: "start",
|
|
5721
5721
|
value: function start(buf) {
|
|
5722
5722
|
if (!buf || !buf.length)
|
|
@@ -5930,7 +5930,7 @@ var StreamingError$3 = /* @__PURE__ */ function(_Error) {
|
|
|
5930
5930
|
var _super = _createSuper$e(StreamingError2);
|
|
5931
5931
|
function StreamingError2(type, subType, origin, payload, msg) {
|
|
5932
5932
|
var _this;
|
|
5933
|
-
_classCallCheck$
|
|
5933
|
+
_classCallCheck$k(this, StreamingError2);
|
|
5934
5934
|
_this = _super.call(this, msg || (origin === null || origin === void 0 ? void 0 : origin.message));
|
|
5935
5935
|
_this.errorType = type === ERR$3.NETWORK_TIMEOUT ? ERR$3.NETWORK : type;
|
|
5936
5936
|
_this.originError = origin;
|
|
@@ -5943,7 +5943,7 @@ var StreamingError$3 = /* @__PURE__ */ function(_Error) {
|
|
|
5943
5943
|
}
|
|
5944
5944
|
return _this;
|
|
5945
5945
|
}
|
|
5946
|
-
_createClass$
|
|
5946
|
+
_createClass$k(StreamingError2, null, [{
|
|
5947
5947
|
key: "create",
|
|
5948
5948
|
value: function create5(type, subType, origin, payload, msg) {
|
|
5949
5949
|
if (type instanceof StreamingError2) {
|
|
@@ -5979,7 +5979,7 @@ var LOG_MAX_SIZE$3 = 200 * 1024;
|
|
|
5979
5979
|
var SIMPLE_TYPE$3 = ["Boolean", "Number", "String", "Undefined", "Null", "Date", "Object"];
|
|
5980
5980
|
var Logger$b = /* @__PURE__ */ function() {
|
|
5981
5981
|
function Logger2(name, config) {
|
|
5982
|
-
_classCallCheck$
|
|
5982
|
+
_classCallCheck$k(this, Logger2);
|
|
5983
5983
|
this.name = name || "";
|
|
5984
5984
|
this._prefix = "[".concat(this.name, "]");
|
|
5985
5985
|
this.logCacheLevel = (config === null || config === void 0 ? void 0 : config.logCacheLevel) || 3;
|
|
@@ -5987,7 +5987,7 @@ var Logger$b = /* @__PURE__ */ function() {
|
|
|
5987
5987
|
this.logSize = 0;
|
|
5988
5988
|
this.logTextArray = [];
|
|
5989
5989
|
}
|
|
5990
|
-
_createClass$
|
|
5990
|
+
_createClass$k(Logger2, [{
|
|
5991
5991
|
key: "debug",
|
|
5992
5992
|
value: function debug() {
|
|
5993
5993
|
var _console;
|
|
@@ -6225,7 +6225,7 @@ var OP_NAME$3 = {
|
|
|
6225
6225
|
var MSE$3 = /* @__PURE__ */ function() {
|
|
6226
6226
|
function MSE2(media, config) {
|
|
6227
6227
|
var _this2 = this;
|
|
6228
|
-
_classCallCheck$
|
|
6228
|
+
_classCallCheck$k(this, MSE2);
|
|
6229
6229
|
_defineProperty$h(this, "media", null);
|
|
6230
6230
|
_defineProperty$h(this, "mediaSource", null);
|
|
6231
6231
|
_defineProperty$h(this, "_openPromise", createPublicPromise$5());
|
|
@@ -6285,7 +6285,7 @@ var MSE$3 = /* @__PURE__ */ function() {
|
|
|
6285
6285
|
Logger$b.enable();
|
|
6286
6286
|
}
|
|
6287
6287
|
}
|
|
6288
|
-
_createClass$
|
|
6288
|
+
_createClass$k(MSE2, [{
|
|
6289
6289
|
key: "isOpened",
|
|
6290
6290
|
get: function get3() {
|
|
6291
6291
|
var _this$mediaSource;
|
|
@@ -6869,7 +6869,7 @@ var NetError$3 = /* @__PURE__ */ function(_Error) {
|
|
|
6869
6869
|
var _super = _createSuper$e(NetError2);
|
|
6870
6870
|
function NetError2(url, request2, response, msg) {
|
|
6871
6871
|
var _this;
|
|
6872
|
-
_classCallCheck$
|
|
6872
|
+
_classCallCheck$k(this, NetError2);
|
|
6873
6873
|
_this = _super.call(this, msg);
|
|
6874
6874
|
_defineProperty$h(_assertThisInitialized$f(_this), "retryCount", 0);
|
|
6875
6875
|
_defineProperty$h(_assertThisInitialized$f(_this), "isTimeout", false);
|
|
@@ -6882,7 +6882,7 @@ var NetError$3 = /* @__PURE__ */ function(_Error) {
|
|
|
6882
6882
|
_this.response = response;
|
|
6883
6883
|
return _this;
|
|
6884
6884
|
}
|
|
6885
|
-
return _createClass$
|
|
6885
|
+
return _createClass$k(NetError2);
|
|
6886
6886
|
}(/* @__PURE__ */ _wrapNativeSuper$4(Error));
|
|
6887
6887
|
var toString$z = Object.prototype.toString;
|
|
6888
6888
|
function isObject$N(a2) {
|
|
@@ -7010,7 +7010,7 @@ var FetchLoader$3 = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
7010
7010
|
var _super = _createSuper$e(FetchLoader2);
|
|
7011
7011
|
function FetchLoader2() {
|
|
7012
7012
|
var _this;
|
|
7013
|
-
_classCallCheck$
|
|
7013
|
+
_classCallCheck$k(this, FetchLoader2);
|
|
7014
7014
|
_this = _super.call(this);
|
|
7015
7015
|
_defineProperty$h(_assertThisInitialized$f(_this), "_abortController", null);
|
|
7016
7016
|
_defineProperty$h(_assertThisInitialized$f(_this), "_timeoutTimer", null);
|
|
@@ -7028,7 +7028,7 @@ var FetchLoader$3 = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
7028
7028
|
_defineProperty$h(_assertThisInitialized$f(_this), "_priOptions", null);
|
|
7029
7029
|
return _this;
|
|
7030
7030
|
}
|
|
7031
|
-
_createClass$
|
|
7031
|
+
_createClass$k(FetchLoader2, [{
|
|
7032
7032
|
key: "load",
|
|
7033
7033
|
value: function load(_ref) {
|
|
7034
7034
|
var _this$_abortControlle, _this2 = this;
|
|
@@ -7462,7 +7462,7 @@ var XhrLoader$3 = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
7462
7462
|
var _super = _createSuper$e(XhrLoader2);
|
|
7463
7463
|
function XhrLoader2() {
|
|
7464
7464
|
var _this;
|
|
7465
|
-
_classCallCheck$
|
|
7465
|
+
_classCallCheck$k(this, XhrLoader2);
|
|
7466
7466
|
_this = _super.call(this);
|
|
7467
7467
|
_defineProperty$h(_assertThisInitialized$f(_this), "_xhr", null);
|
|
7468
7468
|
_defineProperty$h(_assertThisInitialized$f(_this), "_aborted", false);
|
|
@@ -7492,7 +7492,7 @@ var XhrLoader$3 = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
7492
7492
|
_defineProperty$h(_assertThisInitialized$f(_this), "_priOptions", null);
|
|
7493
7493
|
return _this;
|
|
7494
7494
|
}
|
|
7495
|
-
_createClass$
|
|
7495
|
+
_createClass$k(XhrLoader2, [{
|
|
7496
7496
|
key: "load",
|
|
7497
7497
|
value: function load(req) {
|
|
7498
7498
|
var _this2 = this;
|
|
@@ -7777,7 +7777,7 @@ var XhrLoader$3 = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
7777
7777
|
var _excluded$6 = ["retry", "retryDelay", "onRetryError", "transformError"];
|
|
7778
7778
|
var Task$3 = /* @__PURE__ */ function() {
|
|
7779
7779
|
function Task2(type, config) {
|
|
7780
|
-
_classCallCheck$
|
|
7780
|
+
_classCallCheck$k(this, Task2);
|
|
7781
7781
|
this.promise = createPublicPromise$5();
|
|
7782
7782
|
this.alive = !!config.onProgress;
|
|
7783
7783
|
!config.logger && (config.logger = new Logger$b("Loader"));
|
|
@@ -7790,7 +7790,7 @@ var Task$3 = /* @__PURE__ */ function() {
|
|
|
7790
7790
|
this._retryCheckFunc = config.retryCheckFunc;
|
|
7791
7791
|
this._logger = config.logger;
|
|
7792
7792
|
}
|
|
7793
|
-
_createClass$
|
|
7793
|
+
_createClass$k(Task2, [{
|
|
7794
7794
|
key: "exec",
|
|
7795
7795
|
value: function exec2() {
|
|
7796
7796
|
var _this = this;
|
|
@@ -7946,7 +7946,7 @@ var NetLoader$3 = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
7946
7946
|
var _super = _createSuper$e(NetLoader2);
|
|
7947
7947
|
function NetLoader2(cfg) {
|
|
7948
7948
|
var _this;
|
|
7949
|
-
_classCallCheck$
|
|
7949
|
+
_classCallCheck$k(this, NetLoader2);
|
|
7950
7950
|
_this = _super.call(this, cfg);
|
|
7951
7951
|
_defineProperty$h(_assertThisInitialized$f(_this), "type", LoaderType$3.FETCH);
|
|
7952
7952
|
_defineProperty$h(_assertThisInitialized$f(_this), "_queue", []);
|
|
@@ -7961,7 +7961,7 @@ var NetLoader$3 = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
7961
7961
|
_this.log = cfg.logger;
|
|
7962
7962
|
return _this;
|
|
7963
7963
|
}
|
|
7964
|
-
_createClass$
|
|
7964
|
+
_createClass$k(NetLoader2, [{
|
|
7965
7965
|
key: "isFetch",
|
|
7966
7966
|
value: function isFetch() {
|
|
7967
7967
|
return this.type === LoaderType$3.FETCH;
|
|
@@ -8066,10 +8066,10 @@ var NetLoader$3 = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
8066
8066
|
}(EventEmitter$1);
|
|
8067
8067
|
var GapService$1 = /* @__PURE__ */ function() {
|
|
8068
8068
|
function GapService2() {
|
|
8069
|
-
_classCallCheck$
|
|
8069
|
+
_classCallCheck$k(this, GapService2);
|
|
8070
8070
|
_defineProperty$h(this, "_prevCurrentTime", 0);
|
|
8071
8071
|
}
|
|
8072
|
-
_createClass$
|
|
8072
|
+
_createClass$k(GapService2, [{
|
|
8073
8073
|
key: "do",
|
|
8074
8074
|
value: function _do(media) {
|
|
8075
8075
|
var maxJumpDistance = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 3;
|
|
@@ -8100,7 +8100,7 @@ var GapService$1 = /* @__PURE__ */ function() {
|
|
|
8100
8100
|
var SeiService$1 = /* @__PURE__ */ function() {
|
|
8101
8101
|
function SeiService2(emitter) {
|
|
8102
8102
|
var _this = this;
|
|
8103
|
-
_classCallCheck$
|
|
8103
|
+
_classCallCheck$k(this, SeiService2);
|
|
8104
8104
|
_defineProperty$h(this, "_seiSet", /* @__PURE__ */ new Set());
|
|
8105
8105
|
this.emitter = emitter;
|
|
8106
8106
|
emitter.on(EVENT$3.SEI, function(sei) {
|
|
@@ -8108,7 +8108,7 @@ var SeiService$1 = /* @__PURE__ */ function() {
|
|
|
8108
8108
|
_this._seiSet.add(sei);
|
|
8109
8109
|
});
|
|
8110
8110
|
}
|
|
8111
|
-
_createClass$
|
|
8111
|
+
_createClass$k(SeiService2, [{
|
|
8112
8112
|
key: "throw",
|
|
8113
8113
|
value: function _throw(currentTime, isLive) {
|
|
8114
8114
|
var _this2 = this;
|
|
@@ -8148,7 +8148,7 @@ var MAX_SEGMENT_SAVE_SIZE$1 = 3;
|
|
|
8148
8148
|
var LONGTIME_NO_RECEIVE$1 = 3e3;
|
|
8149
8149
|
var BandwidthService$1 = /* @__PURE__ */ function() {
|
|
8150
8150
|
function BandwidthService2(opts) {
|
|
8151
|
-
_classCallCheck$
|
|
8151
|
+
_classCallCheck$k(this, BandwidthService2);
|
|
8152
8152
|
_defineProperty$h(this, "_chunkSpeed", 0);
|
|
8153
8153
|
_defineProperty$h(this, "_chunkCache", []);
|
|
8154
8154
|
_defineProperty$h(this, "_speeds", []);
|
|
@@ -8156,7 +8156,7 @@ var BandwidthService$1 = /* @__PURE__ */ function() {
|
|
|
8156
8156
|
_defineProperty$h(this, "_totalCost", 0);
|
|
8157
8157
|
this._opts = opts || {};
|
|
8158
8158
|
}
|
|
8159
|
-
_createClass$
|
|
8159
|
+
_createClass$k(BandwidthService2, [{
|
|
8160
8160
|
key: "addRecord",
|
|
8161
8161
|
value: function addRecord(totalByte, ms) {
|
|
8162
8162
|
if (!totalByte || !ms)
|
|
@@ -8244,7 +8244,7 @@ var BandwidthService$1 = /* @__PURE__ */ function() {
|
|
|
8244
8244
|
}();
|
|
8245
8245
|
var Stats$1 = /* @__PURE__ */ function() {
|
|
8246
8246
|
function Stats2(timescale) {
|
|
8247
|
-
_classCallCheck$
|
|
8247
|
+
_classCallCheck$k(this, Stats2);
|
|
8248
8248
|
_defineProperty$h(this, "encodeType", "");
|
|
8249
8249
|
_defineProperty$h(this, "audioCodec", "");
|
|
8250
8250
|
_defineProperty$h(this, "videoCodec", "");
|
|
@@ -8261,7 +8261,7 @@ var Stats$1 = /* @__PURE__ */ function() {
|
|
|
8261
8261
|
_defineProperty$h(this, "_startGopId", -1);
|
|
8262
8262
|
this._timescale = timescale;
|
|
8263
8263
|
}
|
|
8264
|
-
_createClass$
|
|
8264
|
+
_createClass$k(Stats2, [{
|
|
8265
8265
|
key: "getStats",
|
|
8266
8266
|
value: function getStats2() {
|
|
8267
8267
|
return {
|
|
@@ -8355,7 +8355,7 @@ var Stats$1 = /* @__PURE__ */ function() {
|
|
|
8355
8355
|
var MediaStatsService$1 = /* @__PURE__ */ function() {
|
|
8356
8356
|
function MediaStatsService2(core) {
|
|
8357
8357
|
var timescale = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1e3;
|
|
8358
|
-
_classCallCheck$
|
|
8358
|
+
_classCallCheck$k(this, MediaStatsService2);
|
|
8359
8359
|
_defineProperty$h(this, "_core", null);
|
|
8360
8360
|
_defineProperty$h(this, "_samples", []);
|
|
8361
8361
|
this._core = core;
|
|
@@ -8363,7 +8363,7 @@ var MediaStatsService$1 = /* @__PURE__ */ function() {
|
|
|
8363
8363
|
this._stats = new Stats$1(timescale);
|
|
8364
8364
|
this._bindEvents();
|
|
8365
8365
|
}
|
|
8366
|
-
_createClass$
|
|
8366
|
+
_createClass$k(MediaStatsService2, [{
|
|
8367
8367
|
key: "getStats",
|
|
8368
8368
|
value: function getStats2() {
|
|
8369
8369
|
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;
|
|
@@ -8435,33 +8435,33 @@ function _iterableToArrayLimit$7(arr, i2) {
|
|
|
8435
8435
|
return _arr;
|
|
8436
8436
|
}
|
|
8437
8437
|
}
|
|
8438
|
-
function _classCallCheck$
|
|
8438
|
+
function _classCallCheck$j(instance, Constructor2) {
|
|
8439
8439
|
if (!(instance instanceof Constructor2)) {
|
|
8440
8440
|
throw new TypeError("Cannot call a class as a function");
|
|
8441
8441
|
}
|
|
8442
8442
|
}
|
|
8443
|
-
function _defineProperties$
|
|
8443
|
+
function _defineProperties$j(target, props) {
|
|
8444
8444
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
8445
8445
|
var descriptor = props[i2];
|
|
8446
8446
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
8447
8447
|
descriptor.configurable = true;
|
|
8448
8448
|
if ("value" in descriptor)
|
|
8449
8449
|
descriptor.writable = true;
|
|
8450
|
-
Object.defineProperty(target, _toPropertyKey$
|
|
8450
|
+
Object.defineProperty(target, _toPropertyKey$9(descriptor.key), descriptor);
|
|
8451
8451
|
}
|
|
8452
8452
|
}
|
|
8453
|
-
function _createClass$
|
|
8453
|
+
function _createClass$j(Constructor2, protoProps, staticProps) {
|
|
8454
8454
|
if (protoProps)
|
|
8455
|
-
_defineProperties$
|
|
8455
|
+
_defineProperties$j(Constructor2.prototype, protoProps);
|
|
8456
8456
|
if (staticProps)
|
|
8457
|
-
_defineProperties$
|
|
8457
|
+
_defineProperties$j(Constructor2, staticProps);
|
|
8458
8458
|
Object.defineProperty(Constructor2, "prototype", {
|
|
8459
8459
|
writable: false
|
|
8460
8460
|
});
|
|
8461
8461
|
return Constructor2;
|
|
8462
8462
|
}
|
|
8463
8463
|
function _defineProperty$g(obj, key2, value2) {
|
|
8464
|
-
key2 = _toPropertyKey$
|
|
8464
|
+
key2 = _toPropertyKey$9(key2);
|
|
8465
8465
|
if (key2 in obj) {
|
|
8466
8466
|
Object.defineProperty(obj, key2, {
|
|
8467
8467
|
value: value2,
|
|
@@ -8590,7 +8590,7 @@ function _nonIterableSpread$8() {
|
|
|
8590
8590
|
function _nonIterableRest$7() {
|
|
8591
8591
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
8592
8592
|
}
|
|
8593
|
-
function _toPrimitive$
|
|
8593
|
+
function _toPrimitive$9(input, hint) {
|
|
8594
8594
|
if (typeof input !== "object" || input === null)
|
|
8595
8595
|
return input;
|
|
8596
8596
|
var prim = input[Symbol.toPrimitive];
|
|
@@ -8602,8 +8602,8 @@ function _toPrimitive$8(input, hint) {
|
|
|
8602
8602
|
}
|
|
8603
8603
|
return (hint === "string" ? String : Number)(input);
|
|
8604
8604
|
}
|
|
8605
|
-
function _toPropertyKey$
|
|
8606
|
-
var key2 = _toPrimitive$
|
|
8605
|
+
function _toPropertyKey$9(arg) {
|
|
8606
|
+
var key2 = _toPrimitive$9(arg, "string");
|
|
8607
8607
|
return typeof key2 === "symbol" ? key2 : String(key2);
|
|
8608
8608
|
}
|
|
8609
8609
|
var TrackType$3 = {
|
|
@@ -8633,7 +8633,7 @@ var WarningType$1 = {
|
|
|
8633
8633
|
};
|
|
8634
8634
|
var VideoTrack$2 = /* @__PURE__ */ function() {
|
|
8635
8635
|
function VideoTrack2() {
|
|
8636
|
-
_classCallCheck$
|
|
8636
|
+
_classCallCheck$j(this, VideoTrack2);
|
|
8637
8637
|
_defineProperty$g(this, "id", 1);
|
|
8638
8638
|
_defineProperty$g(this, "type", TrackType$3.VIDEO);
|
|
8639
8639
|
_defineProperty$g(this, "codecType", VideoCodecType$3.AVC);
|
|
@@ -8666,7 +8666,7 @@ var VideoTrack$2 = /* @__PURE__ */ function() {
|
|
|
8666
8666
|
_defineProperty$g(this, "pssh", null);
|
|
8667
8667
|
_defineProperty$g(this, "ext", void 0);
|
|
8668
8668
|
}
|
|
8669
|
-
_createClass$
|
|
8669
|
+
_createClass$j(VideoTrack2, [{
|
|
8670
8670
|
key: "reset",
|
|
8671
8671
|
value: function reset() {
|
|
8672
8672
|
this.sequenceNumber = this.width = this.height = this.fpsDen = this.fpsNum = this.duration = this.baseMediaDecodeTime = this.timescale = 0;
|
|
@@ -8724,7 +8724,7 @@ var VideoTrack$2 = /* @__PURE__ */ function() {
|
|
|
8724
8724
|
}();
|
|
8725
8725
|
var AudioTrack$2 = /* @__PURE__ */ function() {
|
|
8726
8726
|
function AudioTrack2() {
|
|
8727
|
-
_classCallCheck$
|
|
8727
|
+
_classCallCheck$j(this, AudioTrack2);
|
|
8728
8728
|
_defineProperty$g(this, "id", 2);
|
|
8729
8729
|
_defineProperty$g(this, "type", TrackType$3.AUDIO);
|
|
8730
8730
|
_defineProperty$g(this, "codecType", AudioCodecType$2.AAC);
|
|
@@ -8752,7 +8752,7 @@ var AudioTrack$2 = /* @__PURE__ */ function() {
|
|
|
8752
8752
|
_defineProperty$g(this, "kid", null);
|
|
8753
8753
|
_defineProperty$g(this, "ext", void 0);
|
|
8754
8754
|
}
|
|
8755
|
-
_createClass$
|
|
8755
|
+
_createClass$j(AudioTrack2, [{
|
|
8756
8756
|
key: "reset",
|
|
8757
8757
|
value: function reset() {
|
|
8758
8758
|
this.sequenceNumber = 0;
|
|
@@ -8808,7 +8808,7 @@ var AudioTrack$2 = /* @__PURE__ */ function() {
|
|
|
8808
8808
|
}();
|
|
8809
8809
|
var VideoSample$2 = /* @__PURE__ */ function() {
|
|
8810
8810
|
function VideoSample2(pts, dts, units) {
|
|
8811
|
-
_classCallCheck$
|
|
8811
|
+
_classCallCheck$j(this, VideoSample2);
|
|
8812
8812
|
_defineProperty$g(this, "flag", {});
|
|
8813
8813
|
_defineProperty$g(this, "keyframe", false);
|
|
8814
8814
|
_defineProperty$g(this, "gopId", 0);
|
|
@@ -8821,7 +8821,7 @@ var VideoSample$2 = /* @__PURE__ */ function() {
|
|
|
8821
8821
|
if (units)
|
|
8822
8822
|
this.units = units;
|
|
8823
8823
|
}
|
|
8824
|
-
_createClass$
|
|
8824
|
+
_createClass$j(VideoSample2, [{
|
|
8825
8825
|
key: "cts",
|
|
8826
8826
|
get: function get3() {
|
|
8827
8827
|
return this.pts - this.dts;
|
|
@@ -8836,9 +8836,9 @@ var VideoSample$2 = /* @__PURE__ */ function() {
|
|
|
8836
8836
|
}]);
|
|
8837
8837
|
return VideoSample2;
|
|
8838
8838
|
}();
|
|
8839
|
-
var AudioSample$2 = /* @__PURE__ */ _createClass$
|
|
8839
|
+
var AudioSample$2 = /* @__PURE__ */ _createClass$j(
|
|
8840
8840
|
function AudioSample2(pts, data2, duration, sampleOffset) {
|
|
8841
|
-
_classCallCheck$
|
|
8841
|
+
_classCallCheck$j(this, AudioSample2);
|
|
8842
8842
|
_defineProperty$g(this, "duration", 1024);
|
|
8843
8843
|
_defineProperty$g(this, "flag", {
|
|
8844
8844
|
dependsOn: 2,
|
|
@@ -8853,9 +8853,9 @@ var AudioSample$2 = /* @__PURE__ */ _createClass$i(
|
|
|
8853
8853
|
this.duration = duration;
|
|
8854
8854
|
}
|
|
8855
8855
|
);
|
|
8856
|
-
var Sample$1 = /* @__PURE__ */ _createClass$
|
|
8856
|
+
var Sample$1 = /* @__PURE__ */ _createClass$j(
|
|
8857
8857
|
function Sample2(data2, pts) {
|
|
8858
|
-
_classCallCheck$
|
|
8858
|
+
_classCallCheck$j(this, Sample2);
|
|
8859
8859
|
_defineProperty$g(this, "time", 0);
|
|
8860
8860
|
this.data = data2;
|
|
8861
8861
|
this.originPts = this.pts = pts;
|
|
@@ -8865,30 +8865,30 @@ var FlvScriptSample = /* @__PURE__ */ function(_Sample) {
|
|
|
8865
8865
|
_inherits$e(FlvScriptSample2, _Sample);
|
|
8866
8866
|
var _super = _createSuper$d(FlvScriptSample2);
|
|
8867
8867
|
function FlvScriptSample2() {
|
|
8868
|
-
_classCallCheck$
|
|
8868
|
+
_classCallCheck$j(this, FlvScriptSample2);
|
|
8869
8869
|
return _super.apply(this, arguments);
|
|
8870
8870
|
}
|
|
8871
|
-
return _createClass$
|
|
8871
|
+
return _createClass$j(FlvScriptSample2);
|
|
8872
8872
|
}(Sample$1);
|
|
8873
8873
|
var SeiSample$1 = /* @__PURE__ */ function(_Sample2) {
|
|
8874
8874
|
_inherits$e(SeiSample2, _Sample2);
|
|
8875
8875
|
var _super2 = _createSuper$d(SeiSample2);
|
|
8876
8876
|
function SeiSample2() {
|
|
8877
|
-
_classCallCheck$
|
|
8877
|
+
_classCallCheck$j(this, SeiSample2);
|
|
8878
8878
|
return _super2.apply(this, arguments);
|
|
8879
8879
|
}
|
|
8880
|
-
return _createClass$
|
|
8880
|
+
return _createClass$j(SeiSample2);
|
|
8881
8881
|
}(Sample$1);
|
|
8882
8882
|
var MetadataTrack$2 = /* @__PURE__ */ function() {
|
|
8883
8883
|
function MetadataTrack2() {
|
|
8884
|
-
_classCallCheck$
|
|
8884
|
+
_classCallCheck$j(this, MetadataTrack2);
|
|
8885
8885
|
_defineProperty$g(this, "id", 3);
|
|
8886
8886
|
_defineProperty$g(this, "type", TrackType$3.METADATA);
|
|
8887
8887
|
_defineProperty$g(this, "timescale", 0);
|
|
8888
8888
|
_defineProperty$g(this, "flvScriptSamples", []);
|
|
8889
8889
|
_defineProperty$g(this, "seiSamples", []);
|
|
8890
8890
|
}
|
|
8891
|
-
_createClass$
|
|
8891
|
+
_createClass$j(MetadataTrack2, [{
|
|
8892
8892
|
key: "exist",
|
|
8893
8893
|
value: function exist() {
|
|
8894
8894
|
return !!((this.flvScriptSamples.length || this.seiSamples.length) && this.timescale);
|
|
@@ -8910,11 +8910,11 @@ var MetadataTrack$2 = /* @__PURE__ */ function() {
|
|
|
8910
8910
|
}();
|
|
8911
8911
|
var Logger$a = /* @__PURE__ */ function() {
|
|
8912
8912
|
function Logger2(name) {
|
|
8913
|
-
_classCallCheck$
|
|
8913
|
+
_classCallCheck$j(this, Logger2);
|
|
8914
8914
|
this.name = name || "";
|
|
8915
8915
|
this._prefix = "[".concat(this.name, "]");
|
|
8916
8916
|
}
|
|
8917
|
-
_createClass$
|
|
8917
|
+
_createClass$j(Logger2, [{
|
|
8918
8918
|
key: "warn",
|
|
8919
8919
|
value: function warn() {
|
|
8920
8920
|
var _console;
|
|
@@ -8946,9 +8946,9 @@ var isFirefox$2 = isBrowser$4 && ua$2.includes("firefox");
|
|
|
8946
8946
|
var isAndroid$2 = isBrowser$4 && ua$2.includes("android");
|
|
8947
8947
|
var AAC$2 = /* @__PURE__ */ function() {
|
|
8948
8948
|
function AAC2() {
|
|
8949
|
-
_classCallCheck$
|
|
8949
|
+
_classCallCheck$j(this, AAC2);
|
|
8950
8950
|
}
|
|
8951
|
-
_createClass$
|
|
8951
|
+
_createClass$j(AAC2, null, [{
|
|
8952
8952
|
key: "getRateIndexByRate",
|
|
8953
8953
|
value: function getRateIndexByRate(rate) {
|
|
8954
8954
|
return AAC2.FREQ.indexOf(rate);
|
|
@@ -9121,9 +9121,9 @@ var AAC$2 = /* @__PURE__ */ function() {
|
|
|
9121
9121
|
_defineProperty$g(AAC$2, "FREQ", [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350]);
|
|
9122
9122
|
var OPUS = /* @__PURE__ */ function() {
|
|
9123
9123
|
function OPUS2() {
|
|
9124
|
-
_classCallCheck$
|
|
9124
|
+
_classCallCheck$j(this, OPUS2);
|
|
9125
9125
|
}
|
|
9126
|
-
_createClass$
|
|
9126
|
+
_createClass$j(OPUS2, null, [{
|
|
9127
9127
|
key: "getFrameDuration",
|
|
9128
9128
|
value: function getFrameDuration(samples) {
|
|
9129
9129
|
return 20;
|
|
@@ -9172,7 +9172,7 @@ var VIDEO_EXCEPTION_LOG_EMIT_DURATION = 5e3;
|
|
|
9172
9172
|
var TRACK_BROKEN_CHECK_TIME = 5;
|
|
9173
9173
|
var FlvFixer = /* @__PURE__ */ function() {
|
|
9174
9174
|
function FlvFixer2(videoTrack, audioTrack, metadataTrack) {
|
|
9175
|
-
_classCallCheck$
|
|
9175
|
+
_classCallCheck$j(this, FlvFixer2);
|
|
9176
9176
|
this.videoTrack = videoTrack;
|
|
9177
9177
|
this.audioTrack = audioTrack;
|
|
9178
9178
|
this.metadataTrack = metadataTrack;
|
|
@@ -9190,7 +9190,7 @@ var FlvFixer = /* @__PURE__ */ function() {
|
|
|
9190
9190
|
this._lastVideoExceptionLargeGapDot = -Infinity;
|
|
9191
9191
|
this._lastVideoExceptionChunkFirstDtsDot = -Infinity;
|
|
9192
9192
|
}
|
|
9193
|
-
_createClass$
|
|
9193
|
+
_createClass$j(FlvFixer2, [{
|
|
9194
9194
|
key: "fix",
|
|
9195
9195
|
value: function fix() {
|
|
9196
9196
|
var _this = this;
|
|
@@ -9532,7 +9532,7 @@ function concatUint8Array$5() {
|
|
|
9532
9532
|
});
|
|
9533
9533
|
return data2;
|
|
9534
9534
|
}
|
|
9535
|
-
function readBig32$
|
|
9535
|
+
function readBig32$3(data2) {
|
|
9536
9536
|
var i2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
9537
9537
|
return (data2[i2] << 24 >>> 0) + (data2[i2 + 1] << 16) + (data2[i2 + 2] << 8) + (data2[i2 + 3] || 0);
|
|
9538
9538
|
}
|
|
@@ -9564,11 +9564,11 @@ function parse$3(a2) {
|
|
|
9564
9564
|
return parseInt(item, 16);
|
|
9565
9565
|
});
|
|
9566
9566
|
}
|
|
9567
|
-
var NALu$
|
|
9567
|
+
var NALu$2 = /* @__PURE__ */ function() {
|
|
9568
9568
|
function NALu2() {
|
|
9569
|
-
_classCallCheck$
|
|
9569
|
+
_classCallCheck$j(this, NALu2);
|
|
9570
9570
|
}
|
|
9571
|
-
_createClass$
|
|
9571
|
+
_createClass$j(NALu2, null, [{
|
|
9572
9572
|
key: "parseAnnexB",
|
|
9573
9573
|
value: function parseAnnexB(data2) {
|
|
9574
9574
|
var j = data2.byteLength - 1;
|
|
@@ -9646,7 +9646,7 @@ var NALu$1 = /* @__PURE__ */ function() {
|
|
|
9646
9646
|
var offset = 0;
|
|
9647
9647
|
var length;
|
|
9648
9648
|
while (offset + size < dataLen) {
|
|
9649
|
-
length = readBig32$
|
|
9649
|
+
length = readBig32$3(data2, offset);
|
|
9650
9650
|
if (size === 3)
|
|
9651
9651
|
length >>>= 8;
|
|
9652
9652
|
offset += size;
|
|
@@ -9724,7 +9724,7 @@ var NALu$1 = /* @__PURE__ */ function() {
|
|
|
9724
9724
|
}();
|
|
9725
9725
|
var ExpGolomb$1 = /* @__PURE__ */ function() {
|
|
9726
9726
|
function ExpGolomb2(data2) {
|
|
9727
|
-
_classCallCheck$
|
|
9727
|
+
_classCallCheck$j(this, ExpGolomb2);
|
|
9728
9728
|
_defineProperty$g(this, "_bytesAvailable", void 0);
|
|
9729
9729
|
_defineProperty$g(this, "_bitsAvailable", 0);
|
|
9730
9730
|
_defineProperty$g(this, "_word", 0);
|
|
@@ -9735,7 +9735,7 @@ var ExpGolomb$1 = /* @__PURE__ */ function() {
|
|
|
9735
9735
|
if (this._bytesAvailable)
|
|
9736
9736
|
this._loadWord();
|
|
9737
9737
|
}
|
|
9738
|
-
_createClass$
|
|
9738
|
+
_createClass$j(ExpGolomb2, [{
|
|
9739
9739
|
key: "bitsAvailable",
|
|
9740
9740
|
get: function get3() {
|
|
9741
9741
|
return this._bitsAvailable;
|
|
@@ -9852,9 +9852,9 @@ var ExpGolomb$1 = /* @__PURE__ */ function() {
|
|
|
9852
9852
|
}();
|
|
9853
9853
|
var AVC$1 = /* @__PURE__ */ function() {
|
|
9854
9854
|
function AVC2() {
|
|
9855
|
-
_classCallCheck$
|
|
9855
|
+
_classCallCheck$j(this, AVC2);
|
|
9856
9856
|
}
|
|
9857
|
-
_createClass$
|
|
9857
|
+
_createClass$j(AVC2, null, [{
|
|
9858
9858
|
key: "parseAVCDecoderConfigurationRecord",
|
|
9859
9859
|
value: function parseAVCDecoderConfigurationRecord(data2) {
|
|
9860
9860
|
if (data2.length < 7)
|
|
@@ -9875,7 +9875,7 @@ var AVC$1 = /* @__PURE__ */ function() {
|
|
|
9875
9875
|
offset += spsSize;
|
|
9876
9876
|
spsArr.push(sps);
|
|
9877
9877
|
if (!spsParsed) {
|
|
9878
|
-
spsParsed = AVC2.parseSPS(NALu$
|
|
9878
|
+
spsParsed = AVC2.parseSPS(NALu$2.removeEPB(sps));
|
|
9879
9879
|
}
|
|
9880
9880
|
}
|
|
9881
9881
|
var ppsCount = data2[offset];
|
|
@@ -10062,9 +10062,9 @@ var AVC$1 = /* @__PURE__ */ function() {
|
|
|
10062
10062
|
}();
|
|
10063
10063
|
var HEVC$1 = /* @__PURE__ */ function() {
|
|
10064
10064
|
function HEVC2() {
|
|
10065
|
-
_classCallCheck$
|
|
10065
|
+
_classCallCheck$j(this, HEVC2);
|
|
10066
10066
|
}
|
|
10067
|
-
_createClass$
|
|
10067
|
+
_createClass$j(HEVC2, null, [{
|
|
10068
10068
|
key: "parseHEVCDecoderConfigurationRecord",
|
|
10069
10069
|
value: function parseHEVCDecoderConfigurationRecord(data2) {
|
|
10070
10070
|
var hvcC = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
@@ -10096,7 +10096,7 @@ var HEVC$1 = /* @__PURE__ */ function() {
|
|
|
10096
10096
|
{
|
|
10097
10097
|
var vps = data2.subarray(offset, offset + nalSize);
|
|
10098
10098
|
if (!vpsParsed)
|
|
10099
|
-
vpsParsed = HEVC2.parseVPS(NALu$
|
|
10099
|
+
vpsParsed = HEVC2.parseVPS(NALu$2.removeEPB(vps), hvcC);
|
|
10100
10100
|
vpsArr.push(vps);
|
|
10101
10101
|
}
|
|
10102
10102
|
break;
|
|
@@ -10104,7 +10104,7 @@ var HEVC$1 = /* @__PURE__ */ function() {
|
|
|
10104
10104
|
{
|
|
10105
10105
|
var sps = data2.subarray(offset, offset + nalSize);
|
|
10106
10106
|
if (!spsParsed)
|
|
10107
|
-
spsParsed = HEVC2.parseSPS(NALu$
|
|
10107
|
+
spsParsed = HEVC2.parseSPS(NALu$2.removeEPB(sps), hvcC);
|
|
10108
10108
|
spsArr.push(sps);
|
|
10109
10109
|
}
|
|
10110
10110
|
break;
|
|
@@ -10238,9 +10238,9 @@ var HEVC$1 = /* @__PURE__ */ function() {
|
|
|
10238
10238
|
}();
|
|
10239
10239
|
var UTF8 = /* @__PURE__ */ function() {
|
|
10240
10240
|
function UTF82() {
|
|
10241
|
-
_classCallCheck$
|
|
10241
|
+
_classCallCheck$j(this, UTF82);
|
|
10242
10242
|
}
|
|
10243
|
-
_createClass$
|
|
10243
|
+
_createClass$j(UTF82, null, [{
|
|
10244
10244
|
key: "decode",
|
|
10245
10245
|
value: function decode(uint8array) {
|
|
10246
10246
|
var out = [];
|
|
@@ -10309,9 +10309,9 @@ var UTF8 = /* @__PURE__ */ function() {
|
|
|
10309
10309
|
}();
|
|
10310
10310
|
var AMF = /* @__PURE__ */ function() {
|
|
10311
10311
|
function AMF2() {
|
|
10312
|
-
_classCallCheck$
|
|
10312
|
+
_classCallCheck$j(this, AMF2);
|
|
10313
10313
|
}
|
|
10314
|
-
_createClass$
|
|
10314
|
+
_createClass$j(AMF2, null, [{
|
|
10315
10315
|
key: "parse",
|
|
10316
10316
|
value: function parse4(data2) {
|
|
10317
10317
|
if (data2.length < 3)
|
|
@@ -10478,7 +10478,7 @@ var FlvSoundFormat = {
|
|
|
10478
10478
|
var logger$c = new Logger$a("FlvDemuxer");
|
|
10479
10479
|
var FlvDemuxer = /* @__PURE__ */ function() {
|
|
10480
10480
|
function FlvDemuxer2(videoTrack, audioTrack, metadataTrack) {
|
|
10481
|
-
_classCallCheck$
|
|
10481
|
+
_classCallCheck$j(this, FlvDemuxer2);
|
|
10482
10482
|
_defineProperty$g(this, "_headerParsed", false);
|
|
10483
10483
|
_defineProperty$g(this, "_remainingData", null);
|
|
10484
10484
|
_defineProperty$g(this, "_gopId", 0);
|
|
@@ -10488,7 +10488,7 @@ var FlvDemuxer = /* @__PURE__ */ function() {
|
|
|
10488
10488
|
this.metadataTrack = metadataTrack || new MetadataTrack$2();
|
|
10489
10489
|
this._fixer = new FlvFixer(this.videoTrack, this.audioTrack, this.metadataTrack);
|
|
10490
10490
|
}
|
|
10491
|
-
_createClass$
|
|
10491
|
+
_createClass$j(FlvDemuxer2, [{
|
|
10492
10492
|
key: "demux",
|
|
10493
10493
|
value: function demux(data2) {
|
|
10494
10494
|
var _scriptDataObject$dat;
|
|
@@ -10533,7 +10533,7 @@ var FlvDemuxer = /* @__PURE__ */ function() {
|
|
|
10533
10533
|
audioTrack.present = (data2[4] & 4) >>> 2 !== 0;
|
|
10534
10534
|
videoTrack.present = (data2[4] & 1) !== 0;
|
|
10535
10535
|
this._headerParsed = true;
|
|
10536
|
-
offset = readBig32$
|
|
10536
|
+
offset = readBig32$3(data2, 5) + 4;
|
|
10537
10537
|
}
|
|
10538
10538
|
var dataLen = data2.length;
|
|
10539
10539
|
var tagType;
|
|
@@ -10561,7 +10561,7 @@ var FlvDemuxer = /* @__PURE__ */ function() {
|
|
|
10561
10561
|
logger$c.warn("Invalid tag type: ".concat(tagType));
|
|
10562
10562
|
}
|
|
10563
10563
|
offset += dataSize;
|
|
10564
|
-
prevTagSize = readBig32$
|
|
10564
|
+
prevTagSize = readBig32$3(data2, offset);
|
|
10565
10565
|
if (prevTagSize !== 11 + dataSize) {
|
|
10566
10566
|
logger$c.warn("Invalid PrevTagSize ".concat(prevTagSize, " (").concat(11 + dataSize, ")"));
|
|
10567
10567
|
}
|
|
@@ -10768,7 +10768,7 @@ var FlvDemuxer = /* @__PURE__ */ function() {
|
|
|
10768
10768
|
logger$c.warn("Cannot parse ".concat(isHevc ? "HEVC" : "AVC", "DecoderConfigurationRecord"), data2);
|
|
10769
10769
|
}
|
|
10770
10770
|
} else if (packetType === 1) {
|
|
10771
|
-
var units = NALu$
|
|
10771
|
+
var units = NALu$2.parseAvcC(data2.subarray(5), track.nalUnitSize);
|
|
10772
10772
|
units = this._checkAddMetaNalToUnits(isHevc, units, track);
|
|
10773
10773
|
if (units && units.length) {
|
|
10774
10774
|
var sample = new VideoSample$2(dts + cts, dts, units);
|
|
@@ -10802,7 +10802,7 @@ var FlvDemuxer = /* @__PURE__ */ function() {
|
|
|
10802
10802
|
case 40:
|
|
10803
10803
|
if (!isHevc && type !== 6 || isHevc && type === 6)
|
|
10804
10804
|
break;
|
|
10805
|
-
_this.metadataTrack.seiSamples.push(new SeiSample$1(NALu$
|
|
10805
|
+
_this.metadataTrack.seiSamples.push(new SeiSample$1(NALu$2.parseSEI(NALu$2.removeEPB(unit), isHevc), dts + cts));
|
|
10806
10806
|
break;
|
|
10807
10807
|
}
|
|
10808
10808
|
});
|
|
@@ -10849,7 +10849,7 @@ var FlvDemuxer = /* @__PURE__ */ function() {
|
|
|
10849
10849
|
if (data2[0] !== 70 || data2[1] !== 76 || data2[2] !== 86 || data2[3] !== 1) {
|
|
10850
10850
|
return false;
|
|
10851
10851
|
}
|
|
10852
|
-
return readBig32$
|
|
10852
|
+
return readBig32$3(data2, 5) >= 9;
|
|
10853
10853
|
}
|
|
10854
10854
|
}]);
|
|
10855
10855
|
return FlvDemuxer2;
|
|
@@ -10873,10 +10873,10 @@ function Concat$3(ResultConstructor) {
|
|
|
10873
10873
|
}
|
|
10874
10874
|
var Buffer$5 = /* @__PURE__ */ function() {
|
|
10875
10875
|
function Buffer22() {
|
|
10876
|
-
_classCallCheck$
|
|
10876
|
+
_classCallCheck$j(this, Buffer22);
|
|
10877
10877
|
this.buffer = new Uint8Array(0);
|
|
10878
10878
|
}
|
|
10879
|
-
_createClass$
|
|
10879
|
+
_createClass$j(Buffer22, [{
|
|
10880
10880
|
key: "write",
|
|
10881
10881
|
value: function write() {
|
|
10882
10882
|
var self2 = this;
|
|
@@ -10907,9 +10907,9 @@ var Buffer$5 = /* @__PURE__ */ function() {
|
|
|
10907
10907
|
var UINT32_MAX$3 = Math.pow(2, 32) - 1;
|
|
10908
10908
|
var MP4$4 = /* @__PURE__ */ function() {
|
|
10909
10909
|
function MP42() {
|
|
10910
|
-
_classCallCheck$
|
|
10910
|
+
_classCallCheck$j(this, MP42);
|
|
10911
10911
|
}
|
|
10912
|
-
_createClass$
|
|
10912
|
+
_createClass$j(MP42, null, [{
|
|
10913
10913
|
key: "box",
|
|
10914
10914
|
value: function box(type) {
|
|
10915
10915
|
for (var _len = arguments.length, payload = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
@@ -12772,12 +12772,12 @@ _defineProperty$g(MP4$4, "STSZ", MP4$4.box(MP4$4.types.stsz, new Uint8Array([
|
|
|
12772
12772
|
_defineProperty$g(MP4$4, "STCO", MP4$4.box(MP4$4.types.stco, MP4$4.StblTable));
|
|
12773
12773
|
var Logger$9 = /* @__PURE__ */ function() {
|
|
12774
12774
|
function Logger2(name, enable2) {
|
|
12775
|
-
_classCallCheck$
|
|
12775
|
+
_classCallCheck$j(this, Logger2);
|
|
12776
12776
|
this.name = name || "";
|
|
12777
12777
|
this._prefix = "[".concat(this.name, "]");
|
|
12778
12778
|
Logger2.disabled = enable2;
|
|
12779
12779
|
}
|
|
12780
|
-
_createClass$
|
|
12780
|
+
_createClass$j(Logger2, [{
|
|
12781
12781
|
key: "debug",
|
|
12782
12782
|
value: function debug() {
|
|
12783
12783
|
var _console;
|
|
@@ -12847,14 +12847,14 @@ var Logger$9 = /* @__PURE__ */ function() {
|
|
|
12847
12847
|
_defineProperty$g(Logger$9, "disabled", true);
|
|
12848
12848
|
var FMP4Remuxer$3 = /* @__PURE__ */ function() {
|
|
12849
12849
|
function FMP4Remuxer2(videoTrack, audioTrack, options) {
|
|
12850
|
-
_classCallCheck$
|
|
12850
|
+
_classCallCheck$j(this, FMP4Remuxer2);
|
|
12851
12851
|
this.videoTrack = videoTrack;
|
|
12852
12852
|
this.audioTrack = audioTrack;
|
|
12853
12853
|
var browserVersions = /Chrome\/([^.]+)/.exec(navigator.userAgent);
|
|
12854
12854
|
this.forceFirstIDR = browserVersions && Number(browserVersions[1]) < 50;
|
|
12855
12855
|
this.log = new Logger$9("FMP4Remuxer", options && options.openLog ? !options.openLog : true);
|
|
12856
12856
|
}
|
|
12857
|
-
_createClass$
|
|
12857
|
+
_createClass$j(FMP4Remuxer2, [{
|
|
12858
12858
|
key: "remux",
|
|
12859
12859
|
value: function remux() {
|
|
12860
12860
|
var createInit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
@@ -14650,7 +14650,7 @@ const NoPadding = {
|
|
|
14650
14650
|
};
|
|
14651
14651
|
var TransferCost = /* @__PURE__ */ function() {
|
|
14652
14652
|
function TransferCost2() {
|
|
14653
|
-
_classCallCheck$
|
|
14653
|
+
_classCallCheck$m(this, TransferCost2);
|
|
14654
14654
|
_defineProperty$j(this, "_ttfb", 0);
|
|
14655
14655
|
_defineProperty$j(this, "_demuxStart", 0);
|
|
14656
14656
|
_defineProperty$j(this, "_demuxEnd", 0);
|
|
@@ -14662,7 +14662,7 @@ var TransferCost = /* @__PURE__ */ function() {
|
|
|
14662
14662
|
_defineProperty$j(this, "_appendEnd", 0);
|
|
14663
14663
|
_defineProperty$j(this, "_appendCost", 0);
|
|
14664
14664
|
}
|
|
14665
|
-
_createClass$
|
|
14665
|
+
_createClass$m(TransferCost2, [{
|
|
14666
14666
|
key: "set",
|
|
14667
14667
|
value: function set5(event, value2) {
|
|
14668
14668
|
this["_".concat(event)] = value2;
|
|
@@ -14701,7 +14701,7 @@ var logger$b = new Logger$b("BufferService");
|
|
|
14701
14701
|
var BufferService$1 = /* @__PURE__ */ function() {
|
|
14702
14702
|
function BufferService2(flv, softVideo) {
|
|
14703
14703
|
var opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
14704
|
-
_classCallCheck$
|
|
14704
|
+
_classCallCheck$m(this, BufferService2);
|
|
14705
14705
|
_defineProperty$j(this, "flv", null);
|
|
14706
14706
|
_defineProperty$j(this, "_demuxer", new FlvDemuxer());
|
|
14707
14707
|
_defineProperty$j(this, "_remuxer", null);
|
|
@@ -14727,7 +14727,7 @@ var BufferService$1 = /* @__PURE__ */ function() {
|
|
|
14727
14727
|
this._mse.bindMedia(flv.media);
|
|
14728
14728
|
}
|
|
14729
14729
|
}
|
|
14730
|
-
_createClass$
|
|
14730
|
+
_createClass$m(BufferService2, [{
|
|
14731
14731
|
key: "baseDts",
|
|
14732
14732
|
get: function get3() {
|
|
14733
14733
|
var _this$_demuxer, _this$_demuxer$_fixer;
|
|
@@ -15315,7 +15315,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
15315
15315
|
var _super = _createSuper$g(Flv2);
|
|
15316
15316
|
function Flv2(_opts) {
|
|
15317
15317
|
var _this;
|
|
15318
|
-
_classCallCheck$
|
|
15318
|
+
_classCallCheck$m(this, Flv2);
|
|
15319
15319
|
_this = _super.call(this);
|
|
15320
15320
|
_defineProperty$j(_assertThisInitialized$h(_this), "media", null);
|
|
15321
15321
|
_defineProperty$j(_assertThisInitialized$h(_this), "_loading", false);
|
|
@@ -15658,7 +15658,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
15658
15658
|
_this.on(EVENT$3.FLV_SCRIPT_DATA, _this._onFlvScriptData);
|
|
15659
15659
|
return _this;
|
|
15660
15660
|
}
|
|
15661
|
-
_createClass$
|
|
15661
|
+
_createClass$m(Flv2, [{
|
|
15662
15662
|
key: "version",
|
|
15663
15663
|
get: function get3() {
|
|
15664
15664
|
return "3.0.21-rc.21";
|
|
@@ -16095,7 +16095,7 @@ try {
|
|
|
16095
16095
|
var PluginExtension$1 = /* @__PURE__ */ function() {
|
|
16096
16096
|
function PluginExtension2(opts, plugin2) {
|
|
16097
16097
|
var _this = this;
|
|
16098
|
-
_classCallCheck$
|
|
16098
|
+
_classCallCheck$m(this, PluginExtension2);
|
|
16099
16099
|
_defineProperty$j(this, "_onLowDecode", function() {
|
|
16100
16100
|
var _this$_plugin, _this$_plugin$player, _this$_plugin2, _this$_plugin2$player;
|
|
16101
16101
|
var _this$_opts = _this._opts, media = _this$_opts.media, innerDegrade = _this$_opts.innerDegrade, backupURL = _this$_opts.backupURL;
|
|
@@ -16138,7 +16138,7 @@ var PluginExtension$1 = /* @__PURE__ */ function() {
|
|
|
16138
16138
|
this._plugin = plugin2;
|
|
16139
16139
|
this._init();
|
|
16140
16140
|
}
|
|
16141
|
-
_createClass$
|
|
16141
|
+
_createClass$m(PluginExtension2, [{
|
|
16142
16142
|
key: "_init",
|
|
16143
16143
|
value: function _init() {
|
|
16144
16144
|
var _this$_opts2 = this._opts, media = _this$_opts2.media, isLive = _this$_opts2.isLive, preloadTime = _this$_opts2.preloadTime, innerDegrade = _this$_opts2.innerDegrade, decodeMode = _this$_opts2.decodeMode;
|
|
@@ -16180,7 +16180,7 @@ var FlvPlugin$1 = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
16180
16180
|
var _super = _createSuper$g(FlvPlugin2);
|
|
16181
16181
|
function FlvPlugin2() {
|
|
16182
16182
|
var _this;
|
|
16183
|
-
_classCallCheck$
|
|
16183
|
+
_classCallCheck$m(this, FlvPlugin2);
|
|
16184
16184
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
16185
16185
|
args[_key] = arguments[_key];
|
|
16186
16186
|
}
|
|
@@ -16229,7 +16229,7 @@ var FlvPlugin$1 = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
16229
16229
|
});
|
|
16230
16230
|
return _this;
|
|
16231
16231
|
}
|
|
16232
|
-
_createClass$
|
|
16232
|
+
_createClass$m(FlvPlugin2, [{
|
|
16233
16233
|
key: "core",
|
|
16234
16234
|
get: function get3() {
|
|
16235
16235
|
return this.flv;
|
|
@@ -16394,7 +16394,7 @@ function _isNativeReflectConstruct$d() {
|
|
|
16394
16394
|
return !!t2;
|
|
16395
16395
|
})();
|
|
16396
16396
|
}
|
|
16397
|
-
function _toPrimitive$
|
|
16397
|
+
function _toPrimitive$8(t2, r2) {
|
|
16398
16398
|
if ("object" != typeof t2 || !t2)
|
|
16399
16399
|
return t2;
|
|
16400
16400
|
var e4 = t2[Symbol.toPrimitive];
|
|
@@ -16406,8 +16406,8 @@ function _toPrimitive$7(t2, r2) {
|
|
|
16406
16406
|
}
|
|
16407
16407
|
return ("string" === r2 ? String : Number)(t2);
|
|
16408
16408
|
}
|
|
16409
|
-
function _toPropertyKey$
|
|
16410
|
-
var i2 = _toPrimitive$
|
|
16409
|
+
function _toPropertyKey$8(t2) {
|
|
16410
|
+
var i2 = _toPrimitive$8(t2, "string");
|
|
16411
16411
|
return "symbol" == typeof i2 ? i2 : String(i2);
|
|
16412
16412
|
}
|
|
16413
16413
|
function _typeof$9(o2) {
|
|
@@ -16418,33 +16418,33 @@ function _typeof$9(o2) {
|
|
|
16418
16418
|
return o22 && "function" == typeof Symbol && o22.constructor === Symbol && o22 !== Symbol.prototype ? "symbol" : typeof o22;
|
|
16419
16419
|
}, _typeof$9(o2);
|
|
16420
16420
|
}
|
|
16421
|
-
function _classCallCheck$
|
|
16421
|
+
function _classCallCheck$i(instance, Constructor2) {
|
|
16422
16422
|
if (!(instance instanceof Constructor2)) {
|
|
16423
16423
|
throw new TypeError("Cannot call a class as a function");
|
|
16424
16424
|
}
|
|
16425
16425
|
}
|
|
16426
|
-
function _defineProperties$
|
|
16426
|
+
function _defineProperties$i(target, props) {
|
|
16427
16427
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
16428
16428
|
var descriptor = props[i2];
|
|
16429
16429
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
16430
16430
|
descriptor.configurable = true;
|
|
16431
16431
|
if ("value" in descriptor)
|
|
16432
16432
|
descriptor.writable = true;
|
|
16433
|
-
Object.defineProperty(target, _toPropertyKey$
|
|
16433
|
+
Object.defineProperty(target, _toPropertyKey$8(descriptor.key), descriptor);
|
|
16434
16434
|
}
|
|
16435
16435
|
}
|
|
16436
|
-
function _createClass$
|
|
16436
|
+
function _createClass$i(Constructor2, protoProps, staticProps) {
|
|
16437
16437
|
if (protoProps)
|
|
16438
|
-
_defineProperties$
|
|
16438
|
+
_defineProperties$i(Constructor2.prototype, protoProps);
|
|
16439
16439
|
if (staticProps)
|
|
16440
|
-
_defineProperties$
|
|
16440
|
+
_defineProperties$i(Constructor2, staticProps);
|
|
16441
16441
|
Object.defineProperty(Constructor2, "prototype", {
|
|
16442
16442
|
writable: false
|
|
16443
16443
|
});
|
|
16444
16444
|
return Constructor2;
|
|
16445
16445
|
}
|
|
16446
16446
|
function _defineProperty$f(obj, key2, value2) {
|
|
16447
|
-
key2 = _toPropertyKey$
|
|
16447
|
+
key2 = _toPropertyKey$8(key2);
|
|
16448
16448
|
if (key2 in obj) {
|
|
16449
16449
|
Object.defineProperty(obj, key2, {
|
|
16450
16450
|
value: value2,
|
|
@@ -29246,12 +29246,12 @@ var abrAlgo = function() {
|
|
|
29246
29246
|
}();
|
|
29247
29247
|
var Algo = /* @__PURE__ */ function() {
|
|
29248
29248
|
function Algo2(player, config, openTimeMs) {
|
|
29249
|
-
_classCallCheck$
|
|
29249
|
+
_classCallCheck$i(this, Algo2);
|
|
29250
29250
|
this.initParamers(player, config);
|
|
29251
29251
|
this._openTimeMs = openTimeMs;
|
|
29252
29252
|
this.resetCollect();
|
|
29253
29253
|
}
|
|
29254
|
-
_createClass$
|
|
29254
|
+
_createClass$i(Algo2, [{
|
|
29255
29255
|
key: "bitrates",
|
|
29256
29256
|
get: function get3() {
|
|
29257
29257
|
return this._bitrates;
|
|
@@ -29439,7 +29439,7 @@ var Abr$1 = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
29439
29439
|
_inherits$d(Abr2, _BasePlugin);
|
|
29440
29440
|
function Abr2(config) {
|
|
29441
29441
|
var _this;
|
|
29442
|
-
_classCallCheck$
|
|
29442
|
+
_classCallCheck$i(this, Abr2);
|
|
29443
29443
|
_this = _callSuper(this, Abr2, [config]);
|
|
29444
29444
|
_defineProperty$f(_assertThisInitialized$d(_this), "successSwitch", function(info) {
|
|
29445
29445
|
var eventName = info.eventName, url = info.url;
|
|
@@ -29488,7 +29488,7 @@ var Abr$1 = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
29488
29488
|
_this.stallStartTime = 0;
|
|
29489
29489
|
return _this;
|
|
29490
29490
|
}
|
|
29491
|
-
_createClass$
|
|
29491
|
+
_createClass$i(Abr2, [{
|
|
29492
29492
|
key: "changeTime",
|
|
29493
29493
|
get: function get3() {
|
|
29494
29494
|
return this.algo && this.algo.changeTime;
|
|
@@ -29811,7 +29811,7 @@ var Abr = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
29811
29811
|
_inherits$d(Abr2, _BasePlugin);
|
|
29812
29812
|
function Abr2(config) {
|
|
29813
29813
|
var _this;
|
|
29814
|
-
_classCallCheck$
|
|
29814
|
+
_classCallCheck$i(this, Abr2);
|
|
29815
29815
|
_this = _callSuper(this, Abr2, [config]);
|
|
29816
29816
|
_defineProperty$f(_assertThisInitialized$d(_this), "handleCoreEvt", function(info) {
|
|
29817
29817
|
var eventName = info.eventName, playlist = info.playlist;
|
|
@@ -29886,7 +29886,7 @@ var Abr = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
29886
29886
|
_this.stallStartTime = 0;
|
|
29887
29887
|
return _this;
|
|
29888
29888
|
}
|
|
29889
|
-
_createClass$
|
|
29889
|
+
_createClass$i(Abr2, [{
|
|
29890
29890
|
key: "changeTime",
|
|
29891
29891
|
get: function get3() {
|
|
29892
29892
|
return this.algo && this.algo.changeTime;
|
|
@@ -30157,10 +30157,10 @@ var Abr = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
30157
30157
|
var Adaptive = /* @__PURE__ */ function(_BasePlugin) {
|
|
30158
30158
|
_inherits$d(Adaptive2, _BasePlugin);
|
|
30159
30159
|
function Adaptive2() {
|
|
30160
|
-
_classCallCheck$
|
|
30160
|
+
_classCallCheck$i(this, Adaptive2);
|
|
30161
30161
|
return _callSuper(this, Adaptive2, arguments);
|
|
30162
30162
|
}
|
|
30163
|
-
_createClass$
|
|
30163
|
+
_createClass$i(Adaptive2, [{
|
|
30164
30164
|
key: "afterCreate",
|
|
30165
30165
|
value: function afterCreate() {
|
|
30166
30166
|
this.on("timeupdate", this.onTimeUpdate.bind(this));
|
|
@@ -30603,33 +30603,33 @@ function _asyncToGenerator$9(fn) {
|
|
|
30603
30603
|
});
|
|
30604
30604
|
};
|
|
30605
30605
|
}
|
|
30606
|
-
function _classCallCheck$
|
|
30606
|
+
function _classCallCheck$h(instance, Constructor2) {
|
|
30607
30607
|
if (!(instance instanceof Constructor2)) {
|
|
30608
30608
|
throw new TypeError("Cannot call a class as a function");
|
|
30609
30609
|
}
|
|
30610
30610
|
}
|
|
30611
|
-
function _defineProperties$
|
|
30611
|
+
function _defineProperties$h(target, props) {
|
|
30612
30612
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
30613
30613
|
var descriptor = props[i2];
|
|
30614
30614
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
30615
30615
|
descriptor.configurable = true;
|
|
30616
30616
|
if ("value" in descriptor)
|
|
30617
30617
|
descriptor.writable = true;
|
|
30618
|
-
Object.defineProperty(target, _toPropertyKey$
|
|
30618
|
+
Object.defineProperty(target, _toPropertyKey$7(descriptor.key), descriptor);
|
|
30619
30619
|
}
|
|
30620
30620
|
}
|
|
30621
|
-
function _createClass$
|
|
30621
|
+
function _createClass$h(Constructor2, protoProps, staticProps) {
|
|
30622
30622
|
if (protoProps)
|
|
30623
|
-
_defineProperties$
|
|
30623
|
+
_defineProperties$h(Constructor2.prototype, protoProps);
|
|
30624
30624
|
if (staticProps)
|
|
30625
|
-
_defineProperties$
|
|
30625
|
+
_defineProperties$h(Constructor2, staticProps);
|
|
30626
30626
|
Object.defineProperty(Constructor2, "prototype", {
|
|
30627
30627
|
writable: false
|
|
30628
30628
|
});
|
|
30629
30629
|
return Constructor2;
|
|
30630
30630
|
}
|
|
30631
30631
|
function _defineProperty$e(obj, key2, value2) {
|
|
30632
|
-
key2 = _toPropertyKey$
|
|
30632
|
+
key2 = _toPropertyKey$7(key2);
|
|
30633
30633
|
if (key2 in obj) {
|
|
30634
30634
|
Object.defineProperty(obj, key2, {
|
|
30635
30635
|
value: value2,
|
|
@@ -30714,7 +30714,7 @@ function _createSuper$c(Derived) {
|
|
|
30714
30714
|
return _possibleConstructorReturn$c(this, result);
|
|
30715
30715
|
};
|
|
30716
30716
|
}
|
|
30717
|
-
function _toPrimitive$
|
|
30717
|
+
function _toPrimitive$7(input, hint) {
|
|
30718
30718
|
if (typeof input !== "object" || input === null)
|
|
30719
30719
|
return input;
|
|
30720
30720
|
var prim = input[Symbol.toPrimitive];
|
|
@@ -30726,8 +30726,8 @@ function _toPrimitive$6(input, hint) {
|
|
|
30726
30726
|
}
|
|
30727
30727
|
return (hint === "string" ? String : Number)(input);
|
|
30728
30728
|
}
|
|
30729
|
-
function _toPropertyKey$
|
|
30730
|
-
var key2 = _toPrimitive$
|
|
30729
|
+
function _toPropertyKey$7(arg) {
|
|
30730
|
+
var key2 = _toPrimitive$7(arg, "string");
|
|
30731
30731
|
return typeof key2 === "symbol" ? key2 : String(key2);
|
|
30732
30732
|
}
|
|
30733
30733
|
function ownKeys$b(object, enumerableOnly) {
|
|
@@ -31104,33 +31104,33 @@ function _asyncToGenerator$8(fn) {
|
|
|
31104
31104
|
});
|
|
31105
31105
|
};
|
|
31106
31106
|
}
|
|
31107
|
-
function _classCallCheck$
|
|
31107
|
+
function _classCallCheck$g(instance, Constructor2) {
|
|
31108
31108
|
if (!(instance instanceof Constructor2)) {
|
|
31109
31109
|
throw new TypeError("Cannot call a class as a function");
|
|
31110
31110
|
}
|
|
31111
31111
|
}
|
|
31112
|
-
function _defineProperties$
|
|
31112
|
+
function _defineProperties$g(target, props) {
|
|
31113
31113
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
31114
31114
|
var descriptor = props[i2];
|
|
31115
31115
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
31116
31116
|
descriptor.configurable = true;
|
|
31117
31117
|
if ("value" in descriptor)
|
|
31118
31118
|
descriptor.writable = true;
|
|
31119
|
-
Object.defineProperty(target, _toPropertyKey$
|
|
31119
|
+
Object.defineProperty(target, _toPropertyKey$6(descriptor.key), descriptor);
|
|
31120
31120
|
}
|
|
31121
31121
|
}
|
|
31122
|
-
function _createClass$
|
|
31122
|
+
function _createClass$g(Constructor2, protoProps, staticProps) {
|
|
31123
31123
|
if (protoProps)
|
|
31124
|
-
_defineProperties$
|
|
31124
|
+
_defineProperties$g(Constructor2.prototype, protoProps);
|
|
31125
31125
|
if (staticProps)
|
|
31126
|
-
_defineProperties$
|
|
31126
|
+
_defineProperties$g(Constructor2, staticProps);
|
|
31127
31127
|
Object.defineProperty(Constructor2, "prototype", {
|
|
31128
31128
|
writable: false
|
|
31129
31129
|
});
|
|
31130
31130
|
return Constructor2;
|
|
31131
31131
|
}
|
|
31132
31132
|
function _defineProperty$d(obj, key2, value2) {
|
|
31133
|
-
key2 = _toPropertyKey$
|
|
31133
|
+
key2 = _toPropertyKey$6(key2);
|
|
31134
31134
|
if (key2 in obj) {
|
|
31135
31135
|
Object.defineProperty(obj, key2, {
|
|
31136
31136
|
value: value2,
|
|
@@ -31393,7 +31393,7 @@ function _createForOfIteratorHelper$3(o2, allowArrayLike) {
|
|
|
31393
31393
|
}
|
|
31394
31394
|
};
|
|
31395
31395
|
}
|
|
31396
|
-
function _toPrimitive$
|
|
31396
|
+
function _toPrimitive$6(input, hint) {
|
|
31397
31397
|
if (typeof input !== "object" || input === null)
|
|
31398
31398
|
return input;
|
|
31399
31399
|
var prim = input[Symbol.toPrimitive];
|
|
@@ -31405,8 +31405,8 @@ function _toPrimitive$5(input, hint) {
|
|
|
31405
31405
|
}
|
|
31406
31406
|
return (hint === "string" ? String : Number)(input);
|
|
31407
31407
|
}
|
|
31408
|
-
function _toPropertyKey$
|
|
31409
|
-
var key2 = _toPrimitive$
|
|
31408
|
+
function _toPropertyKey$6(arg) {
|
|
31409
|
+
var key2 = _toPrimitive$6(arg, "string");
|
|
31410
31410
|
return typeof key2 === "symbol" ? key2 : String(key2);
|
|
31411
31411
|
}
|
|
31412
31412
|
function createPublicPromise$4() {
|
|
@@ -31505,7 +31505,7 @@ var StreamingError$2 = /* @__PURE__ */ function(_Error) {
|
|
|
31505
31505
|
var _super = _createSuper$b(StreamingError2);
|
|
31506
31506
|
function StreamingError2(type, subType, origin, payload, msg) {
|
|
31507
31507
|
var _this;
|
|
31508
|
-
_classCallCheck$
|
|
31508
|
+
_classCallCheck$g(this, StreamingError2);
|
|
31509
31509
|
_this = _super.call(this, msg || (origin === null || origin === void 0 ? void 0 : origin.message));
|
|
31510
31510
|
_this.errorType = type === ERR$2.NETWORK_TIMEOUT ? ERR$2.NETWORK : type;
|
|
31511
31511
|
_this.originError = origin;
|
|
@@ -31518,7 +31518,7 @@ var StreamingError$2 = /* @__PURE__ */ function(_Error) {
|
|
|
31518
31518
|
}
|
|
31519
31519
|
return _this;
|
|
31520
31520
|
}
|
|
31521
|
-
_createClass$
|
|
31521
|
+
_createClass$g(StreamingError2, null, [{
|
|
31522
31522
|
key: "create",
|
|
31523
31523
|
value: function create5(type, subType, origin, payload, msg) {
|
|
31524
31524
|
if (type instanceof StreamingError2) {
|
|
@@ -31554,7 +31554,7 @@ var LOG_MAX_SIZE$2 = 200 * 1024;
|
|
|
31554
31554
|
var SIMPLE_TYPE$2 = ["Boolean", "Number", "String", "Undefined", "Null", "Date", "Object"];
|
|
31555
31555
|
var Logger$8 = /* @__PURE__ */ function() {
|
|
31556
31556
|
function Logger2(name, config) {
|
|
31557
|
-
_classCallCheck$
|
|
31557
|
+
_classCallCheck$g(this, Logger2);
|
|
31558
31558
|
this.name = name || "";
|
|
31559
31559
|
this._prefix = "[".concat(this.name, "]");
|
|
31560
31560
|
this.logCacheLevel = (config === null || config === void 0 ? void 0 : config.logCacheLevel) || 3;
|
|
@@ -31562,7 +31562,7 @@ var Logger$8 = /* @__PURE__ */ function() {
|
|
|
31562
31562
|
this.logSize = 0;
|
|
31563
31563
|
this.logTextArray = [];
|
|
31564
31564
|
}
|
|
31565
|
-
_createClass$
|
|
31565
|
+
_createClass$g(Logger2, [{
|
|
31566
31566
|
key: "debug",
|
|
31567
31567
|
value: function debug() {
|
|
31568
31568
|
var _console;
|
|
@@ -31740,7 +31740,7 @@ var NetError$2 = /* @__PURE__ */ function(_Error) {
|
|
|
31740
31740
|
var _super = _createSuper$b(NetError2);
|
|
31741
31741
|
function NetError2(url, request2, response, msg) {
|
|
31742
31742
|
var _this;
|
|
31743
|
-
_classCallCheck$
|
|
31743
|
+
_classCallCheck$g(this, NetError2);
|
|
31744
31744
|
_this = _super.call(this, msg);
|
|
31745
31745
|
_defineProperty$d(_assertThisInitialized$b(_this), "retryCount", 0);
|
|
31746
31746
|
_defineProperty$d(_assertThisInitialized$b(_this), "isTimeout", false);
|
|
@@ -31753,7 +31753,7 @@ var NetError$2 = /* @__PURE__ */ function(_Error) {
|
|
|
31753
31753
|
_this.response = response;
|
|
31754
31754
|
return _this;
|
|
31755
31755
|
}
|
|
31756
|
-
return _createClass$
|
|
31756
|
+
return _createClass$g(NetError2);
|
|
31757
31757
|
}(/* @__PURE__ */ _wrapNativeSuper$3(Error));
|
|
31758
31758
|
var toString$y = Object.prototype.toString;
|
|
31759
31759
|
function isObject$M(a2) {
|
|
@@ -31878,7 +31878,7 @@ var FetchLoader$2 = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
31878
31878
|
var _super = _createSuper$b(FetchLoader2);
|
|
31879
31879
|
function FetchLoader2() {
|
|
31880
31880
|
var _this;
|
|
31881
|
-
_classCallCheck$
|
|
31881
|
+
_classCallCheck$g(this, FetchLoader2);
|
|
31882
31882
|
_this = _super.call(this);
|
|
31883
31883
|
_defineProperty$d(_assertThisInitialized$b(_this), "_abortController", null);
|
|
31884
31884
|
_defineProperty$d(_assertThisInitialized$b(_this), "_timeoutTimer", null);
|
|
@@ -31896,7 +31896,7 @@ var FetchLoader$2 = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
31896
31896
|
_defineProperty$d(_assertThisInitialized$b(_this), "_priOptions", null);
|
|
31897
31897
|
return _this;
|
|
31898
31898
|
}
|
|
31899
|
-
_createClass$
|
|
31899
|
+
_createClass$g(FetchLoader2, [{
|
|
31900
31900
|
key: "load",
|
|
31901
31901
|
value: function load(_ref) {
|
|
31902
31902
|
var _this$_abortControlle, _this2 = this;
|
|
@@ -32330,7 +32330,7 @@ var XhrLoader$2 = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
32330
32330
|
var _super = _createSuper$b(XhrLoader2);
|
|
32331
32331
|
function XhrLoader2() {
|
|
32332
32332
|
var _this;
|
|
32333
|
-
_classCallCheck$
|
|
32333
|
+
_classCallCheck$g(this, XhrLoader2);
|
|
32334
32334
|
_this = _super.call(this);
|
|
32335
32335
|
_defineProperty$d(_assertThisInitialized$b(_this), "_xhr", null);
|
|
32336
32336
|
_defineProperty$d(_assertThisInitialized$b(_this), "_aborted", false);
|
|
@@ -32360,7 +32360,7 @@ var XhrLoader$2 = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
32360
32360
|
_defineProperty$d(_assertThisInitialized$b(_this), "_priOptions", null);
|
|
32361
32361
|
return _this;
|
|
32362
32362
|
}
|
|
32363
|
-
_createClass$
|
|
32363
|
+
_createClass$g(XhrLoader2, [{
|
|
32364
32364
|
key: "load",
|
|
32365
32365
|
value: function load(req) {
|
|
32366
32366
|
var _this2 = this;
|
|
@@ -32645,7 +32645,7 @@ var XhrLoader$2 = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
32645
32645
|
var _excluded$5 = ["retry", "retryDelay", "onRetryError", "transformError"];
|
|
32646
32646
|
var Task$2 = /* @__PURE__ */ function() {
|
|
32647
32647
|
function Task2(type, config) {
|
|
32648
|
-
_classCallCheck$
|
|
32648
|
+
_classCallCheck$g(this, Task2);
|
|
32649
32649
|
this.promise = createPublicPromise$4();
|
|
32650
32650
|
this.alive = !!config.onProgress;
|
|
32651
32651
|
!config.logger && (config.logger = new Logger$8("Loader"));
|
|
@@ -32658,7 +32658,7 @@ var Task$2 = /* @__PURE__ */ function() {
|
|
|
32658
32658
|
this._retryCheckFunc = config.retryCheckFunc;
|
|
32659
32659
|
this._logger = config.logger;
|
|
32660
32660
|
}
|
|
32661
|
-
_createClass$
|
|
32661
|
+
_createClass$g(Task2, [{
|
|
32662
32662
|
key: "exec",
|
|
32663
32663
|
value: function exec2() {
|
|
32664
32664
|
var _this = this;
|
|
@@ -32777,7 +32777,7 @@ var NetLoader$2 = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
32777
32777
|
var _super = _createSuper$b(NetLoader2);
|
|
32778
32778
|
function NetLoader2(cfg) {
|
|
32779
32779
|
var _this;
|
|
32780
|
-
_classCallCheck$
|
|
32780
|
+
_classCallCheck$g(this, NetLoader2);
|
|
32781
32781
|
_this = _super.call(this, cfg);
|
|
32782
32782
|
_defineProperty$d(_assertThisInitialized$b(_this), "type", LoaderType$2.FETCH);
|
|
32783
32783
|
_defineProperty$d(_assertThisInitialized$b(_this), "_queue", []);
|
|
@@ -32792,7 +32792,7 @@ var NetLoader$2 = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
32792
32792
|
_this.log = cfg.logger;
|
|
32793
32793
|
return _this;
|
|
32794
32794
|
}
|
|
32795
|
-
_createClass$
|
|
32795
|
+
_createClass$g(NetLoader2, [{
|
|
32796
32796
|
key: "isFetch",
|
|
32797
32797
|
value: function isFetch() {
|
|
32798
32798
|
return this.type === LoaderType$2.FETCH;
|
|
@@ -33586,7 +33586,9 @@ function getOption(opts) {
|
|
|
33586
33586
|
networkEvaluateInterval: 1e3,
|
|
33587
33587
|
delayHint: 0,
|
|
33588
33588
|
seamlesslyReload: false,
|
|
33589
|
-
|
|
33589
|
+
enableSei: false,
|
|
33590
|
+
enableOriginSdpLogger: false,
|
|
33591
|
+
checkStatsErrorDelay: 5e3
|
|
33590
33592
|
}, opts);
|
|
33591
33593
|
}
|
|
33592
33594
|
function _getStats(stats) {
|
|
@@ -33601,10 +33603,11 @@ function _getStats(stats) {
|
|
|
33601
33603
|
}
|
|
33602
33604
|
});
|
|
33603
33605
|
return inboundRtps.map(function(inbound) {
|
|
33606
|
+
var _inbound$mediaType;
|
|
33604
33607
|
var codec = stats.get(inbound.codecId);
|
|
33605
33608
|
var track = stats.get(inbound.trackId);
|
|
33606
33609
|
return {
|
|
33607
|
-
type: inbound.mediaType,
|
|
33610
|
+
type: (_inbound$mediaType = inbound.mediaType) !== null && _inbound$mediaType !== void 0 ? _inbound$mediaType : inbound.kind,
|
|
33608
33611
|
inboundRtp: inbound,
|
|
33609
33612
|
remoteOutBoundRtp: remoteOutboundRtps.find(function(x2) {
|
|
33610
33613
|
return x2.mediaType === inbound.mediaType;
|
|
@@ -33624,7 +33627,7 @@ function getStats(pc) {
|
|
|
33624
33627
|
});
|
|
33625
33628
|
}
|
|
33626
33629
|
function getStatsSnapshoot(stats) {
|
|
33627
|
-
var _v$
|
|
33630
|
+
var _v$inboundRtp, _v$codec, _v$codec2, _v$codec3, _v$inboundRtp4, _v$inboundRtp5, _v$inboundRtp6, _v$inboundRtp7, _v$inboundRtp8, _v$inboundRtp9, _v$inboundRtp10, _v$inboundRtp11, _v$inboundRtp$framesR, _v$inboundRtp12, _v$track, _v$inboundRtp13, _v$inboundRtp14, _v$inboundRtp15, _v$inboundRtp16, _v$inboundRtp17, _v$inboundRtp18, _a$codec, _a$codec2, _a$codec3, _a$inboundRtp, _a$inboundRtp2, _a$inboundRtp3, _a$inboundRtp4, _a$inboundRtp5, _a$inboundRtp6, _a$inboundRtp7, _a$inboundRtp8;
|
|
33628
33631
|
var v2 = stats === null || stats === void 0 ? void 0 : stats.filter(function(x2) {
|
|
33629
33632
|
return x2.type === "video";
|
|
33630
33633
|
})[0];
|
|
@@ -33633,6 +33636,7 @@ function getStatsSnapshoot(stats) {
|
|
|
33633
33636
|
})[0];
|
|
33634
33637
|
var videoRemote;
|
|
33635
33638
|
var audioRemote;
|
|
33639
|
+
var averageJitterBufferDelay;
|
|
33636
33640
|
if (v2 && v2.remoteOutBoundRtp) {
|
|
33637
33641
|
videoRemote = {
|
|
33638
33642
|
bytesSent: v2.remoteOutBoundRtp.bytesSent,
|
|
@@ -33645,26 +33649,31 @@ function getStatsSnapshoot(stats) {
|
|
|
33645
33649
|
packetsSent: a2.remoteOutBoundRtp.packetsSent
|
|
33646
33650
|
};
|
|
33647
33651
|
}
|
|
33652
|
+
if ((v2 === null || v2 === void 0 ? void 0 : (_v$inboundRtp = v2.inboundRtp) === null || _v$inboundRtp === void 0 ? void 0 : _v$inboundRtp.jitterBufferDelay) !== void 0) {
|
|
33653
|
+
var _v$inboundRtp2, _v$inboundRtp3;
|
|
33654
|
+
averageJitterBufferDelay = ((_v$inboundRtp2 = v2.inboundRtp) === null || _v$inboundRtp2 === void 0 ? void 0 : _v$inboundRtp2.jitterBufferDelay) / ((_v$inboundRtp3 = v2.inboundRtp) === null || _v$inboundRtp3 === void 0 ? void 0 : _v$inboundRtp3.jitterBufferEmittedCount) * 1e3;
|
|
33655
|
+
}
|
|
33648
33656
|
return {
|
|
33649
33657
|
video: !v2 ? void 0 : {
|
|
33650
33658
|
codec: (_v$codec = v2.codec) === null || _v$codec === void 0 ? void 0 : _v$codec.mimeType,
|
|
33651
33659
|
payloadType: (_v$codec2 = v2.codec) === null || _v$codec2 === void 0 ? void 0 : _v$codec2.payloadType,
|
|
33652
33660
|
sdpFmtpLine: (_v$codec3 = v2.codec) === null || _v$codec3 === void 0 ? void 0 : _v$codec3.sdpFmtpLine,
|
|
33653
|
-
bytesReceived: ((_v$
|
|
33654
|
-
firCount: (_v$
|
|
33655
|
-
pliCount: (_v$
|
|
33656
|
-
frameHeight: (_v$
|
|
33657
|
-
frameWidth: (_v$
|
|
33658
|
-
framesDecoded: (_v$
|
|
33659
|
-
framesDropped: (_v$
|
|
33660
|
-
framesPerSecond: (_v$
|
|
33661
|
-
framesReceived: (_v$
|
|
33662
|
-
jitter: (_v$
|
|
33663
|
-
jitterBufferDelay: (_v$
|
|
33664
|
-
keyFramesDecoded: (_v$
|
|
33665
|
-
nackCount: (_v$
|
|
33666
|
-
packetsLost: ((_v$
|
|
33667
|
-
packetsReceived: ((_v$
|
|
33661
|
+
bytesReceived: ((_v$inboundRtp4 = v2.inboundRtp) === null || _v$inboundRtp4 === void 0 ? void 0 : _v$inboundRtp4.bytesReceived) || 0,
|
|
33662
|
+
firCount: (_v$inboundRtp5 = v2.inboundRtp) === null || _v$inboundRtp5 === void 0 ? void 0 : _v$inboundRtp5.firCount,
|
|
33663
|
+
pliCount: (_v$inboundRtp6 = v2.inboundRtp) === null || _v$inboundRtp6 === void 0 ? void 0 : _v$inboundRtp6.pliCount,
|
|
33664
|
+
frameHeight: (_v$inboundRtp7 = v2.inboundRtp) === null || _v$inboundRtp7 === void 0 ? void 0 : _v$inboundRtp7.frameHeight,
|
|
33665
|
+
frameWidth: (_v$inboundRtp8 = v2.inboundRtp) === null || _v$inboundRtp8 === void 0 ? void 0 : _v$inboundRtp8.frameWidth,
|
|
33666
|
+
framesDecoded: (_v$inboundRtp9 = v2.inboundRtp) === null || _v$inboundRtp9 === void 0 ? void 0 : _v$inboundRtp9.framesDecoded,
|
|
33667
|
+
framesDropped: (_v$inboundRtp10 = v2.inboundRtp) === null || _v$inboundRtp10 === void 0 ? void 0 : _v$inboundRtp10.framesDropped,
|
|
33668
|
+
framesPerSecond: (_v$inboundRtp11 = v2.inboundRtp) === null || _v$inboundRtp11 === void 0 ? void 0 : _v$inboundRtp11.framesPerSecond,
|
|
33669
|
+
framesReceived: (_v$inboundRtp$framesR = (_v$inboundRtp12 = v2.inboundRtp) === null || _v$inboundRtp12 === void 0 ? void 0 : _v$inboundRtp12.framesReceived) !== null && _v$inboundRtp$framesR !== void 0 ? _v$inboundRtp$framesR : (_v$track = v2.track) === null || _v$track === void 0 ? void 0 : _v$track.framesReceived,
|
|
33670
|
+
jitter: (_v$inboundRtp13 = v2.inboundRtp) === null || _v$inboundRtp13 === void 0 ? void 0 : _v$inboundRtp13.jitter,
|
|
33671
|
+
jitterBufferDelay: (_v$inboundRtp14 = v2.inboundRtp) === null || _v$inboundRtp14 === void 0 ? void 0 : _v$inboundRtp14.jitterBufferDelay,
|
|
33672
|
+
keyFramesDecoded: (_v$inboundRtp15 = v2.inboundRtp) === null || _v$inboundRtp15 === void 0 ? void 0 : _v$inboundRtp15.keyFramesDecoded,
|
|
33673
|
+
nackCount: (_v$inboundRtp16 = v2.inboundRtp) === null || _v$inboundRtp16 === void 0 ? void 0 : _v$inboundRtp16.nackCount,
|
|
33674
|
+
packetsLost: ((_v$inboundRtp17 = v2.inboundRtp) === null || _v$inboundRtp17 === void 0 ? void 0 : _v$inboundRtp17.packetsLost) || 0,
|
|
33675
|
+
packetsReceived: ((_v$inboundRtp18 = v2.inboundRtp) === null || _v$inboundRtp18 === void 0 ? void 0 : _v$inboundRtp18.packetsReceived) || 0,
|
|
33676
|
+
averageJitterBufferDelay
|
|
33668
33677
|
},
|
|
33669
33678
|
audio: !a2 ? void 0 : {
|
|
33670
33679
|
codec: (_a$codec = a2.codec) === null || _a$codec === void 0 ? void 0 : _a$codec.mimeType,
|
|
@@ -33687,7 +33696,7 @@ var QUEUE_SIZE = 5;
|
|
|
33687
33696
|
var NetworkEvaluate = /* @__PURE__ */ function() {
|
|
33688
33697
|
function NetworkEvaluate2(pc, interval) {
|
|
33689
33698
|
var _this = this;
|
|
33690
|
-
_classCallCheck$
|
|
33699
|
+
_classCallCheck$h(this, NetworkEvaluate2);
|
|
33691
33700
|
_defineProperty$e(this, "_pc", null);
|
|
33692
33701
|
_defineProperty$e(this, "_lastVideoStats", null);
|
|
33693
33702
|
_defineProperty$e(this, "_lastRemoteVideoStats", null);
|
|
@@ -33750,7 +33759,7 @@ var NetworkEvaluate = /* @__PURE__ */ function() {
|
|
|
33750
33759
|
this._timerInterval = interval;
|
|
33751
33760
|
this.start(interval);
|
|
33752
33761
|
}
|
|
33753
|
-
_createClass$
|
|
33762
|
+
_createClass$h(NetworkEvaluate2, [{
|
|
33754
33763
|
key: "start",
|
|
33755
33764
|
value: function start(interval) {
|
|
33756
33765
|
clearInterval(this._timer);
|
|
@@ -33836,13 +33845,640 @@ var NetworkEvaluate = /* @__PURE__ */ function() {
|
|
|
33836
33845
|
}]);
|
|
33837
33846
|
return NetworkEvaluate2;
|
|
33838
33847
|
}();
|
|
33848
|
+
function isSupported$1() {
|
|
33849
|
+
if (!window.RTCPeerConnection || !window.RTCPeerConnection.prototype.addTransceiver) {
|
|
33850
|
+
return false;
|
|
33851
|
+
}
|
|
33852
|
+
return true;
|
|
33853
|
+
}
|
|
33854
|
+
function getCapacity() {
|
|
33855
|
+
if (!isSupported$1())
|
|
33856
|
+
return Promise.reject("RTCPeerConnection no support");
|
|
33857
|
+
var pc;
|
|
33858
|
+
try {
|
|
33859
|
+
pc = new RTCPeerConnection();
|
|
33860
|
+
pc.addTransceiver("video", {
|
|
33861
|
+
direction: "recvonly"
|
|
33862
|
+
});
|
|
33863
|
+
pc.addTransceiver("audio", {
|
|
33864
|
+
direction: "recvonly"
|
|
33865
|
+
});
|
|
33866
|
+
} catch (e4) {
|
|
33867
|
+
return Promise.reject(e4 === null || e4 === void 0 ? void 0 : e4.message);
|
|
33868
|
+
}
|
|
33869
|
+
return pc.createOffer().then(function(offer) {
|
|
33870
|
+
var _sdpJson$media, _sdpJson$media2, _vMedia$rtp, _aMedia$rtp;
|
|
33871
|
+
logger$9.log(offer.sdp);
|
|
33872
|
+
var sdpJson = lib$1.parse(offer.sdp);
|
|
33873
|
+
var vMedia = (_sdpJson$media = sdpJson.media) === null || _sdpJson$media === void 0 ? void 0 : _sdpJson$media.filter(function(x2) {
|
|
33874
|
+
return x2.type === "video";
|
|
33875
|
+
})[0];
|
|
33876
|
+
var aMedia = (_sdpJson$media2 = sdpJson.media) === null || _sdpJson$media2 === void 0 ? void 0 : _sdpJson$media2.filter(function(x2) {
|
|
33877
|
+
return x2.type === "audio";
|
|
33878
|
+
})[0];
|
|
33879
|
+
var vCodecs = vMedia === null || vMedia === void 0 ? void 0 : (_vMedia$rtp = vMedia.rtp) === null || _vMedia$rtp === void 0 ? void 0 : _vMedia$rtp.filter(function(x2) {
|
|
33880
|
+
return x2.codec === "VP8" || x2.codec === "VP9" || x2.codec === "H264";
|
|
33881
|
+
});
|
|
33882
|
+
var aCodecs = aMedia === null || aMedia === void 0 ? void 0 : (_aMedia$rtp = aMedia.rtp) === null || _aMedia$rtp === void 0 ? void 0 : _aMedia$rtp.filter(function(x2) {
|
|
33883
|
+
return x2.codec === "opus";
|
|
33884
|
+
});
|
|
33885
|
+
var vFmtp = vMedia === null || vMedia === void 0 ? void 0 : vMedia.fmtp;
|
|
33886
|
+
var aFmtp = aMedia === null || aMedia === void 0 ? void 0 : aMedia.fmtp;
|
|
33887
|
+
vFmtp && vCodecs.map(function(codec) {
|
|
33888
|
+
var _vFmtp$filter$;
|
|
33889
|
+
codec.config = (_vFmtp$filter$ = vFmtp.filter(function(x2) {
|
|
33890
|
+
return x2.payload === codec.payload;
|
|
33891
|
+
})[0]) === null || _vFmtp$filter$ === void 0 ? void 0 : _vFmtp$filter$.config;
|
|
33892
|
+
});
|
|
33893
|
+
aFmtp && aCodecs.map(function(codec) {
|
|
33894
|
+
var _aFmtp$filter$;
|
|
33895
|
+
codec.config = (_aFmtp$filter$ = aFmtp.filter(function(x2) {
|
|
33896
|
+
return x2.payload === codec.payload;
|
|
33897
|
+
})[0]) === null || _aFmtp$filter$ === void 0 ? void 0 : _aFmtp$filter$.config;
|
|
33898
|
+
});
|
|
33899
|
+
pc.close();
|
|
33900
|
+
return {
|
|
33901
|
+
video: vCodecs,
|
|
33902
|
+
audio: aCodecs
|
|
33903
|
+
};
|
|
33904
|
+
});
|
|
33905
|
+
}
|
|
33906
|
+
var isEncodedTransformSupported = function isEncodedTransformSupported2() {
|
|
33907
|
+
return typeof TransformStream !== "undefined" && typeof RTCRtpSender !== "undefined" && typeof RTCRtpReceiver !== "undefined" && typeof RTCRtpScriptTransform !== "undefined" && "transform" in RTCRtpSender.prototype && "transform" in RTCRtpReceiver.prototype && isWorkerSupported() && isMessageChannelSupported();
|
|
33908
|
+
};
|
|
33909
|
+
var isWorkerSupported = function isWorkerSupported2() {
|
|
33910
|
+
return typeof window !== "undefined" && window.Worker;
|
|
33911
|
+
};
|
|
33912
|
+
var isMessageChannelSupported = function isMessageChannelSupported2() {
|
|
33913
|
+
return typeof MessageChannel !== "undefined";
|
|
33914
|
+
};
|
|
33915
|
+
var isLegacyEncodedTransformSupported = function isLegacyEncodedTransformSupported2() {
|
|
33916
|
+
return typeof TransformStream !== "undefined" && typeof RTCRtpSender !== "undefined" && typeof RTCRtpReceiver !== "undefined" && typeof RTCRtpSender.prototype.createEncodedStreams !== "undefined" && typeof RTCRtpReceiver.prototype.createEncodedStreams !== "undefined";
|
|
33917
|
+
};
|
|
33918
|
+
var Nalunit = {
|
|
33919
|
+
getNALUnits: function getNALUnits(buffer2) {
|
|
33920
|
+
var isH265 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
33921
|
+
if (buffer2.length - buffer2.position < 4) {
|
|
33922
|
+
return [];
|
|
33923
|
+
}
|
|
33924
|
+
var position = buffer2.position;
|
|
33925
|
+
if (buffer2.getInt32(position) === 1 || buffer2.getInt16(position) === 0 && buffer2.getInt8(position + 2) === 1) {
|
|
33926
|
+
return Nalunit.getAnnexbNals(buffer2, isH265);
|
|
33927
|
+
} else {
|
|
33928
|
+
return Nalunit.getAvccNals(buffer2, isH265);
|
|
33929
|
+
}
|
|
33930
|
+
},
|
|
33931
|
+
getAnnexbNals: function getAnnexbNals(buffer2, isH265) {
|
|
33932
|
+
var nals = [];
|
|
33933
|
+
var position = Nalunit.getHeaderPositionAnnexB(buffer2);
|
|
33934
|
+
var start = position.pos;
|
|
33935
|
+
var end = start;
|
|
33936
|
+
while (start < buffer2.length - 4) {
|
|
33937
|
+
var header = new Uint8Array(buffer2.buffer.slice(start, start + position.headerLength));
|
|
33938
|
+
if (position.pos === buffer2.position) {
|
|
33939
|
+
buffer2.skip(position.headerLength);
|
|
33940
|
+
}
|
|
33941
|
+
position = Nalunit.getHeaderPositionAnnexB(buffer2);
|
|
33942
|
+
end = position.pos;
|
|
33943
|
+
var body = new Uint8Array(buffer2.buffer.slice(start + header.byteLength, end));
|
|
33944
|
+
var unit = {
|
|
33945
|
+
header,
|
|
33946
|
+
body,
|
|
33947
|
+
type: -1
|
|
33948
|
+
};
|
|
33949
|
+
isH265 ? Nalunit.analyseH265Nal(unit) : Nalunit.analyseNal(unit);
|
|
33950
|
+
if ((unit.type <= 9 || isH265 && unit.type <= 40) && unit.type !== 0) {
|
|
33951
|
+
nals.push(unit);
|
|
33952
|
+
}
|
|
33953
|
+
buffer2.skip(end - buffer2.position);
|
|
33954
|
+
start = end;
|
|
33955
|
+
}
|
|
33956
|
+
return nals;
|
|
33957
|
+
},
|
|
33958
|
+
getAvccNals: function getAvccNals(buffer2, isH265) {
|
|
33959
|
+
var nals = [];
|
|
33960
|
+
while (buffer2.position < buffer2.length - 4) {
|
|
33961
|
+
var length = buffer2.getInt32(buffer2.position);
|
|
33962
|
+
if (buffer2.length - buffer2.position >= length) {
|
|
33963
|
+
var header = new Uint8Array(buffer2.buffer.slice(buffer2.position, buffer2.position + 4));
|
|
33964
|
+
buffer2.skip(4);
|
|
33965
|
+
var body = new Uint8Array(buffer2.buffer.slice(buffer2.position, buffer2.position + length));
|
|
33966
|
+
buffer2.skip(length);
|
|
33967
|
+
var unit = {
|
|
33968
|
+
header,
|
|
33969
|
+
body,
|
|
33970
|
+
type: -1
|
|
33971
|
+
};
|
|
33972
|
+
isH265 ? Nalunit.analyseH265Nal(unit) : Nalunit.analyseNal(unit);
|
|
33973
|
+
if (unit.type <= 9 && unit.type !== 0) {
|
|
33974
|
+
nals.push(unit);
|
|
33975
|
+
}
|
|
33976
|
+
} else {
|
|
33977
|
+
break;
|
|
33978
|
+
}
|
|
33979
|
+
}
|
|
33980
|
+
return nals;
|
|
33981
|
+
},
|
|
33982
|
+
analyseNal: function analyseNal(unit) {
|
|
33983
|
+
var type = unit.body[0] & 31;
|
|
33984
|
+
unit.type = type;
|
|
33985
|
+
switch (type) {
|
|
33986
|
+
case 1:
|
|
33987
|
+
unit.ndr = true;
|
|
33988
|
+
break;
|
|
33989
|
+
case 5:
|
|
33990
|
+
unit.idr = true;
|
|
33991
|
+
break;
|
|
33992
|
+
case 6:
|
|
33993
|
+
unit.sei = true;
|
|
33994
|
+
break;
|
|
33995
|
+
case 7:
|
|
33996
|
+
unit.sps = true;
|
|
33997
|
+
break;
|
|
33998
|
+
case 8:
|
|
33999
|
+
unit.pps = true;
|
|
34000
|
+
break;
|
|
34001
|
+
}
|
|
34002
|
+
},
|
|
34003
|
+
analyseH265Nal: function analyseH265Nal(unit) {
|
|
34004
|
+
var type = (unit.body[0] & 126) >> 1;
|
|
34005
|
+
unit.type = type;
|
|
34006
|
+
switch (type) {
|
|
34007
|
+
case 39:
|
|
34008
|
+
case 40:
|
|
34009
|
+
unit.sei = true;
|
|
34010
|
+
break;
|
|
34011
|
+
}
|
|
34012
|
+
},
|
|
34013
|
+
getHeaderPositionAnnexB: function getHeaderPositionAnnexB(buffer2) {
|
|
34014
|
+
var pos = buffer2.position;
|
|
34015
|
+
var headerLength = 0;
|
|
34016
|
+
var bufferLen = buffer2.length;
|
|
34017
|
+
while (headerLength !== 3 && headerLength !== 4 && pos < bufferLen - 4) {
|
|
34018
|
+
if (buffer2.getInt16(pos) === 0) {
|
|
34019
|
+
if (buffer2.getInt16(pos + 2) === 1) {
|
|
34020
|
+
headerLength = 4;
|
|
34021
|
+
} else if (buffer2.getInt8(pos + 2) === 1) {
|
|
34022
|
+
headerLength = 3;
|
|
34023
|
+
} else {
|
|
34024
|
+
pos++;
|
|
34025
|
+
}
|
|
34026
|
+
} else {
|
|
34027
|
+
pos++;
|
|
34028
|
+
}
|
|
34029
|
+
}
|
|
34030
|
+
if (pos === bufferLen - 4) {
|
|
34031
|
+
if (buffer2.getInt16(pos) === 0) {
|
|
34032
|
+
if (buffer2.getInt16(pos + 2) === 1) {
|
|
34033
|
+
headerLength = 4;
|
|
34034
|
+
} else {
|
|
34035
|
+
pos = bufferLen;
|
|
34036
|
+
}
|
|
34037
|
+
} else {
|
|
34038
|
+
pos++;
|
|
34039
|
+
if (buffer2.getInt16(pos) === 0 && buffer2.getInt8(pos) === 1) {
|
|
34040
|
+
headerLength = 3;
|
|
34041
|
+
} else {
|
|
34042
|
+
pos = bufferLen;
|
|
34043
|
+
}
|
|
34044
|
+
}
|
|
34045
|
+
}
|
|
34046
|
+
return {
|
|
34047
|
+
pos,
|
|
34048
|
+
headerLength
|
|
34049
|
+
};
|
|
34050
|
+
},
|
|
34051
|
+
isH265VideoFrame: function isH265VideoFrame(chunk) {
|
|
34052
|
+
var _chunk$getMetadata, _chunk$getMetadata$ca;
|
|
34053
|
+
return (((_chunk$getMetadata = chunk.getMetadata) === null || _chunk$getMetadata === void 0 ? void 0 : (_chunk$getMetadata$ca = _chunk$getMetadata.call(chunk)) === null || _chunk$getMetadata$ca === void 0 ? void 0 : _chunk$getMetadata$ca.mimeType) || "").toLowerCase().includes("h265");
|
|
34054
|
+
}
|
|
34055
|
+
};
|
|
34056
|
+
var RTCDataView = /* @__PURE__ */ function() {
|
|
34057
|
+
function RTCDataView2(buffer2) {
|
|
34058
|
+
_classCallCheck$h(this, RTCDataView2);
|
|
34059
|
+
_defineProperty$e(this, "_position", 0);
|
|
34060
|
+
this._dataview = new DataView(buffer2);
|
|
34061
|
+
}
|
|
34062
|
+
_createClass$h(RTCDataView2, [{
|
|
34063
|
+
key: "length",
|
|
34064
|
+
get: function get3() {
|
|
34065
|
+
return this.buffer.byteLength;
|
|
34066
|
+
}
|
|
34067
|
+
}, {
|
|
34068
|
+
key: "buffer",
|
|
34069
|
+
get: function get3() {
|
|
34070
|
+
return this._dataview.buffer;
|
|
34071
|
+
}
|
|
34072
|
+
}, {
|
|
34073
|
+
key: "position",
|
|
34074
|
+
get: function get3() {
|
|
34075
|
+
return this._position;
|
|
34076
|
+
},
|
|
34077
|
+
set: function set5(value2) {
|
|
34078
|
+
this._position = value2;
|
|
34079
|
+
}
|
|
34080
|
+
}, {
|
|
34081
|
+
key: "back",
|
|
34082
|
+
value: function back(count) {
|
|
34083
|
+
this.position -= count;
|
|
34084
|
+
}
|
|
34085
|
+
}, {
|
|
34086
|
+
key: "getUint8",
|
|
34087
|
+
value: function getUint82(offset) {
|
|
34088
|
+
return this._dataview.getUint8(offset);
|
|
34089
|
+
}
|
|
34090
|
+
}, {
|
|
34091
|
+
key: "getInt8",
|
|
34092
|
+
value: function getInt8(offset) {
|
|
34093
|
+
return this._dataview.getInt8(offset);
|
|
34094
|
+
}
|
|
34095
|
+
}, {
|
|
34096
|
+
key: "getInt16",
|
|
34097
|
+
value: function getInt16(offset) {
|
|
34098
|
+
return this._dataview.getInt16(offset);
|
|
34099
|
+
}
|
|
34100
|
+
}, {
|
|
34101
|
+
key: "getUint16",
|
|
34102
|
+
value: function getUint16(offset) {
|
|
34103
|
+
return this._dataview.getUint16(offset);
|
|
34104
|
+
}
|
|
34105
|
+
}, {
|
|
34106
|
+
key: "getUint32",
|
|
34107
|
+
value: function getUint32(offset) {
|
|
34108
|
+
return this._dataview.getUint32(offset);
|
|
34109
|
+
}
|
|
34110
|
+
}, {
|
|
34111
|
+
key: "getInt32",
|
|
34112
|
+
value: function getInt32(offset) {
|
|
34113
|
+
return this._dataview.getInt32(offset);
|
|
34114
|
+
}
|
|
34115
|
+
}, {
|
|
34116
|
+
key: "skip",
|
|
34117
|
+
value: function skip(count) {
|
|
34118
|
+
var loop = Math.floor(count / 4);
|
|
34119
|
+
var last2 = count % 4;
|
|
34120
|
+
for (var i2 = 0; i2 < loop; i2++) {
|
|
34121
|
+
RTCDataView2.readByte(this, 4);
|
|
34122
|
+
}
|
|
34123
|
+
if (last2 > 0) {
|
|
34124
|
+
RTCDataView2.readByte(this, last2);
|
|
34125
|
+
}
|
|
34126
|
+
}
|
|
34127
|
+
}, {
|
|
34128
|
+
key: "readUint8",
|
|
34129
|
+
value: function readUint8() {
|
|
34130
|
+
return RTCDataView2.readByte(this, 1);
|
|
34131
|
+
}
|
|
34132
|
+
}, {
|
|
34133
|
+
key: "readUint16",
|
|
34134
|
+
value: function readUint16() {
|
|
34135
|
+
return RTCDataView2.readByte(this, 2);
|
|
34136
|
+
}
|
|
34137
|
+
}, {
|
|
34138
|
+
key: "readUint24",
|
|
34139
|
+
value: function readUint24() {
|
|
34140
|
+
return RTCDataView2.readByte(this, 3);
|
|
34141
|
+
}
|
|
34142
|
+
}, {
|
|
34143
|
+
key: "readUint32",
|
|
34144
|
+
value: function readUint32() {
|
|
34145
|
+
return RTCDataView2.readByte(this, 4);
|
|
34146
|
+
}
|
|
34147
|
+
}, {
|
|
34148
|
+
key: "readUint64",
|
|
34149
|
+
value: function readUint64() {
|
|
34150
|
+
return RTCDataView2.readByte(this, 8);
|
|
34151
|
+
}
|
|
34152
|
+
}, {
|
|
34153
|
+
key: "readInt8",
|
|
34154
|
+
value: function readInt8() {
|
|
34155
|
+
return RTCDataView2.readByte(this, 1, true);
|
|
34156
|
+
}
|
|
34157
|
+
}, {
|
|
34158
|
+
key: "readInt16",
|
|
34159
|
+
value: function readInt16() {
|
|
34160
|
+
return RTCDataView2.readByte(this, 2, true);
|
|
34161
|
+
}
|
|
34162
|
+
}, {
|
|
34163
|
+
key: "readInt32",
|
|
34164
|
+
value: function readInt32() {
|
|
34165
|
+
return RTCDataView2.readByte(this, 4, true);
|
|
34166
|
+
}
|
|
34167
|
+
}, {
|
|
34168
|
+
key: "writeUint32",
|
|
34169
|
+
value: function writeUint32(value2) {
|
|
34170
|
+
return new Uint8Array([value2 >>> 24 & 255, value2 >>> 16 & 255, value2 >>> 8 & 255, value2 & 255]);
|
|
34171
|
+
}
|
|
34172
|
+
}], [{
|
|
34173
|
+
key: "readByte",
|
|
34174
|
+
value: function readByte(buffer2, size, sign3) {
|
|
34175
|
+
var res;
|
|
34176
|
+
switch (size) {
|
|
34177
|
+
case 1:
|
|
34178
|
+
if (sign3) {
|
|
34179
|
+
res = buffer2.getInt8(buffer2.position);
|
|
34180
|
+
} else {
|
|
34181
|
+
res = buffer2.getUint8(buffer2.position);
|
|
34182
|
+
}
|
|
34183
|
+
break;
|
|
34184
|
+
case 2:
|
|
34185
|
+
if (sign3) {
|
|
34186
|
+
res = buffer2.getInt16(buffer2.position);
|
|
34187
|
+
} else {
|
|
34188
|
+
res = buffer2.getUint16(buffer2.position);
|
|
34189
|
+
}
|
|
34190
|
+
break;
|
|
34191
|
+
case 3:
|
|
34192
|
+
if (sign3) {
|
|
34193
|
+
throw new Error("not supported for readByte 3");
|
|
34194
|
+
} else {
|
|
34195
|
+
res = buffer2.getUint8(buffer2.position) << 16;
|
|
34196
|
+
res |= buffer2.getUint8(buffer2.position + 1) << 8;
|
|
34197
|
+
res |= buffer2.getUint8(buffer2.position + 2);
|
|
34198
|
+
}
|
|
34199
|
+
break;
|
|
34200
|
+
case 4:
|
|
34201
|
+
if (sign3) {
|
|
34202
|
+
res = buffer2.getInt32(buffer2.position);
|
|
34203
|
+
} else {
|
|
34204
|
+
res = buffer2.getUint32(buffer2.position);
|
|
34205
|
+
}
|
|
34206
|
+
break;
|
|
34207
|
+
case 8:
|
|
34208
|
+
if (sign3) {
|
|
34209
|
+
throw new Error("not supported for readBody 8");
|
|
34210
|
+
} else {
|
|
34211
|
+
res = buffer2.getUint32(buffer2.position) << 32;
|
|
34212
|
+
res |= buffer2.getUint32(buffer2.position + 4);
|
|
34213
|
+
}
|
|
34214
|
+
break;
|
|
34215
|
+
default:
|
|
34216
|
+
res = "";
|
|
34217
|
+
}
|
|
34218
|
+
buffer2.position += size;
|
|
34219
|
+
return res;
|
|
34220
|
+
}
|
|
34221
|
+
}]);
|
|
34222
|
+
return RTCDataView2;
|
|
34223
|
+
}();
|
|
34224
|
+
function _classCallCheck$f(instance, Constructor2) {
|
|
34225
|
+
if (!(instance instanceof Constructor2)) {
|
|
34226
|
+
throw new TypeError("Cannot call a class as a function");
|
|
34227
|
+
}
|
|
34228
|
+
}
|
|
34229
|
+
function _defineProperties$f(target, props) {
|
|
34230
|
+
for (var i2 = 0; i2 < props.length; i2++) {
|
|
34231
|
+
var descriptor = props[i2];
|
|
34232
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
34233
|
+
descriptor.configurable = true;
|
|
34234
|
+
if ("value" in descriptor)
|
|
34235
|
+
descriptor.writable = true;
|
|
34236
|
+
Object.defineProperty(target, _toPropertyKey$5(descriptor.key), descriptor);
|
|
34237
|
+
}
|
|
34238
|
+
}
|
|
34239
|
+
function _createClass$f(Constructor2, protoProps, staticProps) {
|
|
34240
|
+
if (protoProps)
|
|
34241
|
+
_defineProperties$f(Constructor2.prototype, protoProps);
|
|
34242
|
+
if (staticProps)
|
|
34243
|
+
_defineProperties$f(Constructor2, staticProps);
|
|
34244
|
+
Object.defineProperty(Constructor2, "prototype", {
|
|
34245
|
+
writable: false
|
|
34246
|
+
});
|
|
34247
|
+
return Constructor2;
|
|
34248
|
+
}
|
|
34249
|
+
function _toPrimitive$5(input, hint) {
|
|
34250
|
+
if (typeof input !== "object" || input === null)
|
|
34251
|
+
return input;
|
|
34252
|
+
var prim = input[Symbol.toPrimitive];
|
|
34253
|
+
if (prim !== void 0) {
|
|
34254
|
+
var res = prim.call(input, hint || "default");
|
|
34255
|
+
if (typeof res !== "object")
|
|
34256
|
+
return res;
|
|
34257
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
34258
|
+
}
|
|
34259
|
+
return (hint === "string" ? String : Number)(input);
|
|
34260
|
+
}
|
|
34261
|
+
function _toPropertyKey$5(arg) {
|
|
34262
|
+
var key2 = _toPrimitive$5(arg, "string");
|
|
34263
|
+
return typeof key2 === "symbol" ? key2 : String(key2);
|
|
34264
|
+
}
|
|
34265
|
+
function readBig32$2(data2) {
|
|
34266
|
+
var i2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
34267
|
+
return (data2[i2] << 24 >>> 0) + (data2[i2 + 1] << 16) + (data2[i2 + 2] << 8) + (data2[i2 + 3] || 0);
|
|
34268
|
+
}
|
|
34269
|
+
var NALu$1 = /* @__PURE__ */ function() {
|
|
34270
|
+
function NALu2() {
|
|
34271
|
+
_classCallCheck$f(this, NALu2);
|
|
34272
|
+
}
|
|
34273
|
+
_createClass$f(NALu2, null, [{
|
|
34274
|
+
key: "parseAnnexB",
|
|
34275
|
+
value: function parseAnnexB(data2) {
|
|
34276
|
+
var j = data2.byteLength - 1;
|
|
34277
|
+
var dropZerosLength = 0;
|
|
34278
|
+
do {
|
|
34279
|
+
if (data2[j] === 0) {
|
|
34280
|
+
dropZerosLength++;
|
|
34281
|
+
} else {
|
|
34282
|
+
break;
|
|
34283
|
+
}
|
|
34284
|
+
j--;
|
|
34285
|
+
} while (j > 0);
|
|
34286
|
+
if (dropZerosLength >= 3) {
|
|
34287
|
+
data2 = data2.subarray(0, j + 1);
|
|
34288
|
+
}
|
|
34289
|
+
var len = data2.length;
|
|
34290
|
+
var start = 2;
|
|
34291
|
+
var end = 0;
|
|
34292
|
+
while (data2[start] !== null && data2[start] !== void 0 && data2[start] !== 1) {
|
|
34293
|
+
start++;
|
|
34294
|
+
}
|
|
34295
|
+
start++;
|
|
34296
|
+
end = start + 2;
|
|
34297
|
+
if (end >= len)
|
|
34298
|
+
return [];
|
|
34299
|
+
var units = [];
|
|
34300
|
+
while (end < len) {
|
|
34301
|
+
switch (data2[end]) {
|
|
34302
|
+
case 0:
|
|
34303
|
+
if (data2[end - 1] !== 0) {
|
|
34304
|
+
end += 2;
|
|
34305
|
+
break;
|
|
34306
|
+
} else if (data2[end - 2] !== 0) {
|
|
34307
|
+
end++;
|
|
34308
|
+
break;
|
|
34309
|
+
} else if (end < len - 1 && data2[end + 1] !== 1) {
|
|
34310
|
+
end++;
|
|
34311
|
+
break;
|
|
34312
|
+
}
|
|
34313
|
+
if (start !== end - 2)
|
|
34314
|
+
units.push(data2.subarray(start, end - 2));
|
|
34315
|
+
do {
|
|
34316
|
+
end++;
|
|
34317
|
+
} while (data2[end] !== 1 && end < len);
|
|
34318
|
+
start = end + 1;
|
|
34319
|
+
end = start + 2;
|
|
34320
|
+
break;
|
|
34321
|
+
case 1:
|
|
34322
|
+
if (data2[end - 1] !== 0 || data2[end - 2] !== 0) {
|
|
34323
|
+
end += 3;
|
|
34324
|
+
break;
|
|
34325
|
+
}
|
|
34326
|
+
if (start !== end - 2)
|
|
34327
|
+
units.push(data2.subarray(start, end - 2));
|
|
34328
|
+
start = end + 1;
|
|
34329
|
+
end = start + 2;
|
|
34330
|
+
break;
|
|
34331
|
+
default:
|
|
34332
|
+
end += 3;
|
|
34333
|
+
break;
|
|
34334
|
+
}
|
|
34335
|
+
}
|
|
34336
|
+
if (start < len)
|
|
34337
|
+
units.push(data2.subarray(start));
|
|
34338
|
+
return units;
|
|
34339
|
+
}
|
|
34340
|
+
}, {
|
|
34341
|
+
key: "parseAvcC",
|
|
34342
|
+
value: function parseAvcC(data2) {
|
|
34343
|
+
var size = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 4;
|
|
34344
|
+
if (data2.length < 4)
|
|
34345
|
+
return;
|
|
34346
|
+
var dataLen = data2.length;
|
|
34347
|
+
var units = [];
|
|
34348
|
+
var offset = 0;
|
|
34349
|
+
var length;
|
|
34350
|
+
while (offset + size < dataLen) {
|
|
34351
|
+
length = readBig32$2(data2, offset);
|
|
34352
|
+
if (size === 3)
|
|
34353
|
+
length >>>= 8;
|
|
34354
|
+
offset += size;
|
|
34355
|
+
if (!length)
|
|
34356
|
+
continue;
|
|
34357
|
+
if (offset + length > dataLen) {
|
|
34358
|
+
break;
|
|
34359
|
+
}
|
|
34360
|
+
units.push(data2.subarray(offset, offset + length));
|
|
34361
|
+
offset += length;
|
|
34362
|
+
}
|
|
34363
|
+
return units;
|
|
34364
|
+
}
|
|
34365
|
+
}, {
|
|
34366
|
+
key: "parseSEI",
|
|
34367
|
+
value: function parseSEI(unit, isHevc) {
|
|
34368
|
+
var len = unit.length;
|
|
34369
|
+
var i2 = isHevc ? 2 : 1;
|
|
34370
|
+
var type = 0;
|
|
34371
|
+
var size = 0;
|
|
34372
|
+
var uuid = "";
|
|
34373
|
+
while (unit[i2] === 255) {
|
|
34374
|
+
type += 255;
|
|
34375
|
+
i2++;
|
|
34376
|
+
}
|
|
34377
|
+
type += unit[i2++];
|
|
34378
|
+
while (unit[i2] === 255) {
|
|
34379
|
+
size += 255;
|
|
34380
|
+
i2++;
|
|
34381
|
+
}
|
|
34382
|
+
size += unit[i2++];
|
|
34383
|
+
if (type === 5 && len > i2 + 16) {
|
|
34384
|
+
for (var j = 0; j < 16; j++) {
|
|
34385
|
+
uuid += unit[i2].toString(16);
|
|
34386
|
+
i2++;
|
|
34387
|
+
}
|
|
34388
|
+
}
|
|
34389
|
+
return {
|
|
34390
|
+
payload: unit.subarray(i2, i2 + size),
|
|
34391
|
+
type,
|
|
34392
|
+
size,
|
|
34393
|
+
uuid
|
|
34394
|
+
};
|
|
34395
|
+
}
|
|
34396
|
+
}, {
|
|
34397
|
+
key: "removeEPB",
|
|
34398
|
+
value: function removeEPB(uint) {
|
|
34399
|
+
var length = uint.byteLength;
|
|
34400
|
+
var emulationPreventionBytesPositions = [];
|
|
34401
|
+
var i2 = 1;
|
|
34402
|
+
while (i2 < length - 2) {
|
|
34403
|
+
if (uint[i2] === 0 && uint[i2 + 1] === 0 && uint[i2 + 2] === 3) {
|
|
34404
|
+
emulationPreventionBytesPositions.push(i2 + 2);
|
|
34405
|
+
i2 += 2;
|
|
34406
|
+
} else {
|
|
34407
|
+
i2++;
|
|
34408
|
+
}
|
|
34409
|
+
}
|
|
34410
|
+
if (!emulationPreventionBytesPositions.length)
|
|
34411
|
+
return uint;
|
|
34412
|
+
var newLength = length - emulationPreventionBytesPositions.length;
|
|
34413
|
+
var newData = new Uint8Array(newLength);
|
|
34414
|
+
var sourceIndex = 0;
|
|
34415
|
+
for (i2 = 0; i2 < newLength; sourceIndex++, i2++) {
|
|
34416
|
+
if (sourceIndex === emulationPreventionBytesPositions[0]) {
|
|
34417
|
+
sourceIndex++;
|
|
34418
|
+
emulationPreventionBytesPositions.shift();
|
|
34419
|
+
}
|
|
34420
|
+
newData[i2] = uint[sourceIndex];
|
|
34421
|
+
}
|
|
34422
|
+
return newData;
|
|
34423
|
+
}
|
|
34424
|
+
}]);
|
|
34425
|
+
return NALu2;
|
|
34426
|
+
}();
|
|
34427
|
+
function receiveSEITransform(postMessage) {
|
|
34428
|
+
var transform = new TransformStream({
|
|
34429
|
+
transform: function transform2(encodedFrame, controller) {
|
|
34430
|
+
var isH265 = Nalunit.isH265VideoFrame(encodedFrame);
|
|
34431
|
+
var NALs = Nalunit.getNALUnits(new RTCDataView(encodedFrame.data), isH265);
|
|
34432
|
+
NALs.forEach(function(nalUnit) {
|
|
34433
|
+
if (nalUnit.sei) {
|
|
34434
|
+
var decodedSei = NALu$1.parseSEI(NALu$1.removeEPB(nalUnit.body), false);
|
|
34435
|
+
if (decodedSei) {
|
|
34436
|
+
postMessage({
|
|
34437
|
+
data: decodedSei,
|
|
34438
|
+
sei: {
|
|
34439
|
+
code: decodedSei.type,
|
|
34440
|
+
content: decodedSei.payload
|
|
34441
|
+
}
|
|
34442
|
+
});
|
|
34443
|
+
}
|
|
34444
|
+
}
|
|
34445
|
+
});
|
|
34446
|
+
controller.enqueue(encodedFrame);
|
|
34447
|
+
}
|
|
34448
|
+
});
|
|
34449
|
+
return transform;
|
|
34450
|
+
}
|
|
34451
|
+
if (typeof self !== "undefined" && self.constructor.name === "DedicatedWorkerGlobalScope") {
|
|
34452
|
+
self.addEventListener("rtctransform", function(event) {
|
|
34453
|
+
var transformer = event.transformer;
|
|
34454
|
+
var port2 = transformer.options.port;
|
|
34455
|
+
var transform = receiveSEITransform(function(msg) {
|
|
34456
|
+
port2.postMessage(msg);
|
|
34457
|
+
});
|
|
34458
|
+
transformer.readable.pipeThrough(transform).pipeTo(event.transformer.writable);
|
|
34459
|
+
});
|
|
34460
|
+
}
|
|
34461
|
+
var encodedJs$5 = "IWZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBlPXtnZXROQUxVbml0czpmdW5jdGlvbih0KXt2YXIgbj1hcmd1bWVudHMubGVuZ3RoPjEmJnZvaWQgMCE9PWFyZ3VtZW50c1sxXSYmYXJndW1lbnRzWzFdO2lmKHQubGVuZ3RoLXQucG9zaXRpb248NClyZXR1cm5bXTt2YXIgcj10LnBvc2l0aW9uO3JldHVybiAxPT09dC5nZXRJbnQzMihyKXx8MD09PXQuZ2V0SW50MTYocikmJjE9PT10LmdldEludDgocisyKT9lLmdldEFubmV4Yk5hbHModCxuKTplLmdldEF2Y2NOYWxzKHQsbil9LGdldEFubmV4Yk5hbHM6ZnVuY3Rpb24odCxuKXtmb3IodmFyIHI9W10saT1lLmdldEhlYWRlclBvc2l0aW9uQW5uZXhCKHQpLGE9aS5wb3Msbz1hO2E8dC5sZW5ndGgtNDspe3ZhciB1PW5ldyBVaW50OEFycmF5KHQuYnVmZmVyLnNsaWNlKGEsYStpLmhlYWRlckxlbmd0aCkpO2kucG9zPT09dC5wb3NpdGlvbiYmdC5za2lwKGkuaGVhZGVyTGVuZ3RoKSxvPShpPWUuZ2V0SGVhZGVyUG9zaXRpb25Bbm5leEIodCkpLnBvczt2YXIgcz17aGVhZGVyOnUsYm9keTpuZXcgVWludDhBcnJheSh0LmJ1ZmZlci5zbGljZShhK3UuYnl0ZUxlbmd0aCxvKSksdHlwZTotMX07bj9lLmFuYWx5c2VIMjY1TmFsKHMpOmUuYW5hbHlzZU5hbChzKSwocy50eXBlPD05fHxuJiZzLnR5cGU8PTQwKSYmMCE9PXMudHlwZSYmci5wdXNoKHMpLHQuc2tpcChvLXQucG9zaXRpb24pLGE9b31yZXR1cm4gcn0sZ2V0QXZjY05hbHM6ZnVuY3Rpb24odCxuKXtmb3IodmFyIHI9W107dC5wb3NpdGlvbjx0Lmxlbmd0aC00Oyl7dmFyIGk9dC5nZXRJbnQzMih0LnBvc2l0aW9uKTtpZighKHQubGVuZ3RoLXQucG9zaXRpb24+PWkpKWJyZWFrO3ZhciBhPW5ldyBVaW50OEFycmF5KHQuYnVmZmVyLnNsaWNlKHQucG9zaXRpb24sdC5wb3NpdGlvbis0KSk7dC5za2lwKDQpO3ZhciBvPW5ldyBVaW50OEFycmF5KHQuYnVmZmVyLnNsaWNlKHQucG9zaXRpb24sdC5wb3NpdGlvbitpKSk7dC5za2lwKGkpO3ZhciB1PXtoZWFkZXI6YSxib2R5Om8sdHlwZTotMX07bj9lLmFuYWx5c2VIMjY1TmFsKHUpOmUuYW5hbHlzZU5hbCh1KSx1LnR5cGU8PTkmJjAhPT11LnR5cGUmJnIucHVzaCh1KX1yZXR1cm4gcn0sYW5hbHlzZU5hbDpmdW5jdGlvbihlKXt2YXIgdD0zMSZlLmJvZHlbMF07c3dpdGNoKGUudHlwZT10LHQpe2Nhc2UgMTplLm5kcj0hMDticmVhaztjYXNlIDU6ZS5pZHI9ITA7YnJlYWs7Y2FzZSA2OmUuc2VpPSEwO2JyZWFrO2Nhc2UgNzplLnNwcz0hMDticmVhaztjYXNlIDg6ZS5wcHM9ITB9fSxhbmFseXNlSDI2NU5hbDpmdW5jdGlvbihlKXt2YXIgdD0oMTI2JmUuYm9keVswXSk+PjE7c3dpdGNoKGUudHlwZT10LHQpe2Nhc2UgMzk6Y2FzZSA0MDplLnNlaT0hMH19LGdldEhlYWRlclBvc2l0aW9uQW5uZXhCOmZ1bmN0aW9uKGUpe2Zvcih2YXIgdD1lLnBvc2l0aW9uLG49MCxyPWUubGVuZ3RoOzMhPT1uJiY0IT09biYmdDxyLTQ7KTA9PT1lLmdldEludDE2KHQpPzE9PT1lLmdldEludDE2KHQrMik/bj00OjE9PT1lLmdldEludDgodCsyKT9uPTM6dCsrOnQrKztyZXR1cm4gdD09PXItNCYmKDA9PT1lLmdldEludDE2KHQpPzE9PT1lLmdldEludDE2KHQrMik/bj00OnQ9cjoodCsrLDA9PT1lLmdldEludDE2KHQpJiYxPT09ZS5nZXRJbnQ4KHQpP249Mzp0PXIpKSx7cG9zOnQsaGVhZGVyTGVuZ3RoOm59fSxpc0gyNjVWaWRlb0ZyYW1lOmZ1bmN0aW9uKGUpe3ZhciB0LG47cmV0dXJuKChudWxsPT09KHQ9ZS5nZXRNZXRhZGF0YSl8fHZvaWQgMD09PXR8fG51bGw9PT0obj10LmNhbGwoZSkpfHx2b2lkIDA9PT1uP3ZvaWQgMDpuLm1pbWVUeXBlKXx8IiIpLnRvTG93ZXJDYXNlKCkuaW5jbHVkZXMoImgyNjUiKX19O2Z1bmN0aW9uIHQoZSl7cmV0dXJuKHQ9ImZ1bmN0aW9uIj09dHlwZW9mIFN5bWJvbCYmInN5bWJvbCI9PXR5cGVvZiBTeW1ib2wuaXRlcmF0b3I/ZnVuY3Rpb24oZSl7cmV0dXJuIHR5cGVvZiBlfTpmdW5jdGlvbihlKXtyZXR1cm4gZSYmImZ1bmN0aW9uIj09dHlwZW9mIFN5bWJvbCYmZS5jb25zdHJ1Y3Rvcj09PVN5bWJvbCYmZSE9PVN5bWJvbC5wcm90b3R5cGU/InN5bWJvbCI6dHlwZW9mIGV9KShlKX1mdW5jdGlvbiBuKGUsdCl7Zm9yKHZhciBuPTA7bjx0Lmxlbmd0aDtuKyspe3ZhciBpPXRbbl07aS5lbnVtZXJhYmxlPWkuZW51bWVyYWJsZXx8ITEsaS5jb25maWd1cmFibGU9ITAsInZhbHVlImluIGkmJihpLndyaXRhYmxlPSEwKSxPYmplY3QuZGVmaW5lUHJvcGVydHkoZSxyKGkua2V5KSxpKX19ZnVuY3Rpb24gcihlKXt2YXIgdD1mdW5jdGlvbihlLHQpe2lmKCJvYmplY3QiIT10eXBlb2YgZXx8bnVsbD09PWUpcmV0dXJuIGU7dmFyIG49ZVtTeW1ib2wudG9QcmltaXRpdmVdO2lmKHZvaWQgMCE9PW4pe3ZhciByPW4uY2FsbChlLHR8fCJkZWZhdWx0Iik7aWYoIm9iamVjdCIhPXR5cGVvZiByKXJldHVybiByO3Rocm93IG5ldyBUeXBlRXJyb3IoIkBAdG9QcmltaXRpdmUgbXVzdCByZXR1cm4gYSBwcmltaXRpdmUgdmFsdWUuIil9cmV0dXJuKCJzdHJpbmciPT09dD9TdHJpbmc6TnVtYmVyKShlKX0oZSwic3RyaW5nIik7cmV0dXJuInN5bWJvbCI9PXR5cGVvZiB0P3Q6U3RyaW5nKHQpfXZhciBpPWZ1bmN0aW9uKCl7ZnVuY3Rpb24gZSh0KXt2YXIgbixpLGE7IWZ1bmN0aW9uKGUsdCl7aWYoIShlIGluc3RhbmNlb2YgdCkpdGhyb3cgbmV3IFR5cGVFcnJvcigiQ2Fubm90IGNhbGwgYSBjbGFzcyBhcyBhIGZ1bmN0aW9uIil9KHRoaXMsZSksbj10aGlzLGE9MCwoaT1yKGk9Il9wb3NpdGlvbiIpKWluIG4/T2JqZWN0LmRlZmluZVByb3BlcnR5KG4saSx7dmFsdWU6YSxlbnVtZXJhYmxlOiEwLGNvbmZpZ3VyYWJsZTohMCx3cml0YWJsZTohMH0pOm5baV09YSx0aGlzLl9kYXRhdmlldz1uZXcgRGF0YVZpZXcodCl9dmFyIHQsaSxhO3JldHVybiB0PWUsYT1be2tleToicmVhZEJ5dGUiLHZhbHVlOmZ1bmN0aW9uKGUsdCxuKXt2YXIgcjtzd2l0Y2godCl7Y2FzZSAxOnI9bj9lLmdldEludDgoZS5wb3NpdGlvbik6ZS5nZXRVaW50OChlLnBvc2l0aW9uKTticmVhaztjYXNlIDI6cj1uP2UuZ2V0SW50MTYoZS5wb3NpdGlvbik6ZS5nZXRVaW50MTYoZS5wb3NpdGlvbik7YnJlYWs7Y2FzZSAzOmlmKG4pdGhyb3cgbmV3IEVycm9yKCJub3Qgc3VwcG9ydGVkIGZvciByZWFkQnl0ZSAzIik7cj1lLmdldFVpbnQ4KGUucG9zaXRpb24pPDwxNixyfD1lLmdldFVpbnQ4KGUucG9zaXRpb24rMSk8PDgscnw9ZS5nZXRVaW50OChlLnBvc2l0aW9uKzIpO2JyZWFrO2Nhc2UgNDpyPW4/ZS5nZXRJbnQzMihlLnBvc2l0aW9uKTplLmdldFVpbnQzMihlLnBvc2l0aW9uKTticmVhaztjYXNlIDg6aWYobil0aHJvdyBuZXcgRXJyb3IoIm5vdCBzdXBwb3J0ZWQgZm9yIHJlYWRCb2R5IDgiKTtyPWUuZ2V0VWludDMyKGUucG9zaXRpb24pPDwzMixyfD1lLmdldFVpbnQzMihlLnBvc2l0aW9uKzQpO2JyZWFrO2RlZmF1bHQ6cj0iIn1yZXR1cm4gZS5wb3NpdGlvbis9dCxyfX1dLChpPVt7a2V5OiJsZW5ndGgiLGdldDpmdW5jdGlvbigpe3JldHVybiB0aGlzLmJ1ZmZlci5ieXRlTGVuZ3RofX0se2tleToiYnVmZmVyIixnZXQ6ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5fZGF0YXZpZXcuYnVmZmVyfX0se2tleToicG9zaXRpb24iLGdldDpmdW5jdGlvbigpe3JldHVybiB0aGlzLl9wb3NpdGlvbn0sc2V0OmZ1bmN0aW9uKGUpe3RoaXMuX3Bvc2l0aW9uPWV9fSx7a2V5OiJiYWNrIix2YWx1ZTpmdW5jdGlvbihlKXt0aGlzLnBvc2l0aW9uLT1lfX0se2tleToiZ2V0VWludDgiLHZhbHVlOmZ1bmN0aW9uKGUpe3JldHVybiB0aGlzLl9kYXRhdmlldy5nZXRVaW50OChlKX19LHtrZXk6ImdldEludDgiLHZhbHVlOmZ1bmN0aW9uKGUpe3JldHVybiB0aGlzLl9kYXRhdmlldy5nZXRJbnQ4KGUpfX0se2tleToiZ2V0SW50MTYiLHZhbHVlOmZ1bmN0aW9uKGUpe3JldHVybiB0aGlzLl9kYXRhdmlldy5nZXRJbnQxNihlKX19LHtrZXk6ImdldFVpbnQxNiIsdmFsdWU6ZnVuY3Rpb24oZSl7cmV0dXJuIHRoaXMuX2RhdGF2aWV3LmdldFVpbnQxNihlKX19LHtrZXk6ImdldFVpbnQzMiIsdmFsdWU6ZnVuY3Rpb24oZSl7cmV0dXJuIHRoaXMuX2RhdGF2aWV3LmdldFVpbnQzMihlKX19LHtrZXk6ImdldEludDMyIix2YWx1ZTpmdW5jdGlvbihlKXtyZXR1cm4gdGhpcy5fZGF0YXZpZXcuZ2V0SW50MzIoZSl9fSx7a2V5OiJza2lwIix2YWx1ZTpmdW5jdGlvbih0KXtmb3IodmFyIG49TWF0aC5mbG9vcih0LzQpLHI9dCU0LGk9MDtpPG47aSsrKWUucmVhZEJ5dGUodGhpcyw0KTtyPjAmJmUucmVhZEJ5dGUodGhpcyxyKX19LHtrZXk6InJlYWRVaW50OCIsdmFsdWU6ZnVuY3Rpb24oKXtyZXR1cm4gZS5yZWFkQnl0ZSh0aGlzLDEpfX0se2tleToicmVhZFVpbnQxNiIsdmFsdWU6ZnVuY3Rpb24oKXtyZXR1cm4gZS5yZWFkQnl0ZSh0aGlzLDIpfX0se2tleToicmVhZFVpbnQyNCIsdmFsdWU6ZnVuY3Rpb24oKXtyZXR1cm4gZS5yZWFkQnl0ZSh0aGlzLDMpfX0se2tleToicmVhZFVpbnQzMiIsdmFsdWU6ZnVuY3Rpb24oKXtyZXR1cm4gZS5yZWFkQnl0ZSh0aGlzLDQpfX0se2tleToicmVhZFVpbnQ2NCIsdmFsdWU6ZnVuY3Rpb24oKXtyZXR1cm4gZS5yZWFkQnl0ZSh0aGlzLDgpfX0se2tleToicmVhZEludDgiLHZhbHVlOmZ1bmN0aW9uKCl7cmV0dXJuIGUucmVhZEJ5dGUodGhpcywxLCEwKX19LHtrZXk6InJlYWRJbnQxNiIsdmFsdWU6ZnVuY3Rpb24oKXtyZXR1cm4gZS5yZWFkQnl0ZSh0aGlzLDIsITApfX0se2tleToicmVhZEludDMyIix2YWx1ZTpmdW5jdGlvbigpe3JldHVybiBlLnJlYWRCeXRlKHRoaXMsNCwhMCl9fSx7a2V5OiJ3cml0ZVVpbnQzMiIsdmFsdWU6ZnVuY3Rpb24oZSl7cmV0dXJuIG5ldyBVaW50OEFycmF5KFtlPj4+MjQmMjU1LGU+Pj4xNiYyNTUsZT4+PjgmMjU1LDI1NSZlXSl9fV0pJiZuKHQucHJvdG90eXBlLGkpLGEmJm4odCxhKSxPYmplY3QuZGVmaW5lUHJvcGVydHkodCwicHJvdG90eXBlIix7d3JpdGFibGU6ITF9KSxlfSgpO2Z1bmN0aW9uIGEoZSxuKXtmb3IodmFyIHI9MDtyPG4ubGVuZ3RoO3IrKyl7dmFyIGk9bltyXTtpLmVudW1lcmFibGU9aS5lbnVtZXJhYmxlfHwhMSxpLmNvbmZpZ3VyYWJsZT0hMCwidmFsdWUiaW4gaSYmKGkud3JpdGFibGU9ITApLE9iamVjdC5kZWZpbmVQcm9wZXJ0eShlLChhPWkua2V5LG89dm9pZCAwLG89ZnVuY3Rpb24oZSxuKXtpZigib2JqZWN0IiE9PXQoZSl8fG51bGw9PT1lKXJldHVybiBlO3ZhciByPWVbU3ltYm9sLnRvUHJpbWl0aXZlXTtpZih2b2lkIDAhPT1yKXt2YXIgaT1yLmNhbGwoZSxufHwiZGVmYXVsdCIpO2lmKCJvYmplY3QiIT09dChpKSlyZXR1cm4gaTt0aHJvdyBuZXcgVHlwZUVycm9yKCJAQHRvUHJpbWl0aXZlIG11c3QgcmV0dXJuIGEgcHJpbWl0aXZlIHZhbHVlLiIpfXJldHVybigic3RyaW5nIj09PW4/U3RyaW5nOk51bWJlcikoZSl9KGEsInN0cmluZyIpLCJzeW1ib2wiPT09dChvKT9vOlN0cmluZyhvKSksaSl9dmFyIGEsb31mdW5jdGlvbiBvKGUpe3ZhciB0PWFyZ3VtZW50cy5sZW5ndGg+MSYmdm9pZCAwIT09YXJndW1lbnRzWzFdP2FyZ3VtZW50c1sxXTowO3JldHVybihlW3RdPDwyND4+PjApKyhlW3QrMV08PDE2KSsoZVt0KzJdPDw4KSsoZVt0KzNdfHwwKX12YXIgdT1mdW5jdGlvbigpe2Z1bmN0aW9uIGUoKXshZnVuY3Rpb24oZSx0KXtpZighKGUgaW5zdGFuY2VvZiB0KSl0aHJvdyBuZXcgVHlwZUVycm9yKCJDYW5ub3QgY2FsbCBhIGNsYXNzIGFzIGEgZnVuY3Rpb24iKX0odGhpcyxlKX12YXIgdCxuLHI7cmV0dXJuIHQ9ZSxyPVt7a2V5OiJwYXJzZUFubmV4QiIsdmFsdWU6ZnVuY3Rpb24oZSl7dmFyIHQ9ZS5ieXRlTGVuZ3RoLTEsbj0wO2Rve2lmKDAhPT1lW3RdKWJyZWFrO24rKyx0LS19d2hpbGUodD4wKTtuPj0zJiYoZT1lLnN1YmFycmF5KDAsdCsxKSk7Zm9yKHZhciByPWUubGVuZ3RoLGk9MixhPTA7bnVsbCE9PWVbaV0mJnZvaWQgMCE9PWVbaV0mJjEhPT1lW2ldOylpKys7aWYoKGE9MisgKytpKT49cilyZXR1cm5bXTtmb3IodmFyIG89W107YTxyOylzd2l0Y2goZVthXSl7Y2FzZSAwOmlmKDAhPT1lW2EtMV0pe2ErPTI7YnJlYWt9aWYoMCE9PWVbYS0yXSl7YSsrO2JyZWFrfWlmKGE8ci0xJiYxIT09ZVthKzFdKXthKys7YnJlYWt9aSE9PWEtMiYmby5wdXNoKGUuc3ViYXJyYXkoaSxhLTIpKTtkb3thKyt9d2hpbGUoMSE9PWVbYV0mJmE8cik7YT0oaT1hKzEpKzI7YnJlYWs7Y2FzZSAxOmlmKDAhPT1lW2EtMV18fDAhPT1lW2EtMl0pe2ErPTM7YnJlYWt9aSE9PWEtMiYmby5wdXNoKGUuc3ViYXJyYXkoaSxhLTIpKSxhPShpPWErMSkrMjticmVhaztkZWZhdWx0OmErPTN9cmV0dXJuIGk8ciYmby5wdXNoKGUuc3ViYXJyYXkoaSkpLG99fSx7a2V5OiJwYXJzZUF2Y0MiLHZhbHVlOmZ1bmN0aW9uKGUpe3ZhciB0PWFyZ3VtZW50cy5sZW5ndGg+MSYmdm9pZCAwIT09YXJndW1lbnRzWzFdP2FyZ3VtZW50c1sxXTo0O2lmKCEoZS5sZW5ndGg8NCkpe2Zvcih2YXIgbixyPWUubGVuZ3RoLGk9W10sYT0wO2ErdDxyOylpZihuPW8oZSxhKSwzPT09dCYmKG4+Pj49OCksYSs9dCxuKXtpZihhK24+cilicmVhaztpLnB1c2goZS5zdWJhcnJheShhLGErbikpLGErPW59cmV0dXJuIGl9fX0se2tleToicGFyc2VTRUkiLHZhbHVlOmZ1bmN0aW9uKGUsdCl7Zm9yKHZhciBuPWUubGVuZ3RoLHI9dD8yOjEsaT0wLGE9MCxvPSIiOzI1NT09PWVbcl07KWkrPTI1NSxyKys7Zm9yKGkrPWVbcisrXTsyNTU9PT1lW3JdOylhKz0yNTUscisrO2lmKGErPWVbcisrXSw1PT09aSYmbj5yKzE2KWZvcih2YXIgdT0wO3U8MTY7dSsrKW8rPWVbcl0udG9TdHJpbmcoMTYpLHIrKztyZXR1cm57cGF5bG9hZDplLnN1YmFycmF5KHIscithKSx0eXBlOmksc2l6ZTphLHV1aWQ6b319fSx7a2V5OiJyZW1vdmVFUEIiLHZhbHVlOmZ1bmN0aW9uKGUpe2Zvcih2YXIgdD1lLmJ5dGVMZW5ndGgsbj1bXSxyPTE7cjx0LTI7KTA9PT1lW3JdJiYwPT09ZVtyKzFdJiYzPT09ZVtyKzJdPyhuLnB1c2gocisyKSxyKz0yKTpyKys7aWYoIW4ubGVuZ3RoKXJldHVybiBlO3ZhciBpPXQtbi5sZW5ndGgsYT1uZXcgVWludDhBcnJheShpKSxvPTA7Zm9yKHI9MDtyPGk7bysrLHIrKylvPT09blswXSYmKG8rKyxuLnNoaWZ0KCkpLGFbcl09ZVtvXTtyZXR1cm4gYX19XSwobj1udWxsKSYmYSh0LnByb3RvdHlwZSxuKSxyJiZhKHQsciksT2JqZWN0LmRlZmluZVByb3BlcnR5KHQsInByb3RvdHlwZSIse3dyaXRhYmxlOiExfSksZX0oKTsidW5kZWZpbmVkIiE9dHlwZW9mIHNlbGYmJiJEZWRpY2F0ZWRXb3JrZXJHbG9iYWxTY29wZSI9PT1zZWxmLmNvbnN0cnVjdG9yLm5hbWUmJnNlbGYuYWRkRXZlbnRMaXN0ZW5lcigicnRjdHJhbnNmb3JtIiwoZnVuY3Rpb24odCl7dmFyIG4scj10LnRyYW5zZm9ybWVyLGE9ci5vcHRpb25zLnBvcnQsbz0obj1mdW5jdGlvbihlKXthLnBvc3RNZXNzYWdlKGUpfSxuZXcgVHJhbnNmb3JtU3RyZWFtKHt0cmFuc2Zvcm06ZnVuY3Rpb24odCxyKXt2YXIgYT1lLmlzSDI2NVZpZGVvRnJhbWUodCk7ZS5nZXROQUxVbml0cyhuZXcgaSh0LmRhdGEpLGEpLmZvckVhY2goKGZ1bmN0aW9uKGUpe2lmKGUuc2VpKXt2YXIgdD11LnBhcnNlU0VJKHUucmVtb3ZlRVBCKGUuYm9keSksITEpO3QmJm4oe2RhdGE6dCxzZWk6e2NvZGU6dC50eXBlLGNvbnRlbnQ6dC5wYXlsb2FkfX0pfX0pKSxyLmVucXVldWUodCl9fSkpO3IucmVhZGFibGUucGlwZVRocm91Z2gobykucGlwZVRvKHQudHJhbnNmb3JtZXIud3JpdGFibGUpfSkpfSgpOwo=";
|
|
34462
|
+
var blob$5 = typeof window !== "undefined" && window.Blob && new Blob([atob(encodedJs$5)], {
|
|
34463
|
+
type: "text/javascript;charset=utf-8"
|
|
34464
|
+
});
|
|
34465
|
+
function WorkerWrapper$5() {
|
|
34466
|
+
var objURL = blob$5 && (window.URL || window.webkitURL).createObjectURL(blob$5);
|
|
34467
|
+
try {
|
|
34468
|
+
return objURL ? new Worker(objURL, {}) : new Worker("data:application/javascript;base64," + encodedJs$5, {
|
|
34469
|
+
type: "module"
|
|
34470
|
+
});
|
|
34471
|
+
} finally {
|
|
34472
|
+
objURL && (window.URL || window.webkitURL).revokeObjectURL(objURL);
|
|
34473
|
+
}
|
|
34474
|
+
}
|
|
33839
34475
|
var logger$9 = new Logger$8("rts");
|
|
33840
34476
|
var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
33841
34477
|
_inherits$c(Rts2, _EventEmitter);
|
|
33842
34478
|
var _super = _createSuper$c(Rts2);
|
|
33843
34479
|
function Rts2(opts) {
|
|
33844
34480
|
var _this;
|
|
33845
|
-
_classCallCheck$
|
|
34481
|
+
_classCallCheck$h(this, Rts2);
|
|
33846
34482
|
_this = _super.call(this);
|
|
33847
34483
|
_defineProperty$e(_assertThisInitialized$c(_this), "_url", "");
|
|
33848
34484
|
_defineProperty$e(_assertThisInitialized$c(_this), "_pc", null);
|
|
@@ -33858,6 +34494,46 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
33858
34494
|
_defineProperty$e(_assertThisInitialized$c(_this), "_waitingTimer", 0);
|
|
33859
34495
|
_defineProperty$e(_assertThisInitialized$c(_this), "_rctConnectStartTs", 0);
|
|
33860
34496
|
_defineProperty$e(_assertThisInitialized$c(_this), "_isReplacing", false);
|
|
34497
|
+
_defineProperty$e(_assertThisInitialized$c(_this), "_checkStatsErrorTimer", null);
|
|
34498
|
+
_defineProperty$e(_assertThisInitialized$c(_this), "_checkStatsError", /* @__PURE__ */ _asyncToGenerator$9(/* @__PURE__ */ _regeneratorRuntime$9().mark(function _callee2() {
|
|
34499
|
+
return _regeneratorRuntime$9().wrap(function _callee2$(_context2) {
|
|
34500
|
+
while (1)
|
|
34501
|
+
switch (_context2.prev = _context2.next) {
|
|
34502
|
+
case 0:
|
|
34503
|
+
_this._checkStatsErrorTimer = setTimeout(/* @__PURE__ */ _asyncToGenerator$9(/* @__PURE__ */ _regeneratorRuntime$9().mark(function _callee() {
|
|
34504
|
+
var stats, _stats$video, framesDecoded, bytesReceived;
|
|
34505
|
+
return _regeneratorRuntime$9().wrap(function _callee$(_context) {
|
|
34506
|
+
while (1)
|
|
34507
|
+
switch (_context.prev = _context.next) {
|
|
34508
|
+
case 0:
|
|
34509
|
+
_context.next = 2;
|
|
34510
|
+
return _this.getStatsSnapshoot();
|
|
34511
|
+
case 2:
|
|
34512
|
+
stats = _context.sent;
|
|
34513
|
+
if (stats.video) {
|
|
34514
|
+
_stats$video = stats.video, framesDecoded = _stats$video.framesDecoded, bytesReceived = _stats$video.bytesReceived;
|
|
34515
|
+
if (!bytesReceived) {
|
|
34516
|
+
_this._emitError(StreamingError$2.create(ERR$2.MEDIA, ERR$2.SUB_TYPES.MEDIA_ERR_DECODE, {
|
|
34517
|
+
message: "rts receive empty"
|
|
34518
|
+
}));
|
|
34519
|
+
} else if (!framesDecoded) {
|
|
34520
|
+
_this._emitError(StreamingError$2.create(ERR$2.MEDIA, ERR$2.SUB_TYPES.MEDIA_ERR_DECODE, {
|
|
34521
|
+
message: "rts decode error"
|
|
34522
|
+
}));
|
|
34523
|
+
}
|
|
34524
|
+
}
|
|
34525
|
+
case 4:
|
|
34526
|
+
case "end":
|
|
34527
|
+
return _context.stop();
|
|
34528
|
+
}
|
|
34529
|
+
}, _callee);
|
|
34530
|
+
})), _this._opts.checkStatsErrorDelay);
|
|
34531
|
+
case 1:
|
|
34532
|
+
case "end":
|
|
34533
|
+
return _context2.stop();
|
|
34534
|
+
}
|
|
34535
|
+
}, _callee2);
|
|
34536
|
+
})));
|
|
33861
34537
|
_defineProperty$e(_assertThisInitialized$c(_this), "_onTrack", function(e4) {
|
|
33862
34538
|
logger$9.log("addTrack: ", e4.track, e4.streams);
|
|
33863
34539
|
_this["_".concat(e4.track.kind)] = e4.track;
|
|
@@ -33889,6 +34565,30 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
33889
34565
|
});
|
|
33890
34566
|
});
|
|
33891
34567
|
});
|
|
34568
|
+
_defineProperty$e(_assertThisInitialized$c(_this), "_setDelay", function(delayHint) {
|
|
34569
|
+
if (delayHint) {
|
|
34570
|
+
try {
|
|
34571
|
+
var videoReceiver = _this._videoTransceicer.receiver;
|
|
34572
|
+
var audioReceiver = _this._audioTransceicer.receiver;
|
|
34573
|
+
if ("playoutDelayHint" in videoReceiver && "playoutDelayHint" in audioReceiver) {
|
|
34574
|
+
_this._audioTransceicer.receiver.playoutDelayHint = delayHint;
|
|
34575
|
+
_this._videoTransceicer.receiver.playoutDelayHint = delayHint;
|
|
34576
|
+
return;
|
|
34577
|
+
}
|
|
34578
|
+
if ("jitterBufferDelayHint" in videoReceiver && "jitterBufferDelayHint" in audioReceiver) {
|
|
34579
|
+
_this._audioTransceicer.receiver.jitterBufferDelayHint = delayHint;
|
|
34580
|
+
_this._videoTransceicer.receiver.jitterBufferDelayHint = delayHint;
|
|
34581
|
+
return;
|
|
34582
|
+
}
|
|
34583
|
+
if ("jitterBufferTarget" in videoReceiver && "jitterBufferTarget" in audioReceiver) {
|
|
34584
|
+
_this._audioTransceicer.receiver.jitterBufferTarget = delayHint * 1e3;
|
|
34585
|
+
_this._videoTransceicer.receiver.jitterBufferTarget = delayHint * 1e3;
|
|
34586
|
+
}
|
|
34587
|
+
} catch (error) {
|
|
34588
|
+
logger$9.error("set delay error");
|
|
34589
|
+
}
|
|
34590
|
+
}
|
|
34591
|
+
});
|
|
33892
34592
|
_defineProperty$e(_assertThisInitialized$c(_this), "_onLoaderRetry", function(error, retryTime) {
|
|
33893
34593
|
_this.emit(EVENT$2.LOAD_RETRY, {
|
|
33894
34594
|
error: StreamingError$2.network(error),
|
|
@@ -33913,7 +34613,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
33913
34613
|
}
|
|
33914
34614
|
return _this;
|
|
33915
34615
|
}
|
|
33916
|
-
_createClass$
|
|
34616
|
+
_createClass$h(Rts2, [{
|
|
33917
34617
|
key: "pc",
|
|
33918
34618
|
get: function get3() {
|
|
33919
34619
|
return this._pc;
|
|
@@ -33954,12 +34654,12 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
33954
34654
|
}, {
|
|
33955
34655
|
key: "load",
|
|
33956
34656
|
value: function() {
|
|
33957
|
-
var _load = _asyncToGenerator$9(/* @__PURE__ */ _regeneratorRuntime$9().mark(function
|
|
34657
|
+
var _load = _asyncToGenerator$9(/* @__PURE__ */ _regeneratorRuntime$9().mark(function _callee3(url) {
|
|
33958
34658
|
var _this2 = this;
|
|
33959
|
-
var lastPc;
|
|
33960
|
-
return _regeneratorRuntime$9().wrap(function
|
|
34659
|
+
var lastPc, encodedTransformSupported;
|
|
34660
|
+
return _regeneratorRuntime$9().wrap(function _callee3$(_context3) {
|
|
33961
34661
|
while (1)
|
|
33962
|
-
switch (
|
|
34662
|
+
switch (_context3.prev = _context3.next) {
|
|
33963
34663
|
case 0:
|
|
33964
34664
|
this._disconnect();
|
|
33965
34665
|
this._url = url;
|
|
@@ -33968,25 +34668,28 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
33968
34668
|
if (lastPc) {
|
|
33969
34669
|
lastPc.close();
|
|
33970
34670
|
}
|
|
33971
|
-
|
|
33972
|
-
|
|
34671
|
+
encodedTransformSupported = isLegacyEncodedTransformSupported();
|
|
34672
|
+
_context3.prev = 6;
|
|
34673
|
+
this._pc = new RTCPeerConnection({
|
|
34674
|
+
encodedInsertableStreams: encodedTransformSupported && this._opts.enableSei ? true : void 0
|
|
34675
|
+
});
|
|
33973
34676
|
this._bindRTCEvents();
|
|
33974
|
-
|
|
34677
|
+
_context3.next = 11;
|
|
33975
34678
|
return this._connect(url);
|
|
33976
|
-
case
|
|
33977
|
-
|
|
34679
|
+
case 11:
|
|
34680
|
+
_context3.next = 16;
|
|
33978
34681
|
break;
|
|
33979
|
-
case
|
|
33980
|
-
|
|
33981
|
-
|
|
34682
|
+
case 13:
|
|
34683
|
+
_context3.prev = 13;
|
|
34684
|
+
_context3.t0 = _context3["catch"](6);
|
|
33982
34685
|
setTimeout(function() {
|
|
33983
|
-
return _this2._emitError(StreamingError$2.create(ERR$2.OTHER, null,
|
|
34686
|
+
return _this2._emitError(StreamingError$2.create(ERR$2.OTHER, null, _context3.t0));
|
|
33984
34687
|
});
|
|
33985
|
-
case
|
|
34688
|
+
case 16:
|
|
33986
34689
|
case "end":
|
|
33987
|
-
return
|
|
34690
|
+
return _context3.stop();
|
|
33988
34691
|
}
|
|
33989
|
-
},
|
|
34692
|
+
}, _callee3, this, [[6, 13]]);
|
|
33990
34693
|
}));
|
|
33991
34694
|
function load(_x) {
|
|
33992
34695
|
return _load.apply(this, arguments);
|
|
@@ -34028,6 +34731,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
34028
34731
|
responseUrl: _this3._url,
|
|
34029
34732
|
elapsed: Date.now() - _this3._rctConnectStartTs
|
|
34030
34733
|
});
|
|
34734
|
+
_this3._checkStatsError();
|
|
34031
34735
|
}
|
|
34032
34736
|
});
|
|
34033
34737
|
}
|
|
@@ -34065,6 +34769,54 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
34065
34769
|
}
|
|
34066
34770
|
}
|
|
34067
34771
|
}
|
|
34772
|
+
}, {
|
|
34773
|
+
key: "initVideoEncodedTransform",
|
|
34774
|
+
value: function initVideoEncodedTransform() {
|
|
34775
|
+
var _this5 = this;
|
|
34776
|
+
if (!this._videoTransceicer || !this._videoTransceicer.receiver) {
|
|
34777
|
+
console.log("no receiver found when trying to bind encodedTransform");
|
|
34778
|
+
return;
|
|
34779
|
+
}
|
|
34780
|
+
var receiver = this._videoTransceicer.receiver;
|
|
34781
|
+
if (isLegacyEncodedTransformSupported()) {
|
|
34782
|
+
var _receiver$createEncod = receiver.createEncodedStreams(), readable = _receiver$createEncod.readable, writable = _receiver$createEncod.writable;
|
|
34783
|
+
readable.pipeThrough(receiveSEITransform(function(sei) {
|
|
34784
|
+
_this5.emit(EVENT$2.SEI, sei);
|
|
34785
|
+
})).pipeTo(writable);
|
|
34786
|
+
} else if (isEncodedTransformSupported()) {
|
|
34787
|
+
var worker = new WorkerWrapper$5();
|
|
34788
|
+
var channel2 = new MessageChannel();
|
|
34789
|
+
this._videoTransceicer.receiver.transform = new RTCRtpScriptTransform(worker, {
|
|
34790
|
+
port: channel2.port2
|
|
34791
|
+
}, [channel2.port2]);
|
|
34792
|
+
channel2.port1.onmessage = function(e4) {
|
|
34793
|
+
_this5.emit(EVENT$2.SEI, e4.data);
|
|
34794
|
+
};
|
|
34795
|
+
}
|
|
34796
|
+
}
|
|
34797
|
+
}, {
|
|
34798
|
+
key: "initAudioEncodedTransform",
|
|
34799
|
+
value: function initAudioEncodedTransform() {
|
|
34800
|
+
if (!this._audioTransceicer || !this._audioTransceicer.receiver) {
|
|
34801
|
+
logger$9.warn("no receiver found when trying to bind encodedTransform");
|
|
34802
|
+
return;
|
|
34803
|
+
}
|
|
34804
|
+
if (!isLegacyEncodedTransformSupported()) {
|
|
34805
|
+
logger$9.warn("legacy EncodedTransform is not supported");
|
|
34806
|
+
return;
|
|
34807
|
+
}
|
|
34808
|
+
var receiver = this._audioTransceicer.receiver;
|
|
34809
|
+
var _receiver$createEncod2 = receiver.createEncodedStreams(), readable = _receiver$createEncod2.readable, writable = _receiver$createEncod2.writable;
|
|
34810
|
+
readable.pipeThrough(new TransformStream({
|
|
34811
|
+
transform: function transform(chunk, controller) {
|
|
34812
|
+
if (chunk.data.byteLength <= 1e3) {
|
|
34813
|
+
controller.enqueue(chunk);
|
|
34814
|
+
} else {
|
|
34815
|
+
logger$9.log("too large audio frame", chunk.data.byteLength);
|
|
34816
|
+
}
|
|
34817
|
+
}
|
|
34818
|
+
})).pipeTo(writable);
|
|
34819
|
+
}
|
|
34068
34820
|
}, {
|
|
34069
34821
|
key: "_bindMediaEvent",
|
|
34070
34822
|
value: function _bindMediaEvent() {
|
|
@@ -34074,15 +34826,15 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
34074
34826
|
}, {
|
|
34075
34827
|
key: "_connect",
|
|
34076
34828
|
value: function() {
|
|
34077
|
-
var _connect2 = _asyncToGenerator$9(/* @__PURE__ */ _regeneratorRuntime$9().mark(function
|
|
34078
|
-
var pc, offer,
|
|
34079
|
-
return _regeneratorRuntime$9().wrap(function
|
|
34829
|
+
var _connect2 = _asyncToGenerator$9(/* @__PURE__ */ _regeneratorRuntime$9().mark(function _callee4() {
|
|
34830
|
+
var pc, offer, parsed, finnalUrl, _this$_opts, _answer$remoteSdp, _this$_opts2, _answer$remoteSdp2, _parsed$media, parseSession, sessionId, reqStart, res, answer, err, _parsed;
|
|
34831
|
+
return _regeneratorRuntime$9().wrap(function _callee4$(_context4) {
|
|
34080
34832
|
while (1)
|
|
34081
|
-
switch (
|
|
34833
|
+
switch (_context4.prev = _context4.next) {
|
|
34082
34834
|
case 0:
|
|
34083
34835
|
pc = this._pc;
|
|
34084
34836
|
if (!pc.addTransceiver) {
|
|
34085
|
-
|
|
34837
|
+
_context4.next = 11;
|
|
34086
34838
|
break;
|
|
34087
34839
|
}
|
|
34088
34840
|
this._audioTransceicer = pc.addTransceiver("audio", {
|
|
@@ -34091,28 +34843,26 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
34091
34843
|
this._videoTransceicer = pc.addTransceiver("video", {
|
|
34092
34844
|
direction: "recvonly"
|
|
34093
34845
|
});
|
|
34094
|
-
|
|
34095
|
-
if (
|
|
34096
|
-
this.
|
|
34097
|
-
this.
|
|
34098
|
-
this._videoTransceicer.receiver.playoutDelayHint = delayHint;
|
|
34099
|
-
this._videoTransceicer.receiver.jitterBufferDelayHint = delayHint;
|
|
34846
|
+
this._setDelay(this._opts.delayHint);
|
|
34847
|
+
if (this._opts.enableSei) {
|
|
34848
|
+
this.initVideoEncodedTransform();
|
|
34849
|
+
this.initAudioEncodedTransform();
|
|
34100
34850
|
}
|
|
34101
|
-
|
|
34851
|
+
_context4.next = 8;
|
|
34102
34852
|
return pc.createOffer();
|
|
34103
34853
|
case 8:
|
|
34104
|
-
offer =
|
|
34105
|
-
|
|
34854
|
+
offer = _context4.sent;
|
|
34855
|
+
_context4.next = 14;
|
|
34106
34856
|
break;
|
|
34107
34857
|
case 11:
|
|
34108
|
-
|
|
34858
|
+
_context4.next = 13;
|
|
34109
34859
|
return pc.createOffer({
|
|
34110
34860
|
iceRestart: true,
|
|
34111
34861
|
offerToReceiveAudio: true,
|
|
34112
34862
|
offerToReceiveVideo: true
|
|
34113
34863
|
});
|
|
34114
34864
|
case 13:
|
|
34115
|
-
offer =
|
|
34865
|
+
offer = _context4.sent;
|
|
34116
34866
|
case 14:
|
|
34117
34867
|
logger$9.log("local offer");
|
|
34118
34868
|
logger$9.log(offer.sdp);
|
|
@@ -34138,11 +34888,11 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
34138
34888
|
});
|
|
34139
34889
|
offer.sdp = lib$1.write(parsed);
|
|
34140
34890
|
logger$9.log("local offer modified:\n", offer.sdp);
|
|
34141
|
-
|
|
34891
|
+
_context4.next = 22;
|
|
34142
34892
|
return pc.setLocalDescription(offer);
|
|
34143
34893
|
case 22:
|
|
34144
34894
|
finnalUrl = this._url;
|
|
34145
|
-
|
|
34895
|
+
_context4.prev = 23;
|
|
34146
34896
|
if (this._opts.preProcessUrl) {
|
|
34147
34897
|
finnalUrl = this._opts.preProcessUrl(finnalUrl).url;
|
|
34148
34898
|
}
|
|
@@ -34155,7 +34905,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
34155
34905
|
sessionId
|
|
34156
34906
|
});
|
|
34157
34907
|
reqStart = Date.now();
|
|
34158
|
-
|
|
34908
|
+
_context4.next = 32;
|
|
34159
34909
|
return this._loader.load(finnalUrl, {
|
|
34160
34910
|
body: JSON.stringify({
|
|
34161
34911
|
sessionId,
|
|
@@ -34164,22 +34914,22 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
34164
34914
|
})
|
|
34165
34915
|
});
|
|
34166
34916
|
case 32:
|
|
34167
|
-
res =
|
|
34917
|
+
res = _context4.sent;
|
|
34168
34918
|
this.emit(EVENT$2.LOAD_RESPONSE_HEADERS, {
|
|
34169
34919
|
headers: res.response.headers
|
|
34170
34920
|
});
|
|
34171
34921
|
answer = res === null || res === void 0 ? void 0 : res.data;
|
|
34172
34922
|
if (!((answer === null || answer === void 0 ? void 0 : answer.code) === 404 || (answer === null || answer === void 0 ? void 0 : answer.code) === 403)) {
|
|
34173
|
-
|
|
34923
|
+
_context4.next = 40;
|
|
34174
34924
|
break;
|
|
34175
34925
|
}
|
|
34176
34926
|
err = StreamingError$2.create(answer.code === 404 ? ERR$2.NETWORK_NOTFOUND : ERR$2.NETWORK_FORBIDDEN, null, answer);
|
|
34177
34927
|
err.errorType = ERR$2.NETWORK;
|
|
34178
34928
|
this._emitError(err);
|
|
34179
|
-
return
|
|
34929
|
+
return _context4.abrupt("return");
|
|
34180
34930
|
case 40:
|
|
34181
34931
|
if (!((answer === null || answer === void 0 ? void 0 : answer.code) !== 200)) {
|
|
34182
|
-
|
|
34932
|
+
_context4.next = 42;
|
|
34183
34933
|
break;
|
|
34184
34934
|
}
|
|
34185
34935
|
throw new Error("code: ".concat(answer === null || answer === void 0 ? void 0 : answer.code, ", message:").concat(answer === null || answer === void 0 ? void 0 : answer.message));
|
|
@@ -34205,21 +34955,21 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
34205
34955
|
answer.remoteSdp.sdp = lib$1.write(_parsed);
|
|
34206
34956
|
logger$9.log("answer modified:\n", answer.remoteSdp.sdp);
|
|
34207
34957
|
this._rctConnectStartTs = Date.now();
|
|
34208
|
-
|
|
34958
|
+
_context4.next = 52;
|
|
34209
34959
|
return this._pc.setRemoteDescription(answer.remoteSdp);
|
|
34210
34960
|
case 52:
|
|
34211
34961
|
this._networkEvaluate = new NetworkEvaluate(pc, this._opts.networkEvaluateInterval);
|
|
34212
|
-
|
|
34962
|
+
_context4.next = 58;
|
|
34213
34963
|
break;
|
|
34214
34964
|
case 55:
|
|
34215
|
-
|
|
34216
|
-
|
|
34217
|
-
this._emitError(StreamingError$2.network(
|
|
34965
|
+
_context4.prev = 55;
|
|
34966
|
+
_context4.t0 = _context4["catch"](23);
|
|
34967
|
+
this._emitError(StreamingError$2.network(_context4.t0));
|
|
34218
34968
|
case 58:
|
|
34219
34969
|
case "end":
|
|
34220
|
-
return
|
|
34970
|
+
return _context4.stop();
|
|
34221
34971
|
}
|
|
34222
|
-
},
|
|
34972
|
+
}, _callee4, this, [[23, 55]]);
|
|
34223
34973
|
}));
|
|
34224
34974
|
function _connect() {
|
|
34225
34975
|
return _connect2.apply(this, arguments);
|
|
@@ -34241,6 +34991,10 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
34241
34991
|
key: "_emitError",
|
|
34242
34992
|
value: function _emitError(error) {
|
|
34243
34993
|
this.emit(EVENT$2.ERROR, error);
|
|
34994
|
+
clearTimeout(this._checkStatsErrorTimer);
|
|
34995
|
+
if (this._pc) {
|
|
34996
|
+
this._pc.close();
|
|
34997
|
+
}
|
|
34244
34998
|
}
|
|
34245
34999
|
}, {
|
|
34246
35000
|
key: "destroy",
|
|
@@ -34257,6 +35011,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
34257
35011
|
this._loader = null;
|
|
34258
35012
|
this._media = null;
|
|
34259
35013
|
this._pc = null;
|
|
35014
|
+
this._opts = null;
|
|
34260
35015
|
}
|
|
34261
35016
|
}], [{
|
|
34262
35017
|
key: "enableLogger",
|
|
@@ -34279,70 +35034,12 @@ try {
|
|
|
34279
35034
|
}
|
|
34280
35035
|
} catch (error) {
|
|
34281
35036
|
}
|
|
34282
|
-
function isSupported$1() {
|
|
34283
|
-
if (!window.RTCPeerConnection || !window.RTCPeerConnection.prototype.addTransceiver) {
|
|
34284
|
-
return false;
|
|
34285
|
-
}
|
|
34286
|
-
return true;
|
|
34287
|
-
}
|
|
34288
|
-
function getCapacity() {
|
|
34289
|
-
if (!isSupported$1())
|
|
34290
|
-
return Promise.reject("RTCPeerConnection no support");
|
|
34291
|
-
var pc;
|
|
34292
|
-
try {
|
|
34293
|
-
pc = new RTCPeerConnection();
|
|
34294
|
-
pc.addTransceiver("video", {
|
|
34295
|
-
direction: "recvonly"
|
|
34296
|
-
});
|
|
34297
|
-
pc.addTransceiver("audio", {
|
|
34298
|
-
direction: "recvonly"
|
|
34299
|
-
});
|
|
34300
|
-
} catch (e4) {
|
|
34301
|
-
return Promise.reject(e4 === null || e4 === void 0 ? void 0 : e4.message);
|
|
34302
|
-
}
|
|
34303
|
-
return pc.createOffer().then(function(offer) {
|
|
34304
|
-
var _sdpJson$media, _sdpJson$media2, _vMedia$rtp, _aMedia$rtp;
|
|
34305
|
-
logger$9.log(offer.sdp);
|
|
34306
|
-
var sdpJson = lib$1.parse(offer.sdp);
|
|
34307
|
-
var vMedia = (_sdpJson$media = sdpJson.media) === null || _sdpJson$media === void 0 ? void 0 : _sdpJson$media.filter(function(x2) {
|
|
34308
|
-
return x2.type === "video";
|
|
34309
|
-
})[0];
|
|
34310
|
-
var aMedia = (_sdpJson$media2 = sdpJson.media) === null || _sdpJson$media2 === void 0 ? void 0 : _sdpJson$media2.filter(function(x2) {
|
|
34311
|
-
return x2.type === "audio";
|
|
34312
|
-
})[0];
|
|
34313
|
-
var vCodecs = vMedia === null || vMedia === void 0 ? void 0 : (_vMedia$rtp = vMedia.rtp) === null || _vMedia$rtp === void 0 ? void 0 : _vMedia$rtp.filter(function(x2) {
|
|
34314
|
-
return x2.codec === "VP8" || x2.codec === "VP9" || x2.codec === "H264";
|
|
34315
|
-
});
|
|
34316
|
-
var aCodecs = aMedia === null || aMedia === void 0 ? void 0 : (_aMedia$rtp = aMedia.rtp) === null || _aMedia$rtp === void 0 ? void 0 : _aMedia$rtp.filter(function(x2) {
|
|
34317
|
-
return x2.codec === "opus";
|
|
34318
|
-
});
|
|
34319
|
-
var vFmtp = vMedia === null || vMedia === void 0 ? void 0 : vMedia.fmtp;
|
|
34320
|
-
var aFmtp = aMedia === null || aMedia === void 0 ? void 0 : aMedia.fmtp;
|
|
34321
|
-
vFmtp && vCodecs.map(function(codec) {
|
|
34322
|
-
var _vFmtp$filter$;
|
|
34323
|
-
codec.config = (_vFmtp$filter$ = vFmtp.filter(function(x2) {
|
|
34324
|
-
return x2.payload === codec.payload;
|
|
34325
|
-
})[0]) === null || _vFmtp$filter$ === void 0 ? void 0 : _vFmtp$filter$.config;
|
|
34326
|
-
});
|
|
34327
|
-
aFmtp && aCodecs.map(function(codec) {
|
|
34328
|
-
var _aFmtp$filter$;
|
|
34329
|
-
codec.config = (_aFmtp$filter$ = aFmtp.filter(function(x2) {
|
|
34330
|
-
return x2.payload === codec.payload;
|
|
34331
|
-
})[0]) === null || _aFmtp$filter$ === void 0 ? void 0 : _aFmtp$filter$.config;
|
|
34332
|
-
});
|
|
34333
|
-
pc.close();
|
|
34334
|
-
return {
|
|
34335
|
-
video: vCodecs,
|
|
34336
|
-
audio: aCodecs
|
|
34337
|
-
};
|
|
34338
|
-
});
|
|
34339
|
-
}
|
|
34340
35037
|
var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
34341
35038
|
_inherits$c(RtsPlugin2, _BasePlugin);
|
|
34342
35039
|
var _super = _createSuper$c(RtsPlugin2);
|
|
34343
35040
|
function RtsPlugin2() {
|
|
34344
35041
|
var _this;
|
|
34345
|
-
_classCallCheck$
|
|
35042
|
+
_classCallCheck$h(this, RtsPlugin2);
|
|
34346
35043
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
34347
35044
|
args[_key] = arguments[_key];
|
|
34348
35045
|
}
|
|
@@ -34407,7 +35104,7 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
34407
35104
|
});
|
|
34408
35105
|
return _this;
|
|
34409
35106
|
}
|
|
34410
|
-
_createClass$
|
|
35107
|
+
_createClass$h(RtsPlugin2, [{
|
|
34411
35108
|
key: "pc",
|
|
34412
35109
|
get: function get3() {
|
|
34413
35110
|
var _this$_rts4;
|
|
@@ -34439,7 +35136,7 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
34439
35136
|
}, {
|
|
34440
35137
|
key: "version",
|
|
34441
35138
|
get: function get3() {
|
|
34442
|
-
return "0.2.1-alpha.
|
|
35139
|
+
return "0.2.1-alpha.24";
|
|
34443
35140
|
}
|
|
34444
35141
|
}, {
|
|
34445
35142
|
key: "beforePlayerInit",
|
|
@@ -34534,6 +35231,7 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
34534
35231
|
this._transCoreEvent(EVENT$2.LOAD_RESPONSE_HEADERS);
|
|
34535
35232
|
this._transCoreEvent(EVENT$2.LOAD_RETRY);
|
|
34536
35233
|
this._transCoreEvent(EVENT$2.METADATA_PARSED);
|
|
35234
|
+
this._transCoreEvent(EVENT$2.SEI);
|
|
34537
35235
|
this._transCoreEvent(EXTEND_EVENTS.RTC_STATE_CHANGE);
|
|
34538
35236
|
}
|
|
34539
35237
|
}, {
|
|
@@ -66559,7 +67257,7 @@ var clear$1 = global$13.clearImmediate;
|
|
|
66559
67257
|
var process$8 = global$13.process;
|
|
66560
67258
|
var Dispatch$1 = global$13.Dispatch;
|
|
66561
67259
|
var Function$4 = global$13.Function;
|
|
66562
|
-
var MessageChannel$
|
|
67260
|
+
var MessageChannel$2 = global$13.MessageChannel;
|
|
66563
67261
|
var String$2 = global$13.String;
|
|
66564
67262
|
var counter$1 = 0;
|
|
66565
67263
|
var queue$4 = {};
|
|
@@ -66609,8 +67307,8 @@ if (!set$4 || !clear$1) {
|
|
|
66609
67307
|
defer$1 = function(id2) {
|
|
66610
67308
|
Dispatch$1.now(runner$1(id2));
|
|
66611
67309
|
};
|
|
66612
|
-
} else if (MessageChannel$
|
|
66613
|
-
channel$1 = new MessageChannel$
|
|
67310
|
+
} else if (MessageChannel$2 && !IS_IOS$3) {
|
|
67311
|
+
channel$1 = new MessageChannel$2();
|
|
66614
67312
|
port$1 = channel$1.port2;
|
|
66615
67313
|
channel$1.port1.onmessage = listener;
|
|
66616
67314
|
defer$1 = bind$k(port$1.postMessage, port$1);
|
|
@@ -92878,7 +93576,7 @@ var clear = global$o.clearImmediate;
|
|
|
92878
93576
|
var process$4 = global$o.process;
|
|
92879
93577
|
var Dispatch = global$o.Dispatch;
|
|
92880
93578
|
var Function$1 = global$o.Function;
|
|
92881
|
-
var MessageChannel = global$o.MessageChannel;
|
|
93579
|
+
var MessageChannel$1 = global$o.MessageChannel;
|
|
92882
93580
|
var String$1 = global$o.String;
|
|
92883
93581
|
var counter = 0;
|
|
92884
93582
|
var queue$2 = {};
|
|
@@ -92927,8 +93625,8 @@ if (!set$1 || !clear) {
|
|
|
92927
93625
|
defer = function(id2) {
|
|
92928
93626
|
Dispatch.now(runner(id2));
|
|
92929
93627
|
};
|
|
92930
|
-
} else if (MessageChannel && !IS_IOS$1) {
|
|
92931
|
-
channel = new MessageChannel();
|
|
93628
|
+
} else if (MessageChannel$1 && !IS_IOS$1) {
|
|
93629
|
+
channel = new MessageChannel$1();
|
|
92932
93630
|
port = channel.port2;
|
|
92933
93631
|
channel.port1.onmessage = eventListener;
|
|
92934
93632
|
defer = bind$8(port.postMessage, port);
|