@volcengine/veplayer-plugin 2.4.5-rc.0 → 2.5.0
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 +2267 -578
- package/esm/index.production.js +3 -3
- package/esm/veplayer.plugin.abr.development.js +71 -3
- package/esm/veplayer.plugin.abr.production.js +1 -1
- package/esm/veplayer.plugin.drm.development.js +71 -3
- package/esm/veplayer.plugin.drm.production.js +1 -1
- package/esm/veplayer.plugin.flv.development.js +729 -196
- package/esm/veplayer.plugin.flv.production.js +1 -1
- package/esm/veplayer.plugin.hls.development.js +1505 -378
- package/esm/veplayer.plugin.hls.production.js +1 -1
- package/esm/veplayer.plugin.mp4.development.js +73 -5
- package/esm/veplayer.plugin.mp4.production.js +1 -1
- package/esm/veplayer.plugin.rtm.development.js +213 -48
- package/esm/veplayer.plugin.rtm.production.js +1 -1
- package/esm/veplayer.plugin.shaka.development.js +72 -4
- package/esm/veplayer.plugin.shaka.production.js +1 -1
- package/package.json +1 -1
- package/umd/veplayer.plugin.abr.development.js +71 -3
- package/umd/veplayer.plugin.abr.production.js +1 -1
- package/umd/veplayer.plugin.drm.development.js +71 -3
- package/umd/veplayer.plugin.drm.production.js +1 -1
- package/umd/veplayer.plugin.flv.development.js +729 -196
- package/umd/veplayer.plugin.flv.production.js +1 -1
- package/umd/veplayer.plugin.hls.development.js +1472 -345
- package/umd/veplayer.plugin.hls.production.js +1 -1
- package/umd/veplayer.plugin.mp4.development.js +73 -5
- package/umd/veplayer.plugin.mp4.production.js +1 -1
- package/umd/veplayer.plugin.rtm.development.js +213 -48
- package/umd/veplayer.plugin.rtm.production.js +1 -1
- package/umd/veplayer.plugin.shaka.development.js +72 -4
- package/umd/veplayer.plugin.shaka.production.js +1 -1
|
@@ -1534,7 +1534,7 @@
|
|
|
1534
1534
|
}
|
|
1535
1535
|
return offsetTime;
|
|
1536
1536
|
};
|
|
1537
|
-
var version = "3.0.
|
|
1537
|
+
var version = "3.0.21-rc.2";
|
|
1538
1538
|
var ERROR_MAP = {
|
|
1539
1539
|
1: 5101,
|
|
1540
1540
|
2: 5102,
|
|
@@ -1598,6 +1598,8 @@
|
|
|
1598
1598
|
}
|
|
1599
1599
|
}
|
|
1600
1600
|
);
|
|
1601
|
+
var PLAY = "play";
|
|
1602
|
+
var PAUSE = "pause";
|
|
1601
1603
|
var ERROR = "error";
|
|
1602
1604
|
var DESTROY = "destroy";
|
|
1603
1605
|
var URL_CHANGE = "urlchange";
|
|
@@ -1642,8 +1644,7 @@
|
|
|
1642
1644
|
}
|
|
1643
1645
|
if (this.__hooks && this.__hooks[hookName]) {
|
|
1644
1646
|
try {
|
|
1645
|
-
var
|
|
1646
|
-
var preRet = (_this$__hooks$hookNam = this.__hooks[hookName]).call.apply(_this$__hooks$hookNam, [this, this].concat(Array.prototype.slice.call(arguments)));
|
|
1647
|
+
var preRet = runHooks(this, hookName, handler);
|
|
1647
1648
|
if (preRet) {
|
|
1648
1649
|
if (preRet.then) {
|
|
1649
1650
|
preRet.then(function(isContinue) {
|
|
@@ -1668,6 +1669,19 @@
|
|
|
1668
1669
|
}
|
|
1669
1670
|
}.bind(this);
|
|
1670
1671
|
}
|
|
1672
|
+
function findHookIndex(hookName, handler) {
|
|
1673
|
+
var __hooks = this.__hooks;
|
|
1674
|
+
if (!__hooks || !Array.isArray(__hooks[hookName])) {
|
|
1675
|
+
return -1;
|
|
1676
|
+
}
|
|
1677
|
+
var hookHandlers = __hooks[hookName];
|
|
1678
|
+
for (var i = 0; i < hookHandlers.length; i++) {
|
|
1679
|
+
if (hookHandlers[i] === handler) {
|
|
1680
|
+
return i;
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
return -1;
|
|
1684
|
+
}
|
|
1671
1685
|
function useHooks(hookName, handler) {
|
|
1672
1686
|
var __hooks = this.__hooks;
|
|
1673
1687
|
if (!__hooks) {
|
|
@@ -1677,7 +1691,12 @@
|
|
|
1677
1691
|
console.warn("has no supported hook which name [".concat(hookName, "]"));
|
|
1678
1692
|
return false;
|
|
1679
1693
|
}
|
|
1680
|
-
|
|
1694
|
+
if (!Array.isArray(__hooks[hookName])) {
|
|
1695
|
+
__hooks[hookName] = [];
|
|
1696
|
+
}
|
|
1697
|
+
if (findHookIndex.call(this, hookName, handler) === -1) {
|
|
1698
|
+
__hooks[hookName].push(handler);
|
|
1699
|
+
}
|
|
1681
1700
|
return true;
|
|
1682
1701
|
}
|
|
1683
1702
|
function removeHooks(hookName, handler) {
|
|
@@ -1685,6 +1704,13 @@
|
|
|
1685
1704
|
if (!__hooks) {
|
|
1686
1705
|
return;
|
|
1687
1706
|
}
|
|
1707
|
+
if (Array.isArray(__hooks[hookName])) {
|
|
1708
|
+
var hooks = __hooks[hookName];
|
|
1709
|
+
var index = findHookIndex.call(this, hookName, handler);
|
|
1710
|
+
if (index !== -1) {
|
|
1711
|
+
hooks.splice(index, 1);
|
|
1712
|
+
}
|
|
1713
|
+
}
|
|
1688
1714
|
delete __hooks[hookName];
|
|
1689
1715
|
}
|
|
1690
1716
|
function hooksDescriptor(instance) {
|
|
@@ -1706,6 +1732,38 @@
|
|
|
1706
1732
|
function delHooksDescriptor(instance) {
|
|
1707
1733
|
instance.__hooks = null;
|
|
1708
1734
|
}
|
|
1735
|
+
function runHooks(obj, hookName, handler) {
|
|
1736
|
+
for (var _len5 = arguments.length, args = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
|
|
1737
|
+
args[_key5 - 3] = arguments[_key5];
|
|
1738
|
+
}
|
|
1739
|
+
if (obj.__hooks && Array.isArray(obj.__hooks[hookName])) {
|
|
1740
|
+
var hooks = obj.__hooks[hookName];
|
|
1741
|
+
var index = -1;
|
|
1742
|
+
var runHooksRecursive = function runHooksRecursive2(obj2, hookName2, handler2) {
|
|
1743
|
+
for (var _len6 = arguments.length, args2 = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {
|
|
1744
|
+
args2[_key6 - 3] = arguments[_key6];
|
|
1745
|
+
}
|
|
1746
|
+
index++;
|
|
1747
|
+
if (hooks.length === 0 || index === hooks.length) {
|
|
1748
|
+
return handler2.call.apply(handler2, [obj2, obj2].concat(args2));
|
|
1749
|
+
}
|
|
1750
|
+
var hook2 = hooks[index];
|
|
1751
|
+
var ret = hook2.call.apply(hook2, [obj2, obj2].concat(args2));
|
|
1752
|
+
if (ret && ret.then) {
|
|
1753
|
+
return ret.then(function(data) {
|
|
1754
|
+
return data === false ? null : runHooksRecursive2.apply(void 0, [obj2, hookName2, handler2].concat(args2));
|
|
1755
|
+
}).catch(function(e) {
|
|
1756
|
+
console.warn("[runHooks]".concat(hookName2, " reject"), e.message);
|
|
1757
|
+
});
|
|
1758
|
+
} else if (ret !== false) {
|
|
1759
|
+
return runHooksRecursive2.apply(void 0, [obj2, hookName2, handler2].concat(args2));
|
|
1760
|
+
}
|
|
1761
|
+
};
|
|
1762
|
+
return runHooksRecursive.apply(void 0, [obj, hookName, handler].concat(args));
|
|
1763
|
+
} else {
|
|
1764
|
+
return handler.call.apply(handler, [obj, obj].concat(args));
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1709
1767
|
function showErrorMsg(pluginName, msg) {
|
|
1710
1768
|
XG_DEBUG.logError("[".concat(pluginName, "] event or callback cant be undefined or null when call ").concat(msg));
|
|
1711
1769
|
}
|
|
@@ -1945,6 +2003,18 @@
|
|
|
1945
2003
|
}
|
|
1946
2004
|
}
|
|
1947
2005
|
}
|
|
2006
|
+
}, {
|
|
2007
|
+
key: "defineMethod",
|
|
2008
|
+
value: function defineMethod(Obj, map) {
|
|
2009
|
+
for (var key in map) {
|
|
2010
|
+
if (Object.prototype.hasOwnProperty.call(map, key) && typeof map[key] === "function") {
|
|
2011
|
+
Object.defineProperty(Obj, key, {
|
|
2012
|
+
configurable: true,
|
|
2013
|
+
value: map[key]
|
|
2014
|
+
});
|
|
2015
|
+
}
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
1948
2018
|
}, {
|
|
1949
2019
|
key: "defaultConfig",
|
|
1950
2020
|
get: function get() {
|
|
@@ -4812,7 +4882,8 @@
|
|
|
4812
4882
|
loadTimeout: 5e3,
|
|
4813
4883
|
stallInterval: 400,
|
|
4814
4884
|
networkEvaluateInterval: 1e3,
|
|
4815
|
-
delayHint: 0
|
|
4885
|
+
delayHint: 0,
|
|
4886
|
+
seamlesslyReload: false
|
|
4816
4887
|
}, opts);
|
|
4817
4888
|
}
|
|
4818
4889
|
function _getStats(stats) {
|
|
@@ -5075,6 +5146,7 @@
|
|
|
5075
5146
|
_defineProperty$2(_assertThisInitialized$1(_this), "_audioTransceicer", null);
|
|
5076
5147
|
_defineProperty$2(_assertThisInitialized$1(_this), "_videoTransceicer", null);
|
|
5077
5148
|
_defineProperty$2(_assertThisInitialized$1(_this), "_mediaStream", null);
|
|
5149
|
+
_defineProperty$2(_assertThisInitialized$1(_this), "_lastMediaStream", null);
|
|
5078
5150
|
_defineProperty$2(_assertThisInitialized$1(_this), "_media", null);
|
|
5079
5151
|
_defineProperty$2(_assertThisInitialized$1(_this), "_opts", null);
|
|
5080
5152
|
_defineProperty$2(_assertThisInitialized$1(_this), "_loader", null);
|
|
@@ -5082,19 +5154,10 @@
|
|
|
5082
5154
|
_defineProperty$2(_assertThisInitialized$1(_this), "_retry", 0);
|
|
5083
5155
|
_defineProperty$2(_assertThisInitialized$1(_this), "_waitingTimer", 0);
|
|
5084
5156
|
_defineProperty$2(_assertThisInitialized$1(_this), "_rctConnectStartTs", 0);
|
|
5157
|
+
_defineProperty$2(_assertThisInitialized$1(_this), "_isReplacing", false);
|
|
5085
5158
|
_defineProperty$2(_assertThisInitialized$1(_this), "_onTrack", function(e) {
|
|
5086
5159
|
logger.log("addTrack: ", e.track, e.streams);
|
|
5087
5160
|
_this["_".concat(e.track.kind)] = e.track;
|
|
5088
|
-
if (!_this._mediaStream) {
|
|
5089
|
-
_this._mediaStream = new MediaStream();
|
|
5090
|
-
_this._media.srcObject = _this._mediaStream;
|
|
5091
|
-
var req = _this._media.play();
|
|
5092
|
-
if (req && req.catch) {
|
|
5093
|
-
req.catch(function(e2) {
|
|
5094
|
-
});
|
|
5095
|
-
}
|
|
5096
|
-
}
|
|
5097
|
-
_this._mediaStream.addTrack(e.track);
|
|
5098
5161
|
});
|
|
5099
5162
|
_defineProperty$2(_assertThisInitialized$1(_this), "_mockWaitingByTimeupdate", function() {
|
|
5100
5163
|
var _this$_pc, _this$_pc2;
|
|
@@ -5142,6 +5205,9 @@
|
|
|
5142
5205
|
}));
|
|
5143
5206
|
_this._retry = _this._opts.retryCount;
|
|
5144
5207
|
_this._bindMediaEvent();
|
|
5208
|
+
if (_this._opts.mediaStream && _this._opts.seamlesslyReload) {
|
|
5209
|
+
_this._lastMediaStream = _this._opts.mediaStream;
|
|
5210
|
+
}
|
|
5145
5211
|
return _this;
|
|
5146
5212
|
}
|
|
5147
5213
|
_createClass$2(Rts2, [{
|
|
@@ -5253,6 +5319,7 @@
|
|
|
5253
5319
|
_this3.load(_this3._url);
|
|
5254
5320
|
}
|
|
5255
5321
|
if (pc.connectionState === "connected") {
|
|
5322
|
+
_this3._handleMediaStream();
|
|
5256
5323
|
_this3.emit(EVENT.TTFB, {
|
|
5257
5324
|
url: _this3._url,
|
|
5258
5325
|
responseUrl: _this3._url,
|
|
@@ -5261,6 +5328,40 @@
|
|
|
5261
5328
|
}
|
|
5262
5329
|
});
|
|
5263
5330
|
}
|
|
5331
|
+
}, {
|
|
5332
|
+
key: "_handleMediaStream",
|
|
5333
|
+
value: function _handleMediaStream() {
|
|
5334
|
+
var _this4 = this;
|
|
5335
|
+
if (this._lastMediaStream) {
|
|
5336
|
+
var _this$_media$play;
|
|
5337
|
+
var videoTrack = this._lastMediaStream.getVideoTracks()[0];
|
|
5338
|
+
var audioTrack = this._lastMediaStream.getAudioTracks()[0];
|
|
5339
|
+
if (videoTrack) {
|
|
5340
|
+
this._lastMediaStream.removeTrack(videoTrack);
|
|
5341
|
+
}
|
|
5342
|
+
if (audioTrack) {
|
|
5343
|
+
this._lastMediaStream.removeTrack(audioTrack);
|
|
5344
|
+
}
|
|
5345
|
+
this._mediaStream = this._lastMediaStream;
|
|
5346
|
+
this._audio && this._mediaStream.addTrack(this._audio);
|
|
5347
|
+
this._video && this._mediaStream.addTrack(this._video);
|
|
5348
|
+
this._isReplacing = true;
|
|
5349
|
+
this._media.pause();
|
|
5350
|
+
(_this$_media$play = this._media.play()) === null || _this$_media$play === void 0 ? void 0 : _this$_media$play.finally(function() {
|
|
5351
|
+
_this4._isReplacing = false;
|
|
5352
|
+
});
|
|
5353
|
+
} else {
|
|
5354
|
+
this._mediaStream = new MediaStream();
|
|
5355
|
+
this._audio && this._mediaStream.addTrack(this._audio);
|
|
5356
|
+
this._video && this._mediaStream.addTrack(this._video);
|
|
5357
|
+
this._media.srcObject = this._mediaStream;
|
|
5358
|
+
var req = this._media.play();
|
|
5359
|
+
if (req && req.catch) {
|
|
5360
|
+
req.catch(function(e) {
|
|
5361
|
+
});
|
|
5362
|
+
}
|
|
5363
|
+
}
|
|
5364
|
+
}
|
|
5264
5365
|
}, {
|
|
5265
5366
|
key: "_bindMediaEvent",
|
|
5266
5367
|
value: function _bindMediaEvent() {
|
|
@@ -5433,11 +5534,11 @@
|
|
|
5433
5534
|
}
|
|
5434
5535
|
}, {
|
|
5435
5536
|
key: "destroy",
|
|
5436
|
-
value: function destroy() {
|
|
5537
|
+
value: function destroy(keepClearMediaStream) {
|
|
5437
5538
|
var _this$_media2;
|
|
5438
5539
|
this._disconnect();
|
|
5439
5540
|
(_this$_media2 = this._media) === null || _this$_media2 === void 0 ? void 0 : _this$_media2.removeEventListener("timeupdate", this._mockWaitingByTimeupdate);
|
|
5440
|
-
if (this._media) {
|
|
5541
|
+
if (this._media && !keepClearMediaStream) {
|
|
5441
5542
|
this._media.srcObject = null;
|
|
5442
5543
|
}
|
|
5443
5544
|
if (this._pc) {
|
|
@@ -5537,15 +5638,36 @@
|
|
|
5537
5638
|
}
|
|
5538
5639
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
5539
5640
|
_defineProperty$2(_assertThisInitialized$1(_this), "_rts", null);
|
|
5641
|
+
_defineProperty$2(_assertThisInitialized$1(_this), "_mediaStream", null);
|
|
5642
|
+
_defineProperty$2(_assertThisInitialized$1(_this), "_disconnectTimer", void 0);
|
|
5540
5643
|
_defineProperty$2(_assertThisInitialized$1(_this), "_rtsOpts", null);
|
|
5541
|
-
_defineProperty$2(_assertThisInitialized$1(_this), "
|
|
5644
|
+
_defineProperty$2(_assertThisInitialized$1(_this), "_onPause", function() {
|
|
5645
|
+
if (_this._disconnectTimer) {
|
|
5646
|
+
return;
|
|
5647
|
+
}
|
|
5648
|
+
_this._disconnectTimer = setTimeout(function() {
|
|
5649
|
+
_this._closeAfterPause();
|
|
5650
|
+
_this._clearDisconnectTimer();
|
|
5651
|
+
}, _this.config.disconnectTime * 1e3);
|
|
5652
|
+
});
|
|
5653
|
+
_defineProperty$2(_assertThisInitialized$1(_this), "_reInit", function() {
|
|
5542
5654
|
var _this$_rts;
|
|
5543
|
-
|
|
5655
|
+
_this._clearDisconnectTimer();
|
|
5656
|
+
if ((_this$_rts = _this._rts) !== null && _this$_rts !== void 0 && _this$_rts._pc) {
|
|
5657
|
+
return;
|
|
5658
|
+
}
|
|
5659
|
+
_this._init();
|
|
5660
|
+
_this._bindRtsEvents();
|
|
5661
|
+
});
|
|
5662
|
+
_defineProperty$2(_assertThisInitialized$1(_this), "_init", function() {
|
|
5663
|
+
var _this$_rts2;
|
|
5664
|
+
(_this$_rts2 = _this._rts) === null || _this$_rts2 === void 0 ? void 0 : _this$_rts2.destroy();
|
|
5544
5665
|
var config = _this.player.config;
|
|
5545
5666
|
var rtsOpts = config.rts || {};
|
|
5546
5667
|
_this._rtsOpts = rtsOpts;
|
|
5547
5668
|
_this._rts = new Rts(_objectSpread2$2({
|
|
5548
5669
|
media: _this.player.video,
|
|
5670
|
+
mediaStream: _this._mediaStream,
|
|
5549
5671
|
preProcessUrl: function preProcessUrl(url, ext) {
|
|
5550
5672
|
var _this$player$preProce, _this$player;
|
|
5551
5673
|
return ((_this$player$preProce = (_this$player = _this.player).preProcessUrl) === null || _this$player$preProce === void 0 ? void 0 : _this$player$preProce.call(_this$player, url, ext)) || {
|
|
@@ -5557,35 +5679,40 @@
|
|
|
5557
5679
|
_this._rts.load(config.url);
|
|
5558
5680
|
});
|
|
5559
5681
|
_defineProperty$2(_assertThisInitialized$1(_this), "_onSwitchURL", function(url) {
|
|
5560
|
-
if (
|
|
5682
|
+
if (url) {
|
|
5561
5683
|
_this.player.config.url = url;
|
|
5684
|
+
}
|
|
5685
|
+
if (_this._rts) {
|
|
5562
5686
|
_this._rts.switchURL(url);
|
|
5687
|
+
} else {
|
|
5688
|
+
_this._reInit();
|
|
5563
5689
|
}
|
|
5564
5690
|
});
|
|
5565
5691
|
_defineProperty$2(_assertThisInitialized$1(_this), "destroy", function() {
|
|
5566
|
-
var _this$
|
|
5692
|
+
var _this$_rts3;
|
|
5567
5693
|
_this.player.switchURL = _this._originSwitchFn;
|
|
5568
|
-
|
|
5694
|
+
_this._clearDisconnectTimer();
|
|
5695
|
+
(_this$_rts3 = _this._rts) === null || _this$_rts3 === void 0 ? void 0 : _this$_rts3.destroy();
|
|
5569
5696
|
});
|
|
5570
5697
|
return _this;
|
|
5571
5698
|
}
|
|
5572
5699
|
_createClass$2(RtsPlugin2, [{
|
|
5573
5700
|
key: "pc",
|
|
5574
5701
|
get: function get() {
|
|
5575
|
-
var _this$
|
|
5576
|
-
return (_this$
|
|
5702
|
+
var _this$_rts4;
|
|
5703
|
+
return (_this$_rts4 = this._rts) === null || _this$_rts4 === void 0 ? void 0 : _this$_rts4.pc;
|
|
5577
5704
|
}
|
|
5578
5705
|
}, {
|
|
5579
5706
|
key: "videoTrack",
|
|
5580
5707
|
get: function get() {
|
|
5581
|
-
var _this$
|
|
5582
|
-
return (_this$
|
|
5708
|
+
var _this$_rts5;
|
|
5709
|
+
return (_this$_rts5 = this._rts) === null || _this$_rts5 === void 0 ? void 0 : _this$_rts5.videoTack;
|
|
5583
5710
|
}
|
|
5584
5711
|
}, {
|
|
5585
5712
|
key: "audioTrack",
|
|
5586
5713
|
get: function get() {
|
|
5587
|
-
var _this$
|
|
5588
|
-
return (_this$
|
|
5714
|
+
var _this$_rts6;
|
|
5715
|
+
return (_this$_rts6 = this._rts) === null || _this$_rts6 === void 0 ? void 0 : _this$_rts6.audioTrack;
|
|
5589
5716
|
}
|
|
5590
5717
|
}, {
|
|
5591
5718
|
key: "core",
|
|
@@ -5595,37 +5722,43 @@
|
|
|
5595
5722
|
}, {
|
|
5596
5723
|
key: "loader",
|
|
5597
5724
|
get: function get() {
|
|
5598
|
-
var _this$
|
|
5599
|
-
return (_this$
|
|
5725
|
+
var _this$_rts7;
|
|
5726
|
+
return (_this$_rts7 = this._rts) === null || _this$_rts7 === void 0 ? void 0 : _this$_rts7.loader;
|
|
5600
5727
|
}
|
|
5601
5728
|
}, {
|
|
5602
5729
|
key: "version",
|
|
5603
5730
|
get: function get() {
|
|
5604
|
-
return "0.2.1-alpha.
|
|
5731
|
+
return "0.2.1-alpha.12";
|
|
5605
5732
|
}
|
|
5606
5733
|
}, {
|
|
5607
5734
|
key: "beforePlayerInit",
|
|
5608
5735
|
value: function beforePlayerInit() {
|
|
5609
|
-
var _this$player2, _this2 = this;
|
|
5736
|
+
var _this$player2, _this2 = this, _this$player$config, _this$player$config$r;
|
|
5610
5737
|
this._init();
|
|
5611
5738
|
if (!this._originSwitchFn) {
|
|
5612
5739
|
this._originSwitchFn = this.player.switchURL.bind(this.player);
|
|
5613
5740
|
}
|
|
5614
5741
|
this.player.switchURL = this._onSwitchURL;
|
|
5615
5742
|
(_this$player2 = this.player) === null || _this$player2 === void 0 ? void 0 : _this$player2.useHooks("replay", function() {
|
|
5616
|
-
|
|
5617
|
-
return (_this2$_rts = _this2._rts) === null || _this2$_rts === void 0 ? void 0 : _this2$_rts.switchURL();
|
|
5743
|
+
return _this2._onSwitchURL();
|
|
5618
5744
|
});
|
|
5619
5745
|
this.on(URL_CHANGE, this._onSwitchURL);
|
|
5620
5746
|
this.on(DESTROY, this.destroy);
|
|
5621
|
-
this.
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5747
|
+
if (typeof ((_this$player$config = this.player.config) === null || _this$player$config === void 0 ? void 0 : (_this$player$config$r = _this$player$config.rts) === null || _this$player$config$r === void 0 ? void 0 : _this$player$config$r.disconnectTime) !== "undefined") {
|
|
5748
|
+
this.on(PAUSE, function() {
|
|
5749
|
+
var _this2$_rts;
|
|
5750
|
+
if (!((_this2$_rts = _this2._rts) !== null && _this2$_rts !== void 0 && _this2$_rts._isReplacing)) {
|
|
5751
|
+
_this2._onPause();
|
|
5752
|
+
}
|
|
5753
|
+
});
|
|
5754
|
+
this.on(PLAY, function() {
|
|
5755
|
+
var _this2$_rts2;
|
|
5756
|
+
if (!((_this2$_rts2 = _this2._rts) !== null && _this2$_rts2 !== void 0 && _this2$_rts2._isReplacing)) {
|
|
5757
|
+
_this2._reInit();
|
|
5758
|
+
}
|
|
5759
|
+
});
|
|
5760
|
+
}
|
|
5761
|
+
this._bindRtsEvents();
|
|
5629
5762
|
try {
|
|
5630
5763
|
BasePlugin.defineGetterOrSetter(this.player, {
|
|
5631
5764
|
__url: {
|
|
@@ -5647,20 +5780,52 @@
|
|
|
5647
5780
|
}, {
|
|
5648
5781
|
key: "getStats",
|
|
5649
5782
|
value: function getStats2() {
|
|
5650
|
-
var _this$
|
|
5651
|
-
return (_this$
|
|
5783
|
+
var _this$_rts8;
|
|
5784
|
+
return (_this$_rts8 = this._rts) === null || _this$_rts8 === void 0 ? void 0 : _this$_rts8.getStats();
|
|
5652
5785
|
}
|
|
5653
5786
|
}, {
|
|
5654
5787
|
key: "getStatsSnapshoot",
|
|
5655
5788
|
value: function getStatsSnapshoot2() {
|
|
5656
|
-
var _this$
|
|
5657
|
-
return (_this$
|
|
5789
|
+
var _this$_rts9;
|
|
5790
|
+
return (_this$_rts9 = this._rts) === null || _this$_rts9 === void 0 ? void 0 : _this$_rts9.getStatsSnapshoot();
|
|
5658
5791
|
}
|
|
5659
5792
|
}, {
|
|
5660
5793
|
key: "getNetWorkInfo",
|
|
5661
5794
|
value: function getNetWorkInfo() {
|
|
5662
|
-
var _this$
|
|
5663
|
-
return (_this$
|
|
5795
|
+
var _this$_rts10;
|
|
5796
|
+
return (_this$_rts10 = this._rts) === null || _this$_rts10 === void 0 ? void 0 : _this$_rts10.networkStats;
|
|
5797
|
+
}
|
|
5798
|
+
}, {
|
|
5799
|
+
key: "_clearDisconnectTimer",
|
|
5800
|
+
value: function _clearDisconnectTimer() {
|
|
5801
|
+
clearTimeout(this._disconnectTimer);
|
|
5802
|
+
this._disconnectTimer = void 0;
|
|
5803
|
+
}
|
|
5804
|
+
}, {
|
|
5805
|
+
key: "_closeAfterPause",
|
|
5806
|
+
value: function _closeAfterPause() {
|
|
5807
|
+
var _this$_rts11, _this$config, _this$_rts13;
|
|
5808
|
+
if (!((_this$_rts11 = this._rts) !== null && _this$_rts11 !== void 0 && _this$_rts11._pc)) {
|
|
5809
|
+
return;
|
|
5810
|
+
}
|
|
5811
|
+
if ((_this$config = this.config) !== null && _this$config !== void 0 && _this$config.seamlesslyReload) {
|
|
5812
|
+
var _this$_rts12;
|
|
5813
|
+
this._mediaStream = (_this$_rts12 = this._rts) === null || _this$_rts12 === void 0 ? void 0 : _this$_rts12._mediaStream;
|
|
5814
|
+
}
|
|
5815
|
+
(_this$_rts13 = this._rts) === null || _this$_rts13 === void 0 ? void 0 : _this$_rts13.destroy(true);
|
|
5816
|
+
this._rts = null;
|
|
5817
|
+
}
|
|
5818
|
+
}, {
|
|
5819
|
+
key: "_bindRtsEvents",
|
|
5820
|
+
value: function _bindRtsEvents() {
|
|
5821
|
+
this._transErrorEvent();
|
|
5822
|
+
this._transCoreEvent(EVENT.LOAD_START);
|
|
5823
|
+
this._transCoreEvent(EVENT.LOAD_COMPLETE);
|
|
5824
|
+
this._transCoreEvent(EVENT.TTFB);
|
|
5825
|
+
this._transCoreEvent(EVENT.LOAD_RESPONSE_HEADERS);
|
|
5826
|
+
this._transCoreEvent(EVENT.LOAD_RETRY);
|
|
5827
|
+
this._transCoreEvent(EVENT.METADATA_PARSED);
|
|
5828
|
+
this._transCoreEvent(EXTEND_EVENTS.RTC_STATE_CHANGE);
|
|
5664
5829
|
}
|
|
5665
5830
|
}, {
|
|
5666
5831
|
key: "_transErrorEvent",
|