@byteplus/veplayer-plugin 2.9.2 → 2.9.3-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.
@@ -6780,6 +6780,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
6780
6780
  _defineProperty$2(_assertThisInitialized$1(_this), "_mediaStream", null);
6781
6781
  _defineProperty$2(_assertThisInitialized$1(_this), "_lastMediaStream", null);
6782
6782
  _defineProperty$2(_assertThisInitialized$1(_this), "_media", null);
6783
+ _defineProperty$2(_assertThisInitialized$1(_this), "_player", null);
6783
6784
  _defineProperty$2(_assertThisInitialized$1(_this), "_opts", null);
6784
6785
  _defineProperty$2(_assertThisInitialized$1(_this), "_loader", null);
6785
6786
  _defineProperty$2(_assertThisInitialized$1(_this), "_networkEvaluate", null);
@@ -6848,8 +6849,8 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
6848
6849
  return;
6849
6850
  clearTimeout(_this._waitingTimer);
6850
6851
  _this._waitingTimer = setTimeout(function() {
6851
- var _this$_media;
6852
- if ((_this$_media = _this._media) !== null && _this$_media !== void 0 && _this$_media.paused)
6852
+ var _this$_player;
6853
+ if ((_this$_player = _this._player) !== null && _this$_player !== void 0 && _this$_player.paused)
6853
6854
  return;
6854
6855
  _this.emit("waiting");
6855
6856
  }, _this._opts.stallInterval);
@@ -7047,6 +7048,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
7047
7048
  });
7048
7049
  _this._opts = getOption(opts);
7049
7050
  _this._media = _this._opts.media;
7051
+ _this._player = _this._opts.player;
7050
7052
  _this._loader = new NetLoader(_objectSpread2$2(_objectSpread2$2({}, opts.fetchOptions), {}, {
7051
7053
  responseType: "json",
7052
7054
  method: "POST",
@@ -7201,7 +7203,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
7201
7203
  value: function _handleMediaStream() {
7202
7204
  var _this4 = this;
7203
7205
  if (this._lastMediaStream) {
7204
- var _this$_media$play;
7206
+ var _this$_player$play;
7205
7207
  var videoTrack = this._lastMediaStream.getVideoTracks()[0];
7206
7208
  var audioTrack = this._lastMediaStream.getAudioTracks()[0];
7207
7209
  if (videoTrack) {
@@ -7214,8 +7216,8 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
7214
7216
  this._audio && this._mediaStream.addTrack(this._audio);
7215
7217
  this._video && this._mediaStream.addTrack(this._video);
7216
7218
  this._isReplacing = true;
7217
- this._media.pause();
7218
- (_this$_media$play = this._media.play()) === null || _this$_media$play === void 0 ? void 0 : _this$_media$play.finally(function() {
7219
+ this._player.pause();
7220
+ (_this$_player$play = this._player.play()) === null || _this$_player$play === void 0 ? void 0 : _this$_player$play.finally(function() {
7219
7221
  _this4._isReplacing = false;
7220
7222
  });
7221
7223
  } else {
@@ -7223,7 +7225,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
7223
7225
  this._audio && this._mediaStream.addTrack(this._audio);
7224
7226
  this._video && this._mediaStream.addTrack(this._video);
7225
7227
  this._media.srcObject = this._mediaStream;
7226
- var req = this._media.play();
7228
+ var req = this._player.play();
7227
7229
  if (req && req.catch) {
7228
7230
  req.catch(function(e) {
7229
7231
  });
@@ -7715,11 +7717,11 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
7715
7717
  }, {
7716
7718
  key: "destroy",
7717
7719
  value: function destroy(keepClearMediaStream) {
7718
- var _this$_revertVolumeWo, _this$_media2;
7720
+ var _this$_revertVolumeWo, _this$_media;
7719
7721
  this._disconnect();
7720
7722
  (_this$_revertVolumeWo = this._revertVolumeWorkaround) === null || _this$_revertVolumeWo === void 0 ? void 0 : _this$_revertVolumeWo.call(this);
7721
7723
  delete this._revertVolumeWorkaround;
7722
- (_this$_media2 = this._media) === null || _this$_media2 === void 0 ? void 0 : _this$_media2.removeEventListener("timeupdate", this._mockWaitingByTimeupdate);
7724
+ (_this$_media = this._media) === null || _this$_media === void 0 ? void 0 : _this$_media.removeEventListener("timeupdate", this._mockWaitingByTimeupdate);
7723
7725
  if (this._media && !keepClearMediaStream) {
7724
7726
  this._media.srcObject = null;
7725
7727
  }
@@ -7728,6 +7730,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
7728
7730
  }
7729
7731
  this._loader = null;
7730
7732
  this._media = null;
7733
+ this._player = null;
7731
7734
  this._pc = null;
7732
7735
  this._opts = null;
7733
7736
  }
@@ -7792,6 +7795,7 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
7792
7795
  _this._rtsOpts = rtsOpts;
7793
7796
  _this._rts = new Rts(_objectSpread2$2({
7794
7797
  media: _this.player.video,
7798
+ player: _this.player,
7795
7799
  mediaStream: _this._mediaStream,
7796
7800
  preProcessUrl: function preProcessUrl(url, ext) {
7797
7801
  var _this$player$preProce, _this$player;
@@ -7854,7 +7858,7 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
7854
7858
  }, {
7855
7859
  key: "version",
7856
7860
  get: function get() {
7857
- return "0.2.1-alpha.45";
7861
+ return "0.2.1-alpha.47";
7858
7862
  }
7859
7863
  }, {
7860
7864
  key: "beforePlayerInit",