@volcengine/veplayer-plugin 2.5.0-rc.0 → 2.5.1-rc.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.d.ts +0 -1
- package/esm/index.development.css +0 -7
- package/esm/index.development.js +47274 -53342
- package/esm/index.production.css +1 -1
- package/esm/index.production.js +4 -13
- package/esm/veplayer.plugin.abr.development.js +12 -0
- package/esm/veplayer.plugin.abr.production.js +1 -1
- package/esm/veplayer.plugin.drm.development.js +12 -0
- package/esm/veplayer.plugin.drm.production.js +1 -1
- package/esm/veplayer.plugin.flv.development.js +675 -194
- package/esm/veplayer.plugin.flv.production.js +1 -1
- package/esm/veplayer.plugin.hls.development.js +1159 -369
- package/esm/veplayer.plugin.hls.production.js +1 -1
- package/esm/veplayer.plugin.mp4.development.js +13 -1
- package/esm/veplayer.plugin.mp4.production.js +1 -1
- package/esm/veplayer.plugin.rtm.development.js +167 -51
- package/esm/veplayer.plugin.rtm.production.js +1 -1
- package/esm/veplayer.plugin.shaka.development.js +12 -0
- package/esm/veplayer.plugin.shaka.production.js +1 -1
- package/package.json +1 -1
- package/umd/index.d.ts +0 -1
- package/umd/veplayer.plugin.abr.development.js +12 -0
- package/umd/veplayer.plugin.abr.production.js +1 -1
- package/umd/veplayer.plugin.drm.development.js +12 -0
- package/umd/veplayer.plugin.drm.production.js +1 -1
- package/umd/veplayer.plugin.flv.development.js +675 -194
- package/umd/veplayer.plugin.flv.production.js +1 -1
- package/umd/veplayer.plugin.hls.development.js +1126 -336
- package/umd/veplayer.plugin.hls.production.js +1 -1
- package/umd/veplayer.plugin.mp4.development.js +13 -1
- package/umd/veplayer.plugin.mp4.production.js +1 -1
- package/umd/veplayer.plugin.rtm.development.js +167 -51
- package/umd/veplayer.plugin.rtm.production.js +1 -1
- package/umd/veplayer.plugin.shaka.development.js +12 -0
- package/umd/veplayer.plugin.shaka.production.js +1 -1
- package/esm/veplayer.plugin.ad.development.css +0 -7
- package/esm/veplayer.plugin.ad.development.js +0 -9042
- package/esm/veplayer.plugin.ad.production.css +0 -1
- package/esm/veplayer.plugin.ad.production.js +0 -4
- package/umd/veplayer.plugin.ad.development.css +0 -7
- package/umd/veplayer.plugin.ad.development.js +0 -9045
- package/umd/veplayer.plugin.ad.production.css +0 -1
- package/umd/veplayer.plugin.ad.production.js +0 -1
|
@@ -1530,7 +1530,7 @@ util.getCurrentTimeByOffset = function(offsetTime, segments) {
|
|
|
1530
1530
|
}
|
|
1531
1531
|
return offsetTime;
|
|
1532
1532
|
};
|
|
1533
|
-
var version = "3.0.
|
|
1533
|
+
var version = "3.0.21-rc.5";
|
|
1534
1534
|
var ERROR_MAP = {
|
|
1535
1535
|
1: 5101,
|
|
1536
1536
|
2: 5102,
|
|
@@ -1594,6 +1594,8 @@ var Errors = /* @__PURE__ */ _createClass$1(
|
|
|
1594
1594
|
}
|
|
1595
1595
|
}
|
|
1596
1596
|
);
|
|
1597
|
+
var PLAY = "play";
|
|
1598
|
+
var PAUSE = "pause";
|
|
1597
1599
|
var ERROR = "error";
|
|
1598
1600
|
var DESTROY = "destroy";
|
|
1599
1601
|
var URL_CHANGE = "urlchange";
|
|
@@ -1997,6 +1999,18 @@ var BasePlugin = /* @__PURE__ */ function() {
|
|
|
1997
1999
|
}
|
|
1998
2000
|
}
|
|
1999
2001
|
}
|
|
2002
|
+
}, {
|
|
2003
|
+
key: "defineMethod",
|
|
2004
|
+
value: function defineMethod(Obj, map) {
|
|
2005
|
+
for (var key in map) {
|
|
2006
|
+
if (Object.prototype.hasOwnProperty.call(map, key) && typeof map[key] === "function") {
|
|
2007
|
+
Object.defineProperty(Obj, key, {
|
|
2008
|
+
configurable: true,
|
|
2009
|
+
value: map[key]
|
|
2010
|
+
});
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
}
|
|
2000
2014
|
}, {
|
|
2001
2015
|
key: "defaultConfig",
|
|
2002
2016
|
get: function get() {
|
|
@@ -4864,7 +4878,9 @@ function getOption(opts) {
|
|
|
4864
4878
|
loadTimeout: 5e3,
|
|
4865
4879
|
stallInterval: 400,
|
|
4866
4880
|
networkEvaluateInterval: 1e3,
|
|
4867
|
-
delayHint: 0
|
|
4881
|
+
delayHint: 0,
|
|
4882
|
+
seamlesslyReload: false,
|
|
4883
|
+
enableOriginSdpLogger: false
|
|
4868
4884
|
}, opts);
|
|
4869
4885
|
}
|
|
4870
4886
|
function _getStats(stats) {
|
|
@@ -5127,6 +5143,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5127
5143
|
_defineProperty$2(_assertThisInitialized$1(_this), "_audioTransceicer", null);
|
|
5128
5144
|
_defineProperty$2(_assertThisInitialized$1(_this), "_videoTransceicer", null);
|
|
5129
5145
|
_defineProperty$2(_assertThisInitialized$1(_this), "_mediaStream", null);
|
|
5146
|
+
_defineProperty$2(_assertThisInitialized$1(_this), "_lastMediaStream", null);
|
|
5130
5147
|
_defineProperty$2(_assertThisInitialized$1(_this), "_media", null);
|
|
5131
5148
|
_defineProperty$2(_assertThisInitialized$1(_this), "_opts", null);
|
|
5132
5149
|
_defineProperty$2(_assertThisInitialized$1(_this), "_loader", null);
|
|
@@ -5134,19 +5151,10 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5134
5151
|
_defineProperty$2(_assertThisInitialized$1(_this), "_retry", 0);
|
|
5135
5152
|
_defineProperty$2(_assertThisInitialized$1(_this), "_waitingTimer", 0);
|
|
5136
5153
|
_defineProperty$2(_assertThisInitialized$1(_this), "_rctConnectStartTs", 0);
|
|
5154
|
+
_defineProperty$2(_assertThisInitialized$1(_this), "_isReplacing", false);
|
|
5137
5155
|
_defineProperty$2(_assertThisInitialized$1(_this), "_onTrack", function(e) {
|
|
5138
5156
|
logger.log("addTrack: ", e.track, e.streams);
|
|
5139
5157
|
_this["_".concat(e.track.kind)] = e.track;
|
|
5140
|
-
if (!_this._mediaStream) {
|
|
5141
|
-
_this._mediaStream = new MediaStream();
|
|
5142
|
-
_this._media.srcObject = _this._mediaStream;
|
|
5143
|
-
var req = _this._media.play();
|
|
5144
|
-
if (req && req.catch) {
|
|
5145
|
-
req.catch(function(e2) {
|
|
5146
|
-
});
|
|
5147
|
-
}
|
|
5148
|
-
}
|
|
5149
|
-
_this._mediaStream.addTrack(e.track);
|
|
5150
5158
|
});
|
|
5151
5159
|
_defineProperty$2(_assertThisInitialized$1(_this), "_mockWaitingByTimeupdate", function() {
|
|
5152
5160
|
var _this$_pc, _this$_pc2;
|
|
@@ -5194,6 +5202,9 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5194
5202
|
}));
|
|
5195
5203
|
_this._retry = _this._opts.retryCount;
|
|
5196
5204
|
_this._bindMediaEvent();
|
|
5205
|
+
if (_this._opts.mediaStream && _this._opts.seamlesslyReload) {
|
|
5206
|
+
_this._lastMediaStream = _this._opts.mediaStream;
|
|
5207
|
+
}
|
|
5197
5208
|
return _this;
|
|
5198
5209
|
}
|
|
5199
5210
|
_createClass$2(Rts2, [{
|
|
@@ -5305,6 +5316,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5305
5316
|
_this3.load(_this3._url);
|
|
5306
5317
|
}
|
|
5307
5318
|
if (pc.connectionState === "connected") {
|
|
5319
|
+
_this3._handleMediaStream();
|
|
5308
5320
|
_this3.emit(EVENT.TTFB, {
|
|
5309
5321
|
url: _this3._url,
|
|
5310
5322
|
responseUrl: _this3._url,
|
|
@@ -5313,6 +5325,40 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5313
5325
|
}
|
|
5314
5326
|
});
|
|
5315
5327
|
}
|
|
5328
|
+
}, {
|
|
5329
|
+
key: "_handleMediaStream",
|
|
5330
|
+
value: function _handleMediaStream() {
|
|
5331
|
+
var _this4 = this;
|
|
5332
|
+
if (this._lastMediaStream) {
|
|
5333
|
+
var _this$_media$play;
|
|
5334
|
+
var videoTrack = this._lastMediaStream.getVideoTracks()[0];
|
|
5335
|
+
var audioTrack = this._lastMediaStream.getAudioTracks()[0];
|
|
5336
|
+
if (videoTrack) {
|
|
5337
|
+
this._lastMediaStream.removeTrack(videoTrack);
|
|
5338
|
+
}
|
|
5339
|
+
if (audioTrack) {
|
|
5340
|
+
this._lastMediaStream.removeTrack(audioTrack);
|
|
5341
|
+
}
|
|
5342
|
+
this._mediaStream = this._lastMediaStream;
|
|
5343
|
+
this._audio && this._mediaStream.addTrack(this._audio);
|
|
5344
|
+
this._video && this._mediaStream.addTrack(this._video);
|
|
5345
|
+
this._isReplacing = true;
|
|
5346
|
+
this._media.pause();
|
|
5347
|
+
(_this$_media$play = this._media.play()) === null || _this$_media$play === void 0 ? void 0 : _this$_media$play.finally(function() {
|
|
5348
|
+
_this4._isReplacing = false;
|
|
5349
|
+
});
|
|
5350
|
+
} else {
|
|
5351
|
+
this._mediaStream = new MediaStream();
|
|
5352
|
+
this._audio && this._mediaStream.addTrack(this._audio);
|
|
5353
|
+
this._video && this._mediaStream.addTrack(this._video);
|
|
5354
|
+
this._media.srcObject = this._mediaStream;
|
|
5355
|
+
var req = this._media.play();
|
|
5356
|
+
if (req && req.catch) {
|
|
5357
|
+
req.catch(function(e) {
|
|
5358
|
+
});
|
|
5359
|
+
}
|
|
5360
|
+
}
|
|
5361
|
+
}
|
|
5316
5362
|
}, {
|
|
5317
5363
|
key: "_bindMediaEvent",
|
|
5318
5364
|
value: function _bindMediaEvent() {
|
|
@@ -5323,7 +5369,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5323
5369
|
key: "_connect",
|
|
5324
5370
|
value: function() {
|
|
5325
5371
|
var _connect2 = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee2() {
|
|
5326
|
-
var pc, offer, delayHint, parsed, finnalUrl, _answer$remoteSdp, _answer$remoteSdp2, parseSession, sessionId, reqStart, res, answer, err, _parsed;
|
|
5372
|
+
var pc, offer, delayHint, parsed, finnalUrl, _this$_opts, _answer$remoteSdp, _this$_opts2, _answer$remoteSdp2, _parsed$media, parseSession, sessionId, reqStart, res, answer, err, _parsed;
|
|
5327
5373
|
return _regeneratorRuntime$1().wrap(function _callee2$(_context2) {
|
|
5328
5374
|
while (1)
|
|
5329
5375
|
switch (_context2.prev = _context2.next) {
|
|
@@ -5399,7 +5445,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5399
5445
|
sessionId = parseSession ? parseSession[1] : Date.now() + "666";
|
|
5400
5446
|
this.emit(EVENT.LOAD_START, {
|
|
5401
5447
|
url: finnalUrl,
|
|
5402
|
-
offersdp: offer.sdp,
|
|
5448
|
+
offersdp: (_this$_opts = this._opts) !== null && _this$_opts !== void 0 && _this$_opts.enableOriginSdpLogger ? offer.sdp : void 0,
|
|
5403
5449
|
sessionId
|
|
5404
5450
|
});
|
|
5405
5451
|
reqStart = Date.now();
|
|
@@ -5434,12 +5480,19 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5434
5480
|
case 42:
|
|
5435
5481
|
logger.log("answer:");
|
|
5436
5482
|
logger.log((_answer$remoteSdp = answer.remoteSdp) === null || _answer$remoteSdp === void 0 ? void 0 : _answer$remoteSdp.sdp);
|
|
5483
|
+
_parsed = lib.parse(answer.remoteSdp.sdp);
|
|
5437
5484
|
this.emit(EVENT.LOAD_COMPLETE, {
|
|
5438
5485
|
url: finnalUrl,
|
|
5439
5486
|
elapsed: Date.now() - reqStart,
|
|
5440
|
-
answersdp: (_answer$remoteSdp2 = answer.remoteSdp) === null || _answer$remoteSdp2 === void 0 ? void 0 : _answer$remoteSdp2.sdp
|
|
5487
|
+
answersdp: (_this$_opts2 = this._opts) !== null && _this$_opts2 !== void 0 && _this$_opts2.enableOriginSdpLogger ? answer === null || answer === void 0 ? void 0 : (_answer$remoteSdp2 = answer.remoteSdp) === null || _answer$remoteSdp2 === void 0 ? void 0 : _answer$remoteSdp2.sdp : void 0,
|
|
5488
|
+
parsedSdp: _parsed === null || _parsed === void 0 ? void 0 : (_parsed$media = _parsed.media) === null || _parsed$media === void 0 ? void 0 : _parsed$media.map(function(media) {
|
|
5489
|
+
return {
|
|
5490
|
+
candidates: media.candidates,
|
|
5491
|
+
rtp: media.rtp,
|
|
5492
|
+
type: media.type
|
|
5493
|
+
};
|
|
5494
|
+
})
|
|
5441
5495
|
});
|
|
5442
|
-
_parsed = lib.parse(answer.remoteSdp.sdp);
|
|
5443
5496
|
_parsed.media.forEach(function(x) {
|
|
5444
5497
|
x.fingerprint.hash = x.fingerprint.hash.toUpperCase();
|
|
5445
5498
|
});
|
|
@@ -5485,11 +5538,11 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
5485
5538
|
}
|
|
5486
5539
|
}, {
|
|
5487
5540
|
key: "destroy",
|
|
5488
|
-
value: function destroy() {
|
|
5541
|
+
value: function destroy(keepClearMediaStream) {
|
|
5489
5542
|
var _this$_media2;
|
|
5490
5543
|
this._disconnect();
|
|
5491
5544
|
(_this$_media2 = this._media) === null || _this$_media2 === void 0 ? void 0 : _this$_media2.removeEventListener("timeupdate", this._mockWaitingByTimeupdate);
|
|
5492
|
-
if (this._media) {
|
|
5545
|
+
if (this._media && !keepClearMediaStream) {
|
|
5493
5546
|
this._media.srcObject = null;
|
|
5494
5547
|
}
|
|
5495
5548
|
if (this._pc) {
|
|
@@ -5589,15 +5642,36 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
5589
5642
|
}
|
|
5590
5643
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
5591
5644
|
_defineProperty$2(_assertThisInitialized$1(_this), "_rts", null);
|
|
5645
|
+
_defineProperty$2(_assertThisInitialized$1(_this), "_mediaStream", null);
|
|
5646
|
+
_defineProperty$2(_assertThisInitialized$1(_this), "_disconnectTimer", void 0);
|
|
5592
5647
|
_defineProperty$2(_assertThisInitialized$1(_this), "_rtsOpts", null);
|
|
5593
|
-
_defineProperty$2(_assertThisInitialized$1(_this), "
|
|
5648
|
+
_defineProperty$2(_assertThisInitialized$1(_this), "_onPause", function() {
|
|
5649
|
+
if (_this._disconnectTimer) {
|
|
5650
|
+
return;
|
|
5651
|
+
}
|
|
5652
|
+
_this._disconnectTimer = setTimeout(function() {
|
|
5653
|
+
_this._closeAfterPause();
|
|
5654
|
+
_this._clearDisconnectTimer();
|
|
5655
|
+
}, _this.config.disconnectTime * 1e3);
|
|
5656
|
+
});
|
|
5657
|
+
_defineProperty$2(_assertThisInitialized$1(_this), "_reInit", function() {
|
|
5594
5658
|
var _this$_rts;
|
|
5595
|
-
|
|
5659
|
+
_this._clearDisconnectTimer();
|
|
5660
|
+
if ((_this$_rts = _this._rts) !== null && _this$_rts !== void 0 && _this$_rts._pc) {
|
|
5661
|
+
return;
|
|
5662
|
+
}
|
|
5663
|
+
_this._init();
|
|
5664
|
+
_this._bindRtsEvents();
|
|
5665
|
+
});
|
|
5666
|
+
_defineProperty$2(_assertThisInitialized$1(_this), "_init", function() {
|
|
5667
|
+
var _this$_rts2;
|
|
5668
|
+
(_this$_rts2 = _this._rts) === null || _this$_rts2 === void 0 ? void 0 : _this$_rts2.destroy();
|
|
5596
5669
|
var config = _this.player.config;
|
|
5597
5670
|
var rtsOpts = config.rts || {};
|
|
5598
5671
|
_this._rtsOpts = rtsOpts;
|
|
5599
5672
|
_this._rts = new Rts(_objectSpread2$2({
|
|
5600
5673
|
media: _this.player.video,
|
|
5674
|
+
mediaStream: _this._mediaStream,
|
|
5601
5675
|
preProcessUrl: function preProcessUrl(url, ext) {
|
|
5602
5676
|
var _this$player$preProce, _this$player;
|
|
5603
5677
|
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)) || {
|
|
@@ -5609,35 +5683,41 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
5609
5683
|
_this._rts.load(config.url);
|
|
5610
5684
|
});
|
|
5611
5685
|
_defineProperty$2(_assertThisInitialized$1(_this), "_onSwitchURL", function(url) {
|
|
5612
|
-
if (
|
|
5686
|
+
if (url) {
|
|
5613
5687
|
_this.player.config.url = url;
|
|
5688
|
+
}
|
|
5689
|
+
if (_this._rts) {
|
|
5614
5690
|
_this._rts.switchURL(url);
|
|
5691
|
+
} else {
|
|
5692
|
+
_this._reInit();
|
|
5615
5693
|
}
|
|
5616
5694
|
});
|
|
5617
5695
|
_defineProperty$2(_assertThisInitialized$1(_this), "destroy", function() {
|
|
5618
|
-
var _this$
|
|
5696
|
+
var _this$_rts3;
|
|
5619
5697
|
_this.player.switchURL = _this._originSwitchFn;
|
|
5620
|
-
|
|
5698
|
+
_this._clearDisconnectTimer();
|
|
5699
|
+
(_this$_rts3 = _this._rts) === null || _this$_rts3 === void 0 ? void 0 : _this$_rts3.destroy();
|
|
5700
|
+
_this._rts = null;
|
|
5621
5701
|
});
|
|
5622
5702
|
return _this;
|
|
5623
5703
|
}
|
|
5624
5704
|
_createClass$2(RtsPlugin2, [{
|
|
5625
5705
|
key: "pc",
|
|
5626
5706
|
get: function get() {
|
|
5627
|
-
var _this$
|
|
5628
|
-
return (_this$
|
|
5707
|
+
var _this$_rts4;
|
|
5708
|
+
return (_this$_rts4 = this._rts) === null || _this$_rts4 === void 0 ? void 0 : _this$_rts4.pc;
|
|
5629
5709
|
}
|
|
5630
5710
|
}, {
|
|
5631
5711
|
key: "videoTrack",
|
|
5632
5712
|
get: function get() {
|
|
5633
|
-
var _this$
|
|
5634
|
-
return (_this$
|
|
5713
|
+
var _this$_rts5;
|
|
5714
|
+
return (_this$_rts5 = this._rts) === null || _this$_rts5 === void 0 ? void 0 : _this$_rts5.videoTack;
|
|
5635
5715
|
}
|
|
5636
5716
|
}, {
|
|
5637
5717
|
key: "audioTrack",
|
|
5638
5718
|
get: function get() {
|
|
5639
|
-
var _this$
|
|
5640
|
-
return (_this$
|
|
5719
|
+
var _this$_rts6;
|
|
5720
|
+
return (_this$_rts6 = this._rts) === null || _this$_rts6 === void 0 ? void 0 : _this$_rts6.audioTrack;
|
|
5641
5721
|
}
|
|
5642
5722
|
}, {
|
|
5643
5723
|
key: "core",
|
|
@@ -5647,37 +5727,41 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
5647
5727
|
}, {
|
|
5648
5728
|
key: "loader",
|
|
5649
5729
|
get: function get() {
|
|
5650
|
-
var _this$
|
|
5651
|
-
return (_this$
|
|
5730
|
+
var _this$_rts7;
|
|
5731
|
+
return (_this$_rts7 = this._rts) === null || _this$_rts7 === void 0 ? void 0 : _this$_rts7.loader;
|
|
5652
5732
|
}
|
|
5653
5733
|
}, {
|
|
5654
5734
|
key: "version",
|
|
5655
5735
|
get: function get() {
|
|
5656
|
-
return "0.2.1-alpha.
|
|
5736
|
+
return "0.2.1-alpha.14";
|
|
5657
5737
|
}
|
|
5658
5738
|
}, {
|
|
5659
5739
|
key: "beforePlayerInit",
|
|
5660
5740
|
value: function beforePlayerInit() {
|
|
5661
|
-
var _this$player2, _this2 = this;
|
|
5741
|
+
var _this$player2, _this$player$config, _this$player$config$r, _this2 = this;
|
|
5662
5742
|
this._init();
|
|
5663
5743
|
if (!this._originSwitchFn) {
|
|
5664
5744
|
this._originSwitchFn = this.player.switchURL.bind(this.player);
|
|
5665
5745
|
}
|
|
5666
5746
|
this.player.switchURL = this._onSwitchURL;
|
|
5667
|
-
(_this$player2 = this.player) === null || _this$player2 === void 0 ? void 0 : _this$player2.useHooks("replay",
|
|
5668
|
-
var _this2$_rts;
|
|
5669
|
-
return (_this2$_rts = _this2._rts) === null || _this2$_rts === void 0 ? void 0 : _this2$_rts.switchURL();
|
|
5670
|
-
});
|
|
5747
|
+
(_this$player2 = this.player) === null || _this$player2 === void 0 ? void 0 : _this$player2.useHooks("replay", this._onSwitchURL);
|
|
5671
5748
|
this.on(URL_CHANGE, this._onSwitchURL);
|
|
5672
5749
|
this.on(DESTROY, this.destroy);
|
|
5673
|
-
this.
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5750
|
+
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") {
|
|
5751
|
+
this.on(PAUSE, function() {
|
|
5752
|
+
var _this2$_rts;
|
|
5753
|
+
if (!((_this2$_rts = _this2._rts) !== null && _this2$_rts !== void 0 && _this2$_rts._isReplacing)) {
|
|
5754
|
+
_this2._onPause();
|
|
5755
|
+
}
|
|
5756
|
+
});
|
|
5757
|
+
this.on(PLAY, function() {
|
|
5758
|
+
var _this2$_rts2;
|
|
5759
|
+
if (!((_this2$_rts2 = _this2._rts) !== null && _this2$_rts2 !== void 0 && _this2$_rts2._isReplacing)) {
|
|
5760
|
+
_this2._reInit();
|
|
5761
|
+
}
|
|
5762
|
+
});
|
|
5763
|
+
}
|
|
5764
|
+
this._bindRtsEvents();
|
|
5681
5765
|
try {
|
|
5682
5766
|
BasePlugin.defineGetterOrSetter(this.player, {
|
|
5683
5767
|
__url: {
|
|
@@ -5699,20 +5783,52 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
5699
5783
|
}, {
|
|
5700
5784
|
key: "getStats",
|
|
5701
5785
|
value: function getStats2() {
|
|
5702
|
-
var _this$
|
|
5703
|
-
return (_this$
|
|
5786
|
+
var _this$_rts8;
|
|
5787
|
+
return (_this$_rts8 = this._rts) === null || _this$_rts8 === void 0 ? void 0 : _this$_rts8.getStats();
|
|
5704
5788
|
}
|
|
5705
5789
|
}, {
|
|
5706
5790
|
key: "getStatsSnapshoot",
|
|
5707
5791
|
value: function getStatsSnapshoot2() {
|
|
5708
|
-
var _this$
|
|
5709
|
-
return (_this$
|
|
5792
|
+
var _this$_rts9;
|
|
5793
|
+
return (_this$_rts9 = this._rts) === null || _this$_rts9 === void 0 ? void 0 : _this$_rts9.getStatsSnapshoot();
|
|
5710
5794
|
}
|
|
5711
5795
|
}, {
|
|
5712
5796
|
key: "getNetWorkInfo",
|
|
5713
5797
|
value: function getNetWorkInfo() {
|
|
5714
|
-
var _this$
|
|
5715
|
-
return (_this$
|
|
5798
|
+
var _this$_rts10;
|
|
5799
|
+
return (_this$_rts10 = this._rts) === null || _this$_rts10 === void 0 ? void 0 : _this$_rts10.networkStats;
|
|
5800
|
+
}
|
|
5801
|
+
}, {
|
|
5802
|
+
key: "_clearDisconnectTimer",
|
|
5803
|
+
value: function _clearDisconnectTimer() {
|
|
5804
|
+
clearTimeout(this._disconnectTimer);
|
|
5805
|
+
this._disconnectTimer = void 0;
|
|
5806
|
+
}
|
|
5807
|
+
}, {
|
|
5808
|
+
key: "_closeAfterPause",
|
|
5809
|
+
value: function _closeAfterPause() {
|
|
5810
|
+
var _this$_rts11, _this$config, _this$_rts13;
|
|
5811
|
+
if (!((_this$_rts11 = this._rts) !== null && _this$_rts11 !== void 0 && _this$_rts11._pc)) {
|
|
5812
|
+
return;
|
|
5813
|
+
}
|
|
5814
|
+
if ((_this$config = this.config) !== null && _this$config !== void 0 && _this$config.seamlesslyReload) {
|
|
5815
|
+
var _this$_rts12;
|
|
5816
|
+
this._mediaStream = (_this$_rts12 = this._rts) === null || _this$_rts12 === void 0 ? void 0 : _this$_rts12._mediaStream;
|
|
5817
|
+
}
|
|
5818
|
+
(_this$_rts13 = this._rts) === null || _this$_rts13 === void 0 ? void 0 : _this$_rts13.destroy(true);
|
|
5819
|
+
this._rts = null;
|
|
5820
|
+
}
|
|
5821
|
+
}, {
|
|
5822
|
+
key: "_bindRtsEvents",
|
|
5823
|
+
value: function _bindRtsEvents() {
|
|
5824
|
+
this._transErrorEvent();
|
|
5825
|
+
this._transCoreEvent(EVENT.LOAD_START);
|
|
5826
|
+
this._transCoreEvent(EVENT.LOAD_COMPLETE);
|
|
5827
|
+
this._transCoreEvent(EVENT.TTFB);
|
|
5828
|
+
this._transCoreEvent(EVENT.LOAD_RESPONSE_HEADERS);
|
|
5829
|
+
this._transCoreEvent(EVENT.LOAD_RETRY);
|
|
5830
|
+
this._transCoreEvent(EVENT.METADATA_PARSED);
|
|
5831
|
+
this._transCoreEvent(EXTEND_EVENTS.RTC_STATE_CHANGE);
|
|
5716
5832
|
}
|
|
5717
5833
|
}, {
|
|
5718
5834
|
key: "_transErrorEvent",
|