@volcengine/veplayer-plugin 2.4.2-rc.0 → 2.4.2-rc.1
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 +120 -82
- package/esm/index.production.js +1 -1
- package/esm/veplayer.plugin.rtm.development.js +94 -56
- package/esm/veplayer.plugin.rtm.production.js +1 -1
- package/package.json +1 -1
- package/umd/veplayer.plugin.rtm.development.js +94 -56
- package/umd/veplayer.plugin.rtm.production.js +1 -1
package/esm/index.development.js
CHANGED
|
@@ -342,13 +342,13 @@ function _regeneratorRuntime$a() {
|
|
|
342
342
|
}
|
|
343
343
|
}, exports;
|
|
344
344
|
}
|
|
345
|
-
function _typeof$
|
|
345
|
+
function _typeof$b(obj) {
|
|
346
346
|
"@babel/helpers - typeof";
|
|
347
|
-
return _typeof$
|
|
347
|
+
return _typeof$b = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
|
|
348
348
|
return typeof obj2;
|
|
349
349
|
} : function(obj2) {
|
|
350
350
|
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
351
|
-
}, _typeof$
|
|
351
|
+
}, _typeof$b(obj);
|
|
352
352
|
}
|
|
353
353
|
function asyncGeneratorStep$a(gen, resolve3, reject3, _next, _throw, key2, arg) {
|
|
354
354
|
try {
|
|
@@ -527,13 +527,13 @@ function _objectSpread2$9(target) {
|
|
|
527
527
|
}
|
|
528
528
|
return target;
|
|
529
529
|
}
|
|
530
|
-
function _typeof$
|
|
530
|
+
function _typeof$a(obj) {
|
|
531
531
|
"@babel/helpers - typeof";
|
|
532
|
-
return _typeof$
|
|
532
|
+
return _typeof$a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
|
|
533
533
|
return typeof obj2;
|
|
534
534
|
} : function(obj2) {
|
|
535
535
|
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
536
|
-
}, _typeof$
|
|
536
|
+
}, _typeof$a(obj);
|
|
537
537
|
}
|
|
538
538
|
function _classCallCheck$i(instance, Constructor2) {
|
|
539
539
|
if (!(instance instanceof Constructor2)) {
|
|
@@ -922,7 +922,7 @@ util$2.hasClass = function(el, className) {
|
|
|
922
922
|
return item === className;
|
|
923
923
|
});
|
|
924
924
|
} catch (e) {
|
|
925
|
-
var orgClassName = el.className && _typeof$
|
|
925
|
+
var orgClassName = el.className && _typeof$a(el.className) === "object" ? el.getAttribute("class") : el.className;
|
|
926
926
|
return orgClassName && !!orgClassName.match(new RegExp("(\\s|^)" + className + "(\\s|$)"));
|
|
927
927
|
}
|
|
928
928
|
};
|
|
@@ -936,7 +936,7 @@ util$2.addClass = function(el, className) {
|
|
|
936
936
|
});
|
|
937
937
|
} catch (e) {
|
|
938
938
|
if (!util$2.hasClass(el, className)) {
|
|
939
|
-
if (el.className && _typeof$
|
|
939
|
+
if (el.className && _typeof$a(el.className) === "object") {
|
|
940
940
|
el.setAttribute("class", el.getAttribute("class") + " " + className);
|
|
941
941
|
} else {
|
|
942
942
|
el.className += " " + className;
|
|
@@ -956,7 +956,7 @@ util$2.removeClass = function(el, className) {
|
|
|
956
956
|
if (util$2.hasClass(el, className)) {
|
|
957
957
|
className.split(/\s+/g).forEach(function(item) {
|
|
958
958
|
var reg = new RegExp("(\\s|^)" + item + "(\\s|$)");
|
|
959
|
-
if (el.className && _typeof$
|
|
959
|
+
if (el.className && _typeof$a(el.className) === "object") {
|
|
960
960
|
el.setAttribute("class", el.getAttribute("class").replace(reg, " "));
|
|
961
961
|
} else {
|
|
962
962
|
el.className = el.className.replace(reg, " ");
|
|
@@ -1197,7 +1197,7 @@ util$2.checkIsFunction = function(fun) {
|
|
|
1197
1197
|
return fun && typeof fun === "function";
|
|
1198
1198
|
};
|
|
1199
1199
|
util$2.checkIsObject = function(obj) {
|
|
1200
|
-
return obj !== null && _typeof$
|
|
1200
|
+
return obj !== null && _typeof$a(obj) === "object";
|
|
1201
1201
|
};
|
|
1202
1202
|
util$2.hide = function(dom) {
|
|
1203
1203
|
dom.style.display = "none";
|
|
@@ -2465,13 +2465,13 @@ function _regeneratorRuntime$9() {
|
|
|
2465
2465
|
}
|
|
2466
2466
|
}, exports;
|
|
2467
2467
|
}
|
|
2468
|
-
function _typeof$
|
|
2468
|
+
function _typeof$9(obj) {
|
|
2469
2469
|
"@babel/helpers - typeof";
|
|
2470
|
-
return _typeof$
|
|
2470
|
+
return _typeof$9 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
|
|
2471
2471
|
return typeof obj2;
|
|
2472
2472
|
} : function(obj2) {
|
|
2473
2473
|
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
2474
|
-
}, _typeof$
|
|
2474
|
+
}, _typeof$9(obj);
|
|
2475
2475
|
}
|
|
2476
2476
|
function asyncGeneratorStep$9(gen, resolve3, reject3, _next, _throw, key2, arg) {
|
|
2477
2477
|
try {
|
|
@@ -3187,7 +3187,7 @@ function nowTime$7() {
|
|
|
3187
3187
|
return (/* @__PURE__ */ new Date()).toLocaleString();
|
|
3188
3188
|
}
|
|
3189
3189
|
function reduceDepth$2(val) {
|
|
3190
|
-
if (_typeof$
|
|
3190
|
+
if (_typeof$9(val) !== "object") {
|
|
3191
3191
|
return val;
|
|
3192
3192
|
}
|
|
3193
3193
|
var objType = Object.prototype.toString.call(val).slice(8, -1);
|
|
@@ -3208,7 +3208,7 @@ function logable$2(obj, maxDepth, depth) {
|
|
|
3208
3208
|
if (!maxDepth)
|
|
3209
3209
|
maxDepth = 2;
|
|
3210
3210
|
var result = {};
|
|
3211
|
-
if (!obj || _typeof$
|
|
3211
|
+
if (!obj || _typeof$9(obj) !== "object") {
|
|
3212
3212
|
return obj;
|
|
3213
3213
|
}
|
|
3214
3214
|
var objType = Object.prototype.toString.call(obj).slice(8, -1);
|
|
@@ -3222,7 +3222,7 @@ function logable$2(obj, maxDepth, depth) {
|
|
|
3222
3222
|
if (Object.prototype.hasOwnProperty.call(obj, key2)) {
|
|
3223
3223
|
if (depth === maxDepth) {
|
|
3224
3224
|
result[key2] = reduceDepth$2(obj[key2]);
|
|
3225
|
-
} else if (_typeof$
|
|
3225
|
+
} else if (_typeof$9(obj[key2]) === "object") {
|
|
3226
3226
|
result[key2] = logable$2(obj[key2], maxDepth, depth + 1);
|
|
3227
3227
|
} else {
|
|
3228
3228
|
result[key2] = obj[key2];
|
|
@@ -3862,7 +3862,7 @@ var MSE$3 = /* @__PURE__ */ function() {
|
|
|
3862
3862
|
} catch (error) {
|
|
3863
3863
|
if (error && error.message && error.message.indexOf("SourceBuffer is full") >= 0) {
|
|
3864
3864
|
this._mseFullFlag[type] = true;
|
|
3865
|
-
if (op.context && _typeof$
|
|
3865
|
+
if (op.context && _typeof$9(op.context) === "object") {
|
|
3866
3866
|
op.context.isFull = true;
|
|
3867
3867
|
}
|
|
3868
3868
|
this._logger.error("[MSE error], context,", op.context, " ,name,", op.opName, ",err,SourceBuffer is full");
|
|
@@ -3964,7 +3964,7 @@ var NetError$3 = /* @__PURE__ */ function(_Error) {
|
|
|
3964
3964
|
}(/* @__PURE__ */ _wrapNativeSuper$4(Error));
|
|
3965
3965
|
var toString$z = Object.prototype.toString;
|
|
3966
3966
|
function isObject$N(a) {
|
|
3967
|
-
return a !== null && _typeof$
|
|
3967
|
+
return a !== null && _typeof$9(a) === "object";
|
|
3968
3968
|
}
|
|
3969
3969
|
function isPlainObject$3(val) {
|
|
3970
3970
|
if (toString$z.call(val) !== "[object Object]") {
|
|
@@ -12819,7 +12819,7 @@ var FlvPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
12819
12819
|
if (_this.flv) {
|
|
12820
12820
|
var _this$player$config, _this$player$config$f;
|
|
12821
12821
|
_this.player.config.url = url;
|
|
12822
|
-
if (_typeof$
|
|
12822
|
+
if (_typeof$b(seamless) === "object") {
|
|
12823
12823
|
seamless = seamless.seamless;
|
|
12824
12824
|
}
|
|
12825
12825
|
_this.flv.switchURL(url, seamless);
|
|
@@ -13016,13 +13016,13 @@ function _toPropertyKey$5(t) {
|
|
|
13016
13016
|
var i = _toPrimitive$5(t, "string");
|
|
13017
13017
|
return "symbol" == typeof i ? i : String(i);
|
|
13018
13018
|
}
|
|
13019
|
-
function _typeof$
|
|
13019
|
+
function _typeof$8(o) {
|
|
13020
13020
|
"@babel/helpers - typeof";
|
|
13021
|
-
return _typeof$
|
|
13021
|
+
return _typeof$8 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
13022
13022
|
return typeof o2;
|
|
13023
13023
|
} : function(o2) {
|
|
13024
13024
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
13025
|
-
}, _typeof$
|
|
13025
|
+
}, _typeof$8(o);
|
|
13026
13026
|
}
|
|
13027
13027
|
function _classCallCheck$f(instance, Constructor2) {
|
|
13028
13028
|
if (!(instance instanceof Constructor2)) {
|
|
@@ -13389,7 +13389,7 @@ var abrAlgo = function() {
|
|
|
13389
13389
|
} else {
|
|
13390
13390
|
scriptDirectory = "";
|
|
13391
13391
|
}
|
|
13392
|
-
if (!((typeof window === "undefined" ? "undefined" : _typeof$
|
|
13392
|
+
if (!((typeof window === "undefined" ? "undefined" : _typeof$8(window)) === "object" || typeof importScripts === "function"))
|
|
13393
13393
|
throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
|
|
13394
13394
|
}
|
|
13395
13395
|
var out = Module["print"] || console.log.bind(console);
|
|
@@ -24120,7 +24120,7 @@ var abrAlgo = function() {
|
|
|
24120
24120
|
RuntimeError: Error
|
|
24121
24121
|
};
|
|
24122
24122
|
wasmBinary = [];
|
|
24123
|
-
if (_typeof$
|
|
24123
|
+
if (_typeof$8(WebAssembly2) !== "object") {
|
|
24124
24124
|
abort("no native wasm support detected");
|
|
24125
24125
|
}
|
|
24126
24126
|
var wasmMemory;
|
|
@@ -25930,7 +25930,7 @@ var Algo = /* @__PURE__ */ function() {
|
|
|
25930
25930
|
}, {
|
|
25931
25931
|
key: "updateDeviceInfo",
|
|
25932
25932
|
value: function updateDeviceInfo() {
|
|
25933
|
-
var devicePixelRatio = (typeof window === "undefined" ? "undefined" : _typeof$
|
|
25933
|
+
var devicePixelRatio = (typeof window === "undefined" ? "undefined" : _typeof$8(window)) === "object" ? window.devicePixelRatio || 1 : 1;
|
|
25934
25934
|
var _this$player$video$ge = this.player.video.getBoundingClientRect(), width = _this$player$video$ge.width, height = _this$player$video$ge.height;
|
|
25935
25935
|
this.module._updateDeviceInfo(Math.floor(width), Math.floor(height), devicePixelRatio, 30);
|
|
25936
25936
|
}
|
|
@@ -27165,6 +27165,14 @@ function _regeneratorRuntime$8() {
|
|
|
27165
27165
|
}
|
|
27166
27166
|
}, exports;
|
|
27167
27167
|
}
|
|
27168
|
+
function _typeof$7(obj) {
|
|
27169
|
+
"@babel/helpers - typeof";
|
|
27170
|
+
return _typeof$7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
|
|
27171
|
+
return typeof obj2;
|
|
27172
|
+
} : function(obj2) {
|
|
27173
|
+
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
27174
|
+
}, _typeof$7(obj);
|
|
27175
|
+
}
|
|
27168
27176
|
function asyncGeneratorStep$8(gen, resolve3, reject3, _next, _throw, key2, arg) {
|
|
27169
27177
|
try {
|
|
27170
27178
|
var info = gen[key2](arg);
|
|
@@ -30439,6 +30447,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
30439
30447
|
_defineProperty$c(_assertThisInitialized$b(_this), "_audioTransceicer", null);
|
|
30440
30448
|
_defineProperty$c(_assertThisInitialized$b(_this), "_videoTransceicer", null);
|
|
30441
30449
|
_defineProperty$c(_assertThisInitialized$b(_this), "_mediaStream", null);
|
|
30450
|
+
_defineProperty$c(_assertThisInitialized$b(_this), "_lastMediaStream", null);
|
|
30442
30451
|
_defineProperty$c(_assertThisInitialized$b(_this), "_media", null);
|
|
30443
30452
|
_defineProperty$c(_assertThisInitialized$b(_this), "_opts", null);
|
|
30444
30453
|
_defineProperty$c(_assertThisInitialized$b(_this), "_loader", null);
|
|
@@ -30446,6 +30455,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
30446
30455
|
_defineProperty$c(_assertThisInitialized$b(_this), "_retry", 0);
|
|
30447
30456
|
_defineProperty$c(_assertThisInitialized$b(_this), "_waitingTimer", 0);
|
|
30448
30457
|
_defineProperty$c(_assertThisInitialized$b(_this), "_rctConnectStartTs", 0);
|
|
30458
|
+
_defineProperty$c(_assertThisInitialized$b(_this), "_isReplacing", false);
|
|
30449
30459
|
_defineProperty$c(_assertThisInitialized$b(_this), "_onTrack", function(e) {
|
|
30450
30460
|
logger$6.log("addTrack: ", e.track, e.streams);
|
|
30451
30461
|
_this["_".concat(e.track.kind)] = e.track;
|
|
@@ -30496,6 +30506,9 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
30496
30506
|
}));
|
|
30497
30507
|
_this._retry = _this._opts.retryCount;
|
|
30498
30508
|
_this._bindMediaEvent();
|
|
30509
|
+
if (_this._opts.mediaStream && _this._opts.seamlesslyReload) {
|
|
30510
|
+
_this._lastMediaStream = _this._opts.mediaStream;
|
|
30511
|
+
}
|
|
30499
30512
|
return _this;
|
|
30500
30513
|
}
|
|
30501
30514
|
_createClass$e(Rts2, [{
|
|
@@ -30539,9 +30552,9 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
30539
30552
|
}, {
|
|
30540
30553
|
key: "load",
|
|
30541
30554
|
value: function() {
|
|
30542
|
-
var _load = _asyncToGenerator$8(/* @__PURE__ */ _regeneratorRuntime$8().mark(function _callee(url) {
|
|
30555
|
+
var _load = _asyncToGenerator$8(/* @__PURE__ */ _regeneratorRuntime$8().mark(function _callee(url, seamless) {
|
|
30543
30556
|
var _this2 = this;
|
|
30544
|
-
var
|
|
30557
|
+
var _this$_pc3;
|
|
30545
30558
|
return _regeneratorRuntime$8().wrap(function _callee$(_context) {
|
|
30546
30559
|
while (1)
|
|
30547
30560
|
switch (_context.prev = _context.next) {
|
|
@@ -30549,39 +30562,43 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
30549
30562
|
this._disconnect();
|
|
30550
30563
|
this._url = url;
|
|
30551
30564
|
this._retry = this._opts.retryCount;
|
|
30552
|
-
|
|
30553
|
-
|
|
30554
|
-
|
|
30565
|
+
if (seamless) {
|
|
30566
|
+
this._lastPc = this._pc;
|
|
30567
|
+
} else {
|
|
30568
|
+
(_this$_pc3 = this._pc) === null || _this$_pc3 === void 0 ? void 0 : _this$_pc3.close();
|
|
30555
30569
|
}
|
|
30556
|
-
_context.prev =
|
|
30570
|
+
_context.prev = 4;
|
|
30557
30571
|
this._pc = new RTCPeerConnection();
|
|
30558
30572
|
this._bindRTCEvents();
|
|
30559
|
-
_context.next =
|
|
30573
|
+
_context.next = 9;
|
|
30560
30574
|
return this._connect(url);
|
|
30561
|
-
case
|
|
30562
|
-
_context.next =
|
|
30575
|
+
case 9:
|
|
30576
|
+
_context.next = 14;
|
|
30563
30577
|
break;
|
|
30564
|
-
case
|
|
30565
|
-
_context.prev =
|
|
30566
|
-
_context.t0 = _context["catch"](
|
|
30578
|
+
case 11:
|
|
30579
|
+
_context.prev = 11;
|
|
30580
|
+
_context.t0 = _context["catch"](4);
|
|
30567
30581
|
setTimeout(function() {
|
|
30568
30582
|
return _this2._emitError(StreamingError$2.create(ERR$2.OTHER, null, _context.t0));
|
|
30569
30583
|
});
|
|
30570
|
-
case
|
|
30584
|
+
case 14:
|
|
30571
30585
|
case "end":
|
|
30572
30586
|
return _context.stop();
|
|
30573
30587
|
}
|
|
30574
|
-
}, _callee, this, [[
|
|
30588
|
+
}, _callee, this, [[4, 11]]);
|
|
30575
30589
|
}));
|
|
30576
|
-
function load(_x) {
|
|
30590
|
+
function load(_x, _x2) {
|
|
30577
30591
|
return _load.apply(this, arguments);
|
|
30578
30592
|
}
|
|
30579
30593
|
return load;
|
|
30580
30594
|
}()
|
|
30581
30595
|
}, {
|
|
30582
30596
|
key: "switchURL",
|
|
30583
|
-
value: function switchURL(url) {
|
|
30584
|
-
|
|
30597
|
+
value: function switchURL(url, seamless) {
|
|
30598
|
+
if (seamless) {
|
|
30599
|
+
this._lastMediaStream = this._mediaStream;
|
|
30600
|
+
}
|
|
30601
|
+
this.load(url || this._url, seamless);
|
|
30585
30602
|
}
|
|
30586
30603
|
}, {
|
|
30587
30604
|
key: "_bindRTCEvents",
|
|
@@ -30607,6 +30624,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
30607
30624
|
_this3.load(_this3._url);
|
|
30608
30625
|
}
|
|
30609
30626
|
if (pc.connectionState === "connected") {
|
|
30627
|
+
_this3._closeLastPc();
|
|
30610
30628
|
_this3._handleMediaStream();
|
|
30611
30629
|
_this3.emit(EVENT$2.TTFB, {
|
|
30612
30630
|
url: _this3._url,
|
|
@@ -30619,18 +30637,29 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
30619
30637
|
}, {
|
|
30620
30638
|
key: "_handleMediaStream",
|
|
30621
30639
|
value: function _handleMediaStream() {
|
|
30622
|
-
|
|
30623
|
-
|
|
30624
|
-
var
|
|
30640
|
+
var _this4 = this;
|
|
30641
|
+
if (this._lastMediaStream) {
|
|
30642
|
+
var _this$_media$play;
|
|
30643
|
+
var videoTrack = this._lastMediaStream.getVideoTracks()[0];
|
|
30644
|
+
var audioTrack = this._lastMediaStream.getAudioTracks()[0];
|
|
30625
30645
|
if (videoTrack) {
|
|
30626
|
-
this.
|
|
30646
|
+
this._lastMediaStream.removeTrack(videoTrack);
|
|
30627
30647
|
}
|
|
30628
30648
|
if (audioTrack) {
|
|
30629
|
-
this.
|
|
30630
|
-
}
|
|
30631
|
-
this._mediaStream = this.
|
|
30649
|
+
this._lastMediaStream.removeTrack(audioTrack);
|
|
30650
|
+
}
|
|
30651
|
+
this._mediaStream = this._lastMediaStream;
|
|
30652
|
+
this._mediaStream.addTrack(this._audio);
|
|
30653
|
+
this._mediaStream.addTrack(this._video);
|
|
30654
|
+
this._isReplacing = true;
|
|
30655
|
+
this._media.pause();
|
|
30656
|
+
(_this$_media$play = this._media.play()) === null || _this$_media$play === void 0 ? void 0 : _this$_media$play.finally(function() {
|
|
30657
|
+
_this4._isReplacing = false;
|
|
30658
|
+
});
|
|
30632
30659
|
} else {
|
|
30633
30660
|
this._mediaStream = new MediaStream();
|
|
30661
|
+
this._mediaStream.addTrack(this._audio);
|
|
30662
|
+
this._mediaStream.addTrack(this._video);
|
|
30634
30663
|
this._media.srcObject = this._mediaStream;
|
|
30635
30664
|
var req = this._media.play();
|
|
30636
30665
|
if (req && req.catch) {
|
|
@@ -30638,8 +30667,6 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
30638
30667
|
});
|
|
30639
30668
|
}
|
|
30640
30669
|
}
|
|
30641
|
-
this._mediaStream.addTrack(this._audio);
|
|
30642
|
-
this._mediaStream.addTrack(this._video);
|
|
30643
30670
|
}
|
|
30644
30671
|
}, {
|
|
30645
30672
|
key: "_bindMediaEvent",
|
|
@@ -30795,14 +30822,20 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
30795
30822
|
}
|
|
30796
30823
|
return _connect;
|
|
30797
30824
|
}()
|
|
30825
|
+
}, {
|
|
30826
|
+
key: "_closeLastPc",
|
|
30827
|
+
value: function _closeLastPc() {
|
|
30828
|
+
if (this._lastPc) {
|
|
30829
|
+
this._lastPc.close();
|
|
30830
|
+
this._lastPc = null;
|
|
30831
|
+
}
|
|
30832
|
+
}
|
|
30798
30833
|
}, {
|
|
30799
30834
|
key: "_disconnect",
|
|
30800
30835
|
value: function _disconnect() {
|
|
30801
|
-
var _this$_loader, _this$_networkEvaluat2
|
|
30836
|
+
var _this$_loader, _this$_networkEvaluat2;
|
|
30802
30837
|
(_this$_loader = this._loader) === null || _this$_loader === void 0 ? void 0 : _this$_loader.cancel();
|
|
30803
30838
|
(_this$_networkEvaluat2 = this._networkEvaluate) === null || _this$_networkEvaluat2 === void 0 ? void 0 : _this$_networkEvaluat2.destroy();
|
|
30804
|
-
(_this$_videoTransceic = this._videoTransceicer) === null || _this$_videoTransceic === void 0 ? void 0 : _this$_videoTransceic.stop();
|
|
30805
|
-
(_this$_audioTransceic = this._audioTransceicer) === null || _this$_audioTransceic === void 0 ? void 0 : _this$_audioTransceic.stop();
|
|
30806
30839
|
this._audioTransceicer = null;
|
|
30807
30840
|
this._videoTransceicer = null;
|
|
30808
30841
|
this._mediaStream = null;
|
|
@@ -30811,6 +30844,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
30811
30844
|
}, {
|
|
30812
30845
|
key: "_emitError",
|
|
30813
30846
|
value: function _emitError(error) {
|
|
30847
|
+
this._closeLastPc();
|
|
30814
30848
|
this.emit(EVENT$2.ERROR, error);
|
|
30815
30849
|
}
|
|
30816
30850
|
}, {
|
|
@@ -30822,6 +30856,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
30822
30856
|
if (this._media && !((_this$_opts = this._opts) !== null && _this$_opts !== void 0 && _this$_opts.seamlesslyReload)) {
|
|
30823
30857
|
this._media.srcObject = null;
|
|
30824
30858
|
}
|
|
30859
|
+
this._closeLastPc();
|
|
30825
30860
|
if (this._pc) {
|
|
30826
30861
|
this._pc.close();
|
|
30827
30862
|
}
|
|
@@ -30922,26 +30957,26 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
30922
30957
|
_defineProperty$c(_assertThisInitialized$b(_this), "_mediaStream", null);
|
|
30923
30958
|
_defineProperty$c(_assertThisInitialized$b(_this), "_rtsOpts", null);
|
|
30924
30959
|
_defineProperty$c(_assertThisInitialized$b(_this), "_onPause", function() {
|
|
30925
|
-
var _this$_rts, _this$config, _this$
|
|
30926
|
-
if (!((_this$_rts = _this._rts) !== null && _this$_rts !== void 0 && _this$_rts._pc)) {
|
|
30960
|
+
var _this$_rts, _this$_rts2, _this$config, _this$_rts4;
|
|
30961
|
+
if (!((_this$_rts = _this._rts) !== null && _this$_rts !== void 0 && _this$_rts._pc) || (_this$_rts2 = _this._rts) !== null && _this$_rts2 !== void 0 && _this$_rts2._isReplacing) {
|
|
30927
30962
|
return;
|
|
30928
30963
|
}
|
|
30929
30964
|
if ((_this$config = _this.config) !== null && _this$config !== void 0 && _this$config.seamlesslyReload) {
|
|
30930
|
-
var _this$
|
|
30931
|
-
_this._mediaStream = (_this$
|
|
30965
|
+
var _this$_rts3;
|
|
30966
|
+
_this._mediaStream = (_this$_rts3 = _this._rts) === null || _this$_rts3 === void 0 ? void 0 : _this$_rts3._mediaStream;
|
|
30932
30967
|
}
|
|
30933
|
-
(_this$
|
|
30968
|
+
(_this$_rts4 = _this._rts) === null || _this$_rts4 === void 0 ? void 0 : _this$_rts4.destroy();
|
|
30934
30969
|
});
|
|
30935
30970
|
_defineProperty$c(_assertThisInitialized$b(_this), "_onPlay", function() {
|
|
30936
|
-
var _this$
|
|
30937
|
-
if ((_this$
|
|
30971
|
+
var _this$_rts5, _this$_rts6;
|
|
30972
|
+
if ((_this$_rts5 = _this._rts) !== null && _this$_rts5 !== void 0 && _this$_rts5._pc || (_this$_rts6 = _this._rts) !== null && _this$_rts6 !== void 0 && _this$_rts6._isReplacing) {
|
|
30938
30973
|
return;
|
|
30939
30974
|
}
|
|
30940
30975
|
_this._init();
|
|
30941
30976
|
});
|
|
30942
30977
|
_defineProperty$c(_assertThisInitialized$b(_this), "_init", function() {
|
|
30943
|
-
var _this$
|
|
30944
|
-
(_this$
|
|
30978
|
+
var _this$_rts7;
|
|
30979
|
+
(_this$_rts7 = _this._rts) === null || _this$_rts7 === void 0 ? void 0 : _this$_rts7.destroy();
|
|
30945
30980
|
var config = _this.player.config;
|
|
30946
30981
|
var rtsOpts = config.rts || {};
|
|
30947
30982
|
_this._rtsOpts = rtsOpts;
|
|
@@ -30958,36 +30993,39 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
30958
30993
|
}, rtsOpts));
|
|
30959
30994
|
_this._rts.load(config.url);
|
|
30960
30995
|
});
|
|
30961
|
-
_defineProperty$c(_assertThisInitialized$b(_this), "_onSwitchURL", function(url) {
|
|
30996
|
+
_defineProperty$c(_assertThisInitialized$b(_this), "_onSwitchURL", function(url, seamless) {
|
|
30962
30997
|
if (_this._rts) {
|
|
30998
|
+
if (_typeof$7(seamless) === "object") {
|
|
30999
|
+
seamless = seamless.seamless;
|
|
31000
|
+
}
|
|
30963
31001
|
_this.player.config.url = url;
|
|
30964
|
-
_this._rts.switchURL(url);
|
|
31002
|
+
_this._rts.switchURL(url, seamless);
|
|
30965
31003
|
}
|
|
30966
31004
|
});
|
|
30967
31005
|
_defineProperty$c(_assertThisInitialized$b(_this), "destroy", function() {
|
|
30968
|
-
var _this$
|
|
31006
|
+
var _this$_rts8;
|
|
30969
31007
|
_this.player.switchURL = _this._originSwitchFn;
|
|
30970
|
-
(_this$
|
|
31008
|
+
(_this$_rts8 = _this._rts) === null || _this$_rts8 === void 0 ? void 0 : _this$_rts8.destroy();
|
|
30971
31009
|
});
|
|
30972
31010
|
return _this;
|
|
30973
31011
|
}
|
|
30974
31012
|
_createClass$e(RtsPlugin2, [{
|
|
30975
31013
|
key: "pc",
|
|
30976
31014
|
get: function get3() {
|
|
30977
|
-
var _this$
|
|
30978
|
-
return (_this$
|
|
31015
|
+
var _this$_rts9;
|
|
31016
|
+
return (_this$_rts9 = this._rts) === null || _this$_rts9 === void 0 ? void 0 : _this$_rts9.pc;
|
|
30979
31017
|
}
|
|
30980
31018
|
}, {
|
|
30981
31019
|
key: "videoTrack",
|
|
30982
31020
|
get: function get3() {
|
|
30983
|
-
var _this$
|
|
30984
|
-
return (_this$
|
|
31021
|
+
var _this$_rts10;
|
|
31022
|
+
return (_this$_rts10 = this._rts) === null || _this$_rts10 === void 0 ? void 0 : _this$_rts10.videoTack;
|
|
30985
31023
|
}
|
|
30986
31024
|
}, {
|
|
30987
31025
|
key: "audioTrack",
|
|
30988
31026
|
get: function get3() {
|
|
30989
|
-
var _this$
|
|
30990
|
-
return (_this$
|
|
31027
|
+
var _this$_rts11;
|
|
31028
|
+
return (_this$_rts11 = this._rts) === null || _this$_rts11 === void 0 ? void 0 : _this$_rts11.audioTrack;
|
|
30991
31029
|
}
|
|
30992
31030
|
}, {
|
|
30993
31031
|
key: "core",
|
|
@@ -30997,13 +31035,13 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
30997
31035
|
}, {
|
|
30998
31036
|
key: "loader",
|
|
30999
31037
|
get: function get3() {
|
|
31000
|
-
var _this$
|
|
31001
|
-
return (_this$
|
|
31038
|
+
var _this$_rts12;
|
|
31039
|
+
return (_this$_rts12 = this._rts) === null || _this$_rts12 === void 0 ? void 0 : _this$_rts12.loader;
|
|
31002
31040
|
}
|
|
31003
31041
|
}, {
|
|
31004
31042
|
key: "version",
|
|
31005
31043
|
get: function get3() {
|
|
31006
|
-
return "0.2.1-alpha.
|
|
31044
|
+
return "0.2.1-alpha.4";
|
|
31007
31045
|
}
|
|
31008
31046
|
}, {
|
|
31009
31047
|
key: "beforePlayerInit",
|
|
@@ -31053,20 +31091,20 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
31053
31091
|
}, {
|
|
31054
31092
|
key: "getStats",
|
|
31055
31093
|
value: function getStats2() {
|
|
31056
|
-
var _this$
|
|
31057
|
-
return (_this$
|
|
31094
|
+
var _this$_rts13;
|
|
31095
|
+
return (_this$_rts13 = this._rts) === null || _this$_rts13 === void 0 ? void 0 : _this$_rts13.getStats();
|
|
31058
31096
|
}
|
|
31059
31097
|
}, {
|
|
31060
31098
|
key: "getStatsSnapshoot",
|
|
31061
31099
|
value: function getStatsSnapshoot2() {
|
|
31062
|
-
var _this$
|
|
31063
|
-
return (_this$
|
|
31100
|
+
var _this$_rts14;
|
|
31101
|
+
return (_this$_rts14 = this._rts) === null || _this$_rts14 === void 0 ? void 0 : _this$_rts14.getStatsSnapshoot();
|
|
31064
31102
|
}
|
|
31065
31103
|
}, {
|
|
31066
31104
|
key: "getNetWorkInfo",
|
|
31067
31105
|
value: function getNetWorkInfo() {
|
|
31068
|
-
var _this$
|
|
31069
|
-
return (_this$
|
|
31106
|
+
var _this$_rts15;
|
|
31107
|
+
return (_this$_rts15 = this._rts) === null || _this$_rts15 === void 0 ? void 0 : _this$_rts15.networkStats;
|
|
31070
31108
|
}
|
|
31071
31109
|
}, {
|
|
31072
31110
|
key: "_transErrorEvent",
|