@volcengine/veplayer-plugin 2.4.2-rc.1 → 2.4.3-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.
Files changed (31) hide show
  1. package/esm/index.development.js +1968 -659
  2. package/esm/index.production.js +1 -1
  3. package/esm/veplayer.plugin.abr.development.js +71 -3
  4. package/esm/veplayer.plugin.abr.production.js +1 -1
  5. package/esm/veplayer.plugin.drm.development.js +71 -3
  6. package/esm/veplayer.plugin.drm.production.js +1 -1
  7. package/esm/veplayer.plugin.flv.development.js +727 -196
  8. package/esm/veplayer.plugin.flv.production.js +1 -1
  9. package/esm/veplayer.plugin.hls.development.js +1237 -308
  10. package/esm/veplayer.plugin.hls.production.js +1 -1
  11. package/esm/veplayer.plugin.mp4.development.js +73 -5
  12. package/esm/veplayer.plugin.mp4.production.js +1 -1
  13. package/esm/veplayer.plugin.rtm.development.js +124 -139
  14. package/esm/veplayer.plugin.rtm.production.js +1 -1
  15. package/esm/veplayer.plugin.shaka.development.js +72 -4
  16. package/esm/veplayer.plugin.shaka.production.js +1 -1
  17. package/package.json +1 -1
  18. package/umd/veplayer.plugin.abr.development.js +71 -3
  19. package/umd/veplayer.plugin.abr.production.js +1 -1
  20. package/umd/veplayer.plugin.drm.development.js +71 -3
  21. package/umd/veplayer.plugin.drm.production.js +1 -1
  22. package/umd/veplayer.plugin.flv.development.js +727 -196
  23. package/umd/veplayer.plugin.flv.production.js +1 -1
  24. package/umd/veplayer.plugin.hls.development.js +1237 -308
  25. package/umd/veplayer.plugin.hls.production.js +1 -1
  26. package/umd/veplayer.plugin.mp4.development.js +73 -5
  27. package/umd/veplayer.plugin.mp4.production.js +1 -1
  28. package/umd/veplayer.plugin.rtm.development.js +124 -139
  29. package/umd/veplayer.plugin.rtm.production.js +1 -1
  30. package/umd/veplayer.plugin.shaka.development.js +72 -4
  31. package/umd/veplayer.plugin.shaka.production.js +1 -1
@@ -335,14 +335,6 @@ function _regeneratorRuntime$1() {
335
335
  }
336
336
  }, exports;
337
337
  }
338
- function _typeof$2(obj) {
339
- "@babel/helpers - typeof";
340
- return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
341
- return typeof obj2;
342
- } : function(obj2) {
343
- return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
344
- }, _typeof$2(obj);
345
- }
346
338
  function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
347
339
  try {
348
340
  var info = gen[key](arg);
@@ -1538,7 +1530,7 @@ util.getCurrentTimeByOffset = function(offsetTime, segments) {
1538
1530
  }
1539
1531
  return offsetTime;
1540
1532
  };
1541
- var version = "3.0.19-rc.0";
1533
+ var version = "3.0.20-rc.6";
1542
1534
  var ERROR_MAP = {
1543
1535
  1: 5101,
1544
1536
  2: 5102,
@@ -1602,8 +1594,6 @@ var Errors = /* @__PURE__ */ _createClass$1(
1602
1594
  }
1603
1595
  }
1604
1596
  );
1605
- var PLAY = "play";
1606
- var PAUSE = "pause";
1607
1597
  var ERROR = "error";
1608
1598
  var DESTROY = "destroy";
1609
1599
  var URL_CHANGE = "urlchange";
@@ -1648,8 +1638,7 @@ function hook(hookName, handler) {
1648
1638
  }
1649
1639
  if (this.__hooks && this.__hooks[hookName]) {
1650
1640
  try {
1651
- var _this$__hooks$hookNam;
1652
- var preRet = (_this$__hooks$hookNam = this.__hooks[hookName]).call.apply(_this$__hooks$hookNam, [this, this].concat(Array.prototype.slice.call(arguments)));
1641
+ var preRet = runHooks(this, hookName, handler);
1653
1642
  if (preRet) {
1654
1643
  if (preRet.then) {
1655
1644
  preRet.then(function(isContinue) {
@@ -1674,6 +1663,19 @@ function hook(hookName, handler) {
1674
1663
  }
1675
1664
  }.bind(this);
1676
1665
  }
1666
+ function findHookIndex(hookName, handler) {
1667
+ var __hooks = this.__hooks;
1668
+ if (!__hooks || !Array.isArray(__hooks[hookName])) {
1669
+ return -1;
1670
+ }
1671
+ var hookHandlers = __hooks[hookName];
1672
+ for (var i = 0; i < hookHandlers.length; i++) {
1673
+ if (hookHandlers[i] === handler) {
1674
+ return i;
1675
+ }
1676
+ }
1677
+ return -1;
1678
+ }
1677
1679
  function useHooks(hookName, handler) {
1678
1680
  var __hooks = this.__hooks;
1679
1681
  if (!__hooks) {
@@ -1683,7 +1685,12 @@ function useHooks(hookName, handler) {
1683
1685
  console.warn("has no supported hook which name [".concat(hookName, "]"));
1684
1686
  return false;
1685
1687
  }
1686
- __hooks && (__hooks[hookName] = handler);
1688
+ if (!Array.isArray(__hooks[hookName])) {
1689
+ __hooks[hookName] = [];
1690
+ }
1691
+ if (findHookIndex.call(this, hookName, handler) === -1) {
1692
+ __hooks[hookName].push(handler);
1693
+ }
1687
1694
  return true;
1688
1695
  }
1689
1696
  function removeHooks(hookName, handler) {
@@ -1691,6 +1698,13 @@ function removeHooks(hookName, handler) {
1691
1698
  if (!__hooks) {
1692
1699
  return;
1693
1700
  }
1701
+ if (Array.isArray(__hooks[hookName])) {
1702
+ var hooks = __hooks[hookName];
1703
+ var index = findHookIndex.call(this, hookName, handler);
1704
+ if (index !== -1) {
1705
+ hooks.splice(index, 1);
1706
+ }
1707
+ }
1694
1708
  delete __hooks[hookName];
1695
1709
  }
1696
1710
  function hooksDescriptor(instance) {
@@ -1712,6 +1726,38 @@ function hooksDescriptor(instance) {
1712
1726
  function delHooksDescriptor(instance) {
1713
1727
  instance.__hooks = null;
1714
1728
  }
1729
+ function runHooks(obj, hookName, handler) {
1730
+ for (var _len5 = arguments.length, args = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
1731
+ args[_key5 - 3] = arguments[_key5];
1732
+ }
1733
+ if (obj.__hooks && Array.isArray(obj.__hooks[hookName])) {
1734
+ var hooks = obj.__hooks[hookName];
1735
+ var index = -1;
1736
+ var runHooksRecursive = function runHooksRecursive2(obj2, hookName2, handler2) {
1737
+ for (var _len6 = arguments.length, args2 = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {
1738
+ args2[_key6 - 3] = arguments[_key6];
1739
+ }
1740
+ index++;
1741
+ if (hooks.length === 0 || index === hooks.length) {
1742
+ return handler2.call.apply(handler2, [obj2, obj2].concat(args2));
1743
+ }
1744
+ var hook2 = hooks[index];
1745
+ var ret = hook2.call.apply(hook2, [obj2, obj2].concat(args2));
1746
+ if (ret && ret.then) {
1747
+ return ret.then(function(data) {
1748
+ return data === false ? null : runHooksRecursive2.apply(void 0, [obj2, hookName2, handler2].concat(args2));
1749
+ }).catch(function(e) {
1750
+ console.warn("[runHooks]".concat(hookName2, " reject"), e.message);
1751
+ });
1752
+ } else if (ret !== false) {
1753
+ return runHooksRecursive2.apply(void 0, [obj2, hookName2, handler2].concat(args2));
1754
+ }
1755
+ };
1756
+ return runHooksRecursive.apply(void 0, [obj, hookName, handler].concat(args));
1757
+ } else {
1758
+ return handler.call.apply(handler, [obj, obj].concat(args));
1759
+ }
1760
+ }
1715
1761
  function showErrorMsg(pluginName, msg) {
1716
1762
  XG_DEBUG.logError("[".concat(pluginName, "] event or callback cant be undefined or null when call ").concat(msg));
1717
1763
  }
@@ -1951,6 +1997,18 @@ var BasePlugin = /* @__PURE__ */ function() {
1951
1997
  }
1952
1998
  }
1953
1999
  }
2000
+ }, {
2001
+ key: "defineMethod",
2002
+ value: function defineMethod(Obj, map) {
2003
+ for (var key in map) {
2004
+ if (Object.prototype.hasOwnProperty.call(map, key) && typeof map[key] === "function") {
2005
+ Object.defineProperty(Obj, key, {
2006
+ configurable: true,
2007
+ value: map[key]
2008
+ });
2009
+ }
2010
+ }
2011
+ }
1954
2012
  }, {
1955
2013
  key: "defaultConfig",
1956
2014
  get: function get() {
@@ -4818,8 +4876,7 @@ function getOption(opts) {
4818
4876
  loadTimeout: 5e3,
4819
4877
  stallInterval: 400,
4820
4878
  networkEvaluateInterval: 1e3,
4821
- delayHint: 0,
4822
- seamlesslyReload: false
4879
+ delayHint: 0
4823
4880
  }, opts);
4824
4881
  }
4825
4882
  function _getStats(stats) {
@@ -5082,7 +5139,6 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
5082
5139
  _defineProperty$2(_assertThisInitialized$1(_this), "_audioTransceicer", null);
5083
5140
  _defineProperty$2(_assertThisInitialized$1(_this), "_videoTransceicer", null);
5084
5141
  _defineProperty$2(_assertThisInitialized$1(_this), "_mediaStream", null);
5085
- _defineProperty$2(_assertThisInitialized$1(_this), "_lastMediaStream", null);
5086
5142
  _defineProperty$2(_assertThisInitialized$1(_this), "_media", null);
5087
5143
  _defineProperty$2(_assertThisInitialized$1(_this), "_opts", null);
5088
5144
  _defineProperty$2(_assertThisInitialized$1(_this), "_loader", null);
@@ -5090,10 +5146,19 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
5090
5146
  _defineProperty$2(_assertThisInitialized$1(_this), "_retry", 0);
5091
5147
  _defineProperty$2(_assertThisInitialized$1(_this), "_waitingTimer", 0);
5092
5148
  _defineProperty$2(_assertThisInitialized$1(_this), "_rctConnectStartTs", 0);
5093
- _defineProperty$2(_assertThisInitialized$1(_this), "_isReplacing", false);
5094
5149
  _defineProperty$2(_assertThisInitialized$1(_this), "_onTrack", function(e) {
5095
5150
  logger.log("addTrack: ", e.track, e.streams);
5096
5151
  _this["_".concat(e.track.kind)] = e.track;
5152
+ if (!_this._mediaStream) {
5153
+ _this._mediaStream = new MediaStream();
5154
+ _this._media.srcObject = _this._mediaStream;
5155
+ var req = _this._media.play();
5156
+ if (req && req.catch) {
5157
+ req.catch(function(e2) {
5158
+ });
5159
+ }
5160
+ }
5161
+ _this._mediaStream.addTrack(e.track);
5097
5162
  });
5098
5163
  _defineProperty$2(_assertThisInitialized$1(_this), "_mockWaitingByTimeupdate", function() {
5099
5164
  var _this$_pc, _this$_pc2;
@@ -5141,9 +5206,6 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
5141
5206
  }));
5142
5207
  _this._retry = _this._opts.retryCount;
5143
5208
  _this._bindMediaEvent();
5144
- if (_this._opts.mediaStream && _this._opts.seamlesslyReload) {
5145
- _this._lastMediaStream = _this._opts.mediaStream;
5146
- }
5147
5209
  return _this;
5148
5210
  }
5149
5211
  _createClass$2(Rts2, [{
@@ -5187,9 +5249,9 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
5187
5249
  }, {
5188
5250
  key: "load",
5189
5251
  value: function() {
5190
- var _load = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee(url, seamless) {
5252
+ var _load = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee(url) {
5191
5253
  var _this2 = this;
5192
- var _this$_pc3;
5254
+ var lastPc;
5193
5255
  return _regeneratorRuntime$1().wrap(function _callee$(_context) {
5194
5256
  while (1)
5195
5257
  switch (_context.prev = _context.next) {
@@ -5197,43 +5259,39 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
5197
5259
  this._disconnect();
5198
5260
  this._url = url;
5199
5261
  this._retry = this._opts.retryCount;
5200
- if (seamless) {
5201
- this._lastPc = this._pc;
5202
- } else {
5203
- (_this$_pc3 = this._pc) === null || _this$_pc3 === void 0 ? void 0 : _this$_pc3.close();
5262
+ lastPc = this._pc;
5263
+ if (lastPc) {
5264
+ lastPc.close();
5204
5265
  }
5205
- _context.prev = 4;
5266
+ _context.prev = 5;
5206
5267
  this._pc = new RTCPeerConnection();
5207
5268
  this._bindRTCEvents();
5208
- _context.next = 9;
5269
+ _context.next = 10;
5209
5270
  return this._connect(url);
5210
- case 9:
5211
- _context.next = 14;
5271
+ case 10:
5272
+ _context.next = 15;
5212
5273
  break;
5213
- case 11:
5214
- _context.prev = 11;
5215
- _context.t0 = _context["catch"](4);
5274
+ case 12:
5275
+ _context.prev = 12;
5276
+ _context.t0 = _context["catch"](5);
5216
5277
  setTimeout(function() {
5217
5278
  return _this2._emitError(StreamingError.create(ERR.OTHER, null, _context.t0));
5218
5279
  });
5219
- case 14:
5280
+ case 15:
5220
5281
  case "end":
5221
5282
  return _context.stop();
5222
5283
  }
5223
- }, _callee, this, [[4, 11]]);
5284
+ }, _callee, this, [[5, 12]]);
5224
5285
  }));
5225
- function load(_x, _x2) {
5286
+ function load(_x) {
5226
5287
  return _load.apply(this, arguments);
5227
5288
  }
5228
5289
  return load;
5229
5290
  }()
5230
5291
  }, {
5231
5292
  key: "switchURL",
5232
- value: function switchURL(url, seamless) {
5233
- if (seamless) {
5234
- this._lastMediaStream = this._mediaStream;
5235
- }
5236
- this.load(url || this._url, seamless);
5293
+ value: function switchURL(url) {
5294
+ this.load(url || this._url);
5237
5295
  }
5238
5296
  }, {
5239
5297
  key: "_bindRTCEvents",
@@ -5259,8 +5317,6 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
5259
5317
  _this3.load(_this3._url);
5260
5318
  }
5261
5319
  if (pc.connectionState === "connected") {
5262
- _this3._closeLastPc();
5263
- _this3._handleMediaStream();
5264
5320
  _this3.emit(EVENT.TTFB, {
5265
5321
  url: _this3._url,
5266
5322
  responseUrl: _this3._url,
@@ -5269,40 +5325,6 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
5269
5325
  }
5270
5326
  });
5271
5327
  }
5272
- }, {
5273
- key: "_handleMediaStream",
5274
- value: function _handleMediaStream() {
5275
- var _this4 = this;
5276
- if (this._lastMediaStream) {
5277
- var _this$_media$play;
5278
- var videoTrack = this._lastMediaStream.getVideoTracks()[0];
5279
- var audioTrack = this._lastMediaStream.getAudioTracks()[0];
5280
- if (videoTrack) {
5281
- this._lastMediaStream.removeTrack(videoTrack);
5282
- }
5283
- if (audioTrack) {
5284
- this._lastMediaStream.removeTrack(audioTrack);
5285
- }
5286
- this._mediaStream = this._lastMediaStream;
5287
- this._mediaStream.addTrack(this._audio);
5288
- this._mediaStream.addTrack(this._video);
5289
- this._isReplacing = true;
5290
- this._media.pause();
5291
- (_this$_media$play = this._media.play()) === null || _this$_media$play === void 0 ? void 0 : _this$_media$play.finally(function() {
5292
- _this4._isReplacing = false;
5293
- });
5294
- } else {
5295
- this._mediaStream = new MediaStream();
5296
- this._mediaStream.addTrack(this._audio);
5297
- this._mediaStream.addTrack(this._video);
5298
- this._media.srcObject = this._mediaStream;
5299
- var req = this._media.play();
5300
- if (req && req.catch) {
5301
- req.catch(function(e) {
5302
- });
5303
- }
5304
- }
5305
- }
5306
5328
  }, {
5307
5329
  key: "_bindMediaEvent",
5308
5330
  value: function _bindMediaEvent() {
@@ -5457,14 +5479,6 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
5457
5479
  }
5458
5480
  return _connect;
5459
5481
  }()
5460
- }, {
5461
- key: "_closeLastPc",
5462
- value: function _closeLastPc() {
5463
- if (this._lastPc) {
5464
- this._lastPc.close();
5465
- this._lastPc = null;
5466
- }
5467
- }
5468
5482
  }, {
5469
5483
  key: "_disconnect",
5470
5484
  value: function _disconnect() {
@@ -5479,19 +5493,17 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
5479
5493
  }, {
5480
5494
  key: "_emitError",
5481
5495
  value: function _emitError(error) {
5482
- this._closeLastPc();
5483
5496
  this.emit(EVENT.ERROR, error);
5484
5497
  }
5485
5498
  }, {
5486
5499
  key: "destroy",
5487
5500
  value: function destroy() {
5488
- var _this$_media2, _this$_opts;
5501
+ var _this$_media2;
5489
5502
  this._disconnect();
5490
5503
  (_this$_media2 = this._media) === null || _this$_media2 === void 0 ? void 0 : _this$_media2.removeEventListener("timeupdate", this._mockWaitingByTimeupdate);
5491
- if (this._media && !((_this$_opts = this._opts) !== null && _this$_opts !== void 0 && _this$_opts.seamlesslyReload)) {
5504
+ if (this._media) {
5492
5505
  this._media.srcObject = null;
5493
5506
  }
5494
- this._closeLastPc();
5495
5507
  if (this._pc) {
5496
5508
  this._pc.close();
5497
5509
  }
@@ -5589,35 +5601,15 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
5589
5601
  }
5590
5602
  _this = _super.call.apply(_super, [this].concat(args));
5591
5603
  _defineProperty$2(_assertThisInitialized$1(_this), "_rts", null);
5592
- _defineProperty$2(_assertThisInitialized$1(_this), "_mediaStream", null);
5593
5604
  _defineProperty$2(_assertThisInitialized$1(_this), "_rtsOpts", null);
5594
- _defineProperty$2(_assertThisInitialized$1(_this), "_onPause", function() {
5595
- var _this$_rts, _this$_rts2, _this$config, _this$_rts4;
5596
- 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) {
5597
- return;
5598
- }
5599
- if ((_this$config = _this.config) !== null && _this$config !== void 0 && _this$config.seamlesslyReload) {
5600
- var _this$_rts3;
5601
- _this._mediaStream = (_this$_rts3 = _this._rts) === null || _this$_rts3 === void 0 ? void 0 : _this$_rts3._mediaStream;
5602
- }
5603
- (_this$_rts4 = _this._rts) === null || _this$_rts4 === void 0 ? void 0 : _this$_rts4.destroy();
5604
- });
5605
- _defineProperty$2(_assertThisInitialized$1(_this), "_onPlay", function() {
5606
- var _this$_rts5, _this$_rts6;
5607
- 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) {
5608
- return;
5609
- }
5610
- _this._init();
5611
- });
5612
5605
  _defineProperty$2(_assertThisInitialized$1(_this), "_init", function() {
5613
- var _this$_rts7;
5614
- (_this$_rts7 = _this._rts) === null || _this$_rts7 === void 0 ? void 0 : _this$_rts7.destroy();
5606
+ var _this$_rts;
5607
+ (_this$_rts = _this._rts) === null || _this$_rts === void 0 ? void 0 : _this$_rts.destroy();
5615
5608
  var config = _this.player.config;
5616
5609
  var rtsOpts = config.rts || {};
5617
5610
  _this._rtsOpts = rtsOpts;
5618
5611
  _this._rts = new Rts(_objectSpread2$2({
5619
5612
  media: _this.player.video,
5620
- mediaStream: _this._mediaStream,
5621
5613
  preProcessUrl: function preProcessUrl(url, ext) {
5622
5614
  var _this$player$preProce, _this$player;
5623
5615
  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)) || {
@@ -5628,39 +5620,36 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
5628
5620
  }, rtsOpts));
5629
5621
  _this._rts.load(config.url);
5630
5622
  });
5631
- _defineProperty$2(_assertThisInitialized$1(_this), "_onSwitchURL", function(url, seamless) {
5623
+ _defineProperty$2(_assertThisInitialized$1(_this), "_onSwitchURL", function(url) {
5632
5624
  if (_this._rts) {
5633
- if (_typeof$2(seamless) === "object") {
5634
- seamless = seamless.seamless;
5635
- }
5636
5625
  _this.player.config.url = url;
5637
- _this._rts.switchURL(url, seamless);
5626
+ _this._rts.switchURL(url);
5638
5627
  }
5639
5628
  });
5640
5629
  _defineProperty$2(_assertThisInitialized$1(_this), "destroy", function() {
5641
- var _this$_rts8;
5630
+ var _this$_rts2;
5642
5631
  _this.player.switchURL = _this._originSwitchFn;
5643
- (_this$_rts8 = _this._rts) === null || _this$_rts8 === void 0 ? void 0 : _this$_rts8.destroy();
5632
+ (_this$_rts2 = _this._rts) === null || _this$_rts2 === void 0 ? void 0 : _this$_rts2.destroy();
5644
5633
  });
5645
5634
  return _this;
5646
5635
  }
5647
5636
  _createClass$2(RtsPlugin2, [{
5648
5637
  key: "pc",
5649
5638
  get: function get() {
5650
- var _this$_rts9;
5651
- return (_this$_rts9 = this._rts) === null || _this$_rts9 === void 0 ? void 0 : _this$_rts9.pc;
5639
+ var _this$_rts3;
5640
+ return (_this$_rts3 = this._rts) === null || _this$_rts3 === void 0 ? void 0 : _this$_rts3.pc;
5652
5641
  }
5653
5642
  }, {
5654
5643
  key: "videoTrack",
5655
5644
  get: function get() {
5656
- var _this$_rts10;
5657
- return (_this$_rts10 = this._rts) === null || _this$_rts10 === void 0 ? void 0 : _this$_rts10.videoTack;
5645
+ var _this$_rts4;
5646
+ return (_this$_rts4 = this._rts) === null || _this$_rts4 === void 0 ? void 0 : _this$_rts4.videoTack;
5658
5647
  }
5659
5648
  }, {
5660
5649
  key: "audioTrack",
5661
5650
  get: function get() {
5662
- var _this$_rts11;
5663
- return (_this$_rts11 = this._rts) === null || _this$_rts11 === void 0 ? void 0 : _this$_rts11.audioTrack;
5651
+ var _this$_rts5;
5652
+ return (_this$_rts5 = this._rts) === null || _this$_rts5 === void 0 ? void 0 : _this$_rts5.audioTrack;
5664
5653
  }
5665
5654
  }, {
5666
5655
  key: "core",
@@ -5670,18 +5659,18 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
5670
5659
  }, {
5671
5660
  key: "loader",
5672
5661
  get: function get() {
5673
- var _this$_rts12;
5674
- return (_this$_rts12 = this._rts) === null || _this$_rts12 === void 0 ? void 0 : _this$_rts12.loader;
5662
+ var _this$_rts6;
5663
+ return (_this$_rts6 = this._rts) === null || _this$_rts6 === void 0 ? void 0 : _this$_rts6.loader;
5675
5664
  }
5676
5665
  }, {
5677
5666
  key: "version",
5678
5667
  get: function get() {
5679
- return "0.2.1-alpha.4";
5668
+ return "0.2.1-alpha.0";
5680
5669
  }
5681
5670
  }, {
5682
5671
  key: "beforePlayerInit",
5683
5672
  value: function beforePlayerInit() {
5684
- var _this$player2, _this2 = this, _this$player$config, _this$player$config$r;
5673
+ var _this$player2, _this2 = this;
5685
5674
  this._init();
5686
5675
  if (!this._originSwitchFn) {
5687
5676
  this._originSwitchFn = this.player.switchURL.bind(this.player);
@@ -5693,10 +5682,6 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
5693
5682
  });
5694
5683
  this.on(URL_CHANGE, this._onSwitchURL);
5695
5684
  this.on(DESTROY, this.destroy);
5696
- if ((_this$player$config = this.player.config) !== null && _this$player$config !== void 0 && (_this$player$config$r = _this$player$config.rts) !== null && _this$player$config$r !== void 0 && _this$player$config$r.seamlesslyReload) {
5697
- this.on(PAUSE, this._onPause);
5698
- this.on(PLAY, this._onPlay);
5699
- }
5700
5685
  this._transErrorEvent();
5701
5686
  this._transCoreEvent(EVENT.LOAD_START);
5702
5687
  this._transCoreEvent(EVENT.LOAD_COMPLETE);
@@ -5726,20 +5711,20 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
5726
5711
  }, {
5727
5712
  key: "getStats",
5728
5713
  value: function getStats2() {
5729
- var _this$_rts13;
5730
- return (_this$_rts13 = this._rts) === null || _this$_rts13 === void 0 ? void 0 : _this$_rts13.getStats();
5714
+ var _this$_rts7;
5715
+ return (_this$_rts7 = this._rts) === null || _this$_rts7 === void 0 ? void 0 : _this$_rts7.getStats();
5731
5716
  }
5732
5717
  }, {
5733
5718
  key: "getStatsSnapshoot",
5734
5719
  value: function getStatsSnapshoot2() {
5735
- var _this$_rts14;
5736
- return (_this$_rts14 = this._rts) === null || _this$_rts14 === void 0 ? void 0 : _this$_rts14.getStatsSnapshoot();
5720
+ var _this$_rts8;
5721
+ return (_this$_rts8 = this._rts) === null || _this$_rts8 === void 0 ? void 0 : _this$_rts8.getStatsSnapshoot();
5737
5722
  }
5738
5723
  }, {
5739
5724
  key: "getNetWorkInfo",
5740
5725
  value: function getNetWorkInfo() {
5741
- var _this$_rts15;
5742
- return (_this$_rts15 = this._rts) === null || _this$_rts15 === void 0 ? void 0 : _this$_rts15.networkStats;
5726
+ var _this$_rts9;
5727
+ return (_this$_rts9 = this._rts) === null || _this$_rts9 === void 0 ? void 0 : _this$_rts9.networkStats;
5743
5728
  }
5744
5729
  }, {
5745
5730
  key: "_transErrorEvent",