@volcengine/veplayer-plugin 2.5.0 → 2.5.1-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.
@@ -1534,7 +1534,7 @@
1534
1534
  }
1535
1535
  return offsetTime;
1536
1536
  };
1537
- var version = "3.0.21-rc.2";
1537
+ var version = "3.0.21-rc.5";
1538
1538
  var ERROR_MAP = {
1539
1539
  1: 5101,
1540
1540
  2: 5102,
@@ -4883,7 +4883,8 @@
4883
4883
  stallInterval: 400,
4884
4884
  networkEvaluateInterval: 1e3,
4885
4885
  delayHint: 0,
4886
- seamlesslyReload: false
4886
+ seamlesslyReload: false,
4887
+ enableOriginSdpLogger: false
4887
4888
  }, opts);
4888
4889
  }
4889
4890
  function _getStats(stats) {
@@ -5372,7 +5373,7 @@
5372
5373
  key: "_connect",
5373
5374
  value: function() {
5374
5375
  var _connect2 = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee2() {
5375
- var pc, offer, delayHint, parsed, finnalUrl, _answer$remoteSdp, _answer$remoteSdp2, parseSession, sessionId, reqStart, res, answer, err, _parsed;
5376
+ var pc, offer, delayHint, parsed, finnalUrl, _this$_opts, _answer$remoteSdp, _this$_opts2, _answer$remoteSdp2, _parsed$media, parseSession, sessionId, reqStart, res, answer, err, _parsed;
5376
5377
  return _regeneratorRuntime$1().wrap(function _callee2$(_context2) {
5377
5378
  while (1)
5378
5379
  switch (_context2.prev = _context2.next) {
@@ -5448,7 +5449,7 @@
5448
5449
  sessionId = parseSession ? parseSession[1] : Date.now() + "666";
5449
5450
  this.emit(EVENT.LOAD_START, {
5450
5451
  url: finnalUrl,
5451
- offersdp: offer.sdp,
5452
+ offersdp: (_this$_opts = this._opts) !== null && _this$_opts !== void 0 && _this$_opts.enableOriginSdpLogger ? offer.sdp : void 0,
5452
5453
  sessionId
5453
5454
  });
5454
5455
  reqStart = Date.now();
@@ -5483,12 +5484,19 @@
5483
5484
  case 42:
5484
5485
  logger.log("answer:");
5485
5486
  logger.log((_answer$remoteSdp = answer.remoteSdp) === null || _answer$remoteSdp === void 0 ? void 0 : _answer$remoteSdp.sdp);
5487
+ _parsed = lib.parse(answer.remoteSdp.sdp);
5486
5488
  this.emit(EVENT.LOAD_COMPLETE, {
5487
5489
  url: finnalUrl,
5488
5490
  elapsed: Date.now() - reqStart,
5489
- answersdp: (_answer$remoteSdp2 = answer.remoteSdp) === null || _answer$remoteSdp2 === void 0 ? void 0 : _answer$remoteSdp2.sdp
5491
+ 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,
5492
+ parsedSdp: _parsed === null || _parsed === void 0 ? void 0 : (_parsed$media = _parsed.media) === null || _parsed$media === void 0 ? void 0 : _parsed$media.map(function(media) {
5493
+ return {
5494
+ candidates: media.candidates,
5495
+ rtp: media.rtp,
5496
+ type: media.type
5497
+ };
5498
+ })
5490
5499
  });
5491
- _parsed = lib.parse(answer.remoteSdp.sdp);
5492
5500
  _parsed.media.forEach(function(x) {
5493
5501
  x.fingerprint.hash = x.fingerprint.hash.toUpperCase();
5494
5502
  });
@@ -5693,6 +5701,7 @@
5693
5701
  _this.player.switchURL = _this._originSwitchFn;
5694
5702
  _this._clearDisconnectTimer();
5695
5703
  (_this$_rts3 = _this._rts) === null || _this$_rts3 === void 0 ? void 0 : _this$_rts3.destroy();
5704
+ _this._rts = null;
5696
5705
  });
5697
5706
  return _this;
5698
5707
  }
@@ -5728,20 +5737,18 @@
5728
5737
  }, {
5729
5738
  key: "version",
5730
5739
  get: function get() {
5731
- return "0.2.1-alpha.12";
5740
+ return "0.2.1-alpha.14";
5732
5741
  }
5733
5742
  }, {
5734
5743
  key: "beforePlayerInit",
5735
5744
  value: function beforePlayerInit() {
5736
- var _this$player2, _this2 = this, _this$player$config, _this$player$config$r;
5745
+ var _this$player2, _this$player$config, _this$player$config$r, _this2 = this;
5737
5746
  this._init();
5738
5747
  if (!this._originSwitchFn) {
5739
5748
  this._originSwitchFn = this.player.switchURL.bind(this.player);
5740
5749
  }
5741
5750
  this.player.switchURL = this._onSwitchURL;
5742
- (_this$player2 = this.player) === null || _this$player2 === void 0 ? void 0 : _this$player2.useHooks("replay", function() {
5743
- return _this2._onSwitchURL();
5744
- });
5751
+ (_this$player2 = this.player) === null || _this$player2 === void 0 ? void 0 : _this$player2.useHooks("replay", this._onSwitchURL);
5745
5752
  this.on(URL_CHANGE, this._onSwitchURL);
5746
5753
  this.on(DESTROY, this.destroy);
5747
5754
  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") {