@volcengine/veplayer 2.12.0-rc.1 → 2.12.0-rc.2

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.
@@ -1461,7 +1461,7 @@ var sniffer$1 = {
1461
1461
  }
1462
1462
  }
1463
1463
  };
1464
- var version$3 = "3.0.24-rc.2";
1464
+ var version$3 = "3.0.24-rc.6";
1465
1465
  var ERROR_TYPE_MAP = {
1466
1466
  1: "media",
1467
1467
  2: "media",
@@ -4542,6 +4542,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
4542
4542
  _inherits$2(Player2, _MediaProxy);
4543
4543
  var _super = _createSuper$2(Player2);
4544
4544
  function Player2(options) {
4545
+ var _this$onReady, _this2;
4545
4546
  var _this;
4546
4547
  _classCallCheck$2(this, Player2);
4547
4548
  var _config = util$1.deepMerge(getDefaultConfig$1(), options);
@@ -4710,16 +4711,18 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
4710
4711
  return _possibleConstructorReturn$2(_this);
4711
4712
  }
4712
4713
  var _this$config2 = _this.config, _this$config2$definit = _this$config2.definition, definition = _this$config2$definit === void 0 ? {} : _this$config2$definit, url2 = _this$config2.url;
4713
- if (!url2 && definition.list && definition.list.length > 0) {
4714
- var defaultDefinitionObj = definition.list.find(function(e2) {
4714
+ if (Array.isArray(definition === null || definition === void 0 ? void 0 : definition.list) && definition.list.length > 0) {
4715
+ var curDefinition = definition.list.find(function(e2) {
4715
4716
  return e2.definition && e2.definition === definition.defaultDefinition;
4716
4717
  });
4717
- if (!defaultDefinitionObj) {
4718
+ if (!curDefinition) {
4718
4719
  definition.defaultDefinition = definition.list[0].definition;
4719
- defaultDefinitionObj = definition.list[0];
4720
+ curDefinition = definition.list[0];
4721
+ }
4722
+ _this.curDefinition = curDefinition;
4723
+ if (!url2) {
4724
+ _this.config.url = curDefinition.url;
4720
4725
  }
4721
- _this.config.url = defaultDefinitionObj.url;
4722
- _this.curDefinition = defaultDefinitionObj;
4723
4726
  }
4724
4727
  _this._bindEvents();
4725
4728
  _this._registerPresets();
@@ -4730,7 +4733,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
4730
4733
  util$1.setTimeout(_assertThisInitialized$2(_this), function() {
4731
4734
  _this.emit(READY);
4732
4735
  }, 0);
4733
- _this.onReady && _this.onReady();
4736
+ (_this$onReady = (_this2 = _this).onReady) === null || _this$onReady === void 0 ? void 0 : _this$onReady.call(_this2);
4734
4737
  if (_this.config.videoInit || _this.config.autoplay) {
4735
4738
  if (!_this.hasStart || _this.state < STATES.ATTACHED) {
4736
4739
  _this.start();
@@ -4741,7 +4744,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
4741
4744
  _createClass$3(Player2, [{
4742
4745
  key: "_initDOM",
4743
4746
  value: function _initDOM() {
4744
- var _instManager, _this2 = this;
4747
+ var _instManager, _this3 = this;
4745
4748
  this.root = this.config.id ? document.getElementById(this.config.id) : null;
4746
4749
  if (!this.root) {
4747
4750
  var el = this.config.el;
@@ -4794,15 +4797,15 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
4794
4797
  "padding-top": "".concat(_height * 100 / _width, "%")
4795
4798
  };
4796
4799
  Object.keys(style).forEach(function(key) {
4797
- _this2.root.style[key] = style[key];
4800
+ _this3.root.style[key] = style[key];
4798
4801
  });
4799
4802
  } else {
4800
4803
  ["width", "height"].forEach(function(key) {
4801
- if (_this2.config[key]) {
4802
- if (typeof _this2.config[key] !== "number") {
4803
- _this2.root.style[key] = _this2.config[key];
4804
+ if (_this3.config[key]) {
4805
+ if (typeof _this3.config[key] !== "number") {
4806
+ _this3.root.style[key] = _this3.config[key];
4804
4807
  } else {
4805
- _this2.root.style[key] = "".concat(_this2.config[key], "px");
4808
+ _this3.root.style[key] = "".concat(_this3.config[key], "px");
4806
4809
  }
4807
4810
  }
4808
4811
  });
@@ -4830,12 +4833,12 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
4830
4833
  }, {
4831
4834
  key: "_bindEvents",
4832
4835
  value: function _bindEvents() {
4833
- var _this3 = this;
4836
+ var _this4 = this;
4834
4837
  ["focus", "blur"].forEach(function(item) {
4835
- _this3.on(item, _this3["on" + item.charAt(0).toUpperCase() + item.slice(1)]);
4838
+ _this4.on(item, _this4["on" + item.charAt(0).toUpperCase() + item.slice(1)]);
4836
4839
  });
4837
4840
  FULLSCREEN_EVENTS.forEach(function(item) {
4838
- document && document.addEventListener(item, _this3.onFullscreenChange);
4841
+ document && document.addEventListener(item, _this4.onFullscreenChange);
4839
4842
  });
4840
4843
  if (sniffer$1.os.isIos) {
4841
4844
  this.media.addEventListener("webkitbeginfullscreen", this._onWebkitbeginfullscreen);
@@ -4843,8 +4846,8 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
4843
4846
  }
4844
4847
  this.once(LOADED_DATA, this.resize);
4845
4848
  this.playFunc = function() {
4846
- if (!_this3.config.closeFocusVideoFocus) {
4847
- _this3.media.focus();
4849
+ if (!_this4.config.closeFocusVideoFocus) {
4850
+ _this4.media.focus();
4848
4851
  }
4849
4852
  };
4850
4853
  this.once(PLAY, this.playFunc);
@@ -4852,10 +4855,10 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
4852
4855
  }, {
4853
4856
  key: "_unbindEvents",
4854
4857
  value: function _unbindEvents() {
4855
- var _this4 = this;
4858
+ var _this5 = this;
4856
4859
  this.root.removeEventListener("mousemove", this.mousemoveFunc);
4857
4860
  FULLSCREEN_EVENTS.forEach(function(item) {
4858
- document.removeEventListener(item, _this4.onFullscreenChange);
4861
+ document.removeEventListener(item, _this5.onFullscreenChange);
4859
4862
  });
4860
4863
  this.playFunc && this.off(PLAY, this.playFunc);
4861
4864
  this.off(CANPLAY, this.canPlayFunc);
@@ -4874,7 +4877,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
4874
4877
  }, {
4875
4878
  key: "_startInit",
4876
4879
  value: function _startInit(url2) {
4877
- var _this5 = this;
4880
+ var _this6 = this;
4878
4881
  var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
4879
4882
  if (!this.media) {
4880
4883
  return;
@@ -4927,13 +4930,13 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
4927
4930
  this.hasStart = true;
4928
4931
  this.setState(STATES.ATTACHED);
4929
4932
  util$1.setTimeout(this, function() {
4930
- _this5.emit(COMPLETE);
4933
+ _this6.emit(COMPLETE);
4931
4934
  }, 0);
4932
4935
  }
4933
4936
  }, {
4934
4937
  key: "_registerPlugins",
4935
4938
  value: function _registerPlugins() {
4936
- var _this6 = this;
4939
+ var _this7 = this;
4937
4940
  var isInit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
4938
4941
  this._loadingPlugins = [];
4939
4942
  var ignores = this.config.ignores || [];
@@ -4952,19 +4955,19 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
4952
4955
  return;
4953
4956
  }
4954
4957
  if (plugin.lazy && plugin.loader) {
4955
- var loadingPlugin = pluginsManager.lazyRegister(_this6, plugin);
4958
+ var loadingPlugin = pluginsManager.lazyRegister(_this7, plugin);
4956
4959
  if (plugin.forceBeforeInit) {
4957
4960
  loadingPlugin.then(function() {
4958
- _this6._loadingPlugins.splice(_this6._loadingPlugins.indexOf(loadingPlugin), 1);
4961
+ _this7._loadingPlugins.splice(_this7._loadingPlugins.indexOf(loadingPlugin), 1);
4959
4962
  }).catch(function(e2) {
4960
4963
  XG_DEBUG.logError("_registerPlugins:loadingPlugin", e2);
4961
- _this6._loadingPlugins.splice(_this6._loadingPlugins.indexOf(loadingPlugin), 1);
4964
+ _this7._loadingPlugins.splice(_this7._loadingPlugins.indexOf(loadingPlugin), 1);
4962
4965
  });
4963
- _this6._loadingPlugins.push(loadingPlugin);
4966
+ _this7._loadingPlugins.push(loadingPlugin);
4964
4967
  }
4965
4968
  return;
4966
4969
  }
4967
- return _this6.registerPlugin(plugin);
4970
+ return _this7.registerPlugin(plugin);
4968
4971
  } catch (err) {
4969
4972
  XG_DEBUG.logError("_registerPlugins:", err);
4970
4973
  }
@@ -4973,9 +4976,9 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
4973
4976
  }, {
4974
4977
  key: "_registerPresets",
4975
4978
  value: function _registerPresets() {
4976
- var _this7 = this;
4979
+ var _this8 = this;
4977
4980
  this.config.presets.forEach(function(preset) {
4978
- usePreset(_this7, preset);
4981
+ usePreset(_this8, preset);
4979
4982
  });
4980
4983
  }
4981
4984
  }, {
@@ -5125,7 +5128,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5125
5128
  }, {
5126
5129
  key: "start",
5127
5130
  value: function start(url2) {
5128
- var _this8 = this;
5131
+ var _this9 = this;
5129
5132
  if (this.state > STATES.ATTACHING) {
5130
5133
  return;
5131
5134
  }
@@ -5140,14 +5143,14 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5140
5143
  this.setState(STATES.ATTACHING);
5141
5144
  this._registerPlugins(false);
5142
5145
  return pluginsManager.beforeInit(this).then(function() {
5143
- if (!_this8.config) {
5146
+ if (!_this9.config) {
5144
5147
  return;
5145
5148
  }
5146
5149
  if (!url2) {
5147
- url2 = _this8.url || _this8.config.url;
5150
+ url2 = _this9.url || _this9.config.url;
5148
5151
  }
5149
- var _furl = _this8.preProcessUrl(url2);
5150
- var ret = _this8._startInit(_furl.url, {
5152
+ var _furl = _this9.preProcessUrl(url2);
5153
+ var ret = _this9._startInit(_furl.url, {
5151
5154
  playSessionId
5152
5155
  });
5153
5156
  return ret;
@@ -5161,7 +5164,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5161
5164
  }, {
5162
5165
  key: "switchURL",
5163
5166
  value: function switchURL(url2, options) {
5164
- var _this9 = this;
5167
+ var _this10 = this;
5165
5168
  var _src = url2;
5166
5169
  if (util$1.typeOf(url2) === "Object") {
5167
5170
  _src = url2.url;
@@ -5173,32 +5176,32 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5173
5176
  this.src = _src;
5174
5177
  return new Promise(function(resolve, reject) {
5175
5178
  var _error = function _error2(e2) {
5176
- _this9.off("timeupdate", _canplay);
5177
- _this9.off("canplay", _canplay);
5179
+ _this10.off("timeupdate", _canplay);
5180
+ _this10.off("canplay", _canplay);
5178
5181
  reject(e2);
5179
5182
  };
5180
5183
  var _canplay = function _canplay2() {
5181
- _this9._seekToStartTime();
5184
+ _this10._seekToStartTime();
5182
5185
  if (isPaused) {
5183
- _this9.pause();
5186
+ _this10.pause();
5184
5187
  }
5185
- _this9.off("error", _error);
5188
+ _this10.off("error", _error);
5186
5189
  resolve(true);
5187
5190
  };
5188
- _this9.once("error", _error);
5191
+ _this10.once("error", _error);
5189
5192
  if (!_src) {
5190
- _this9.errorHandler("error", {
5193
+ _this10.errorHandler("error", {
5191
5194
  code: 6,
5192
5195
  message: "empty_src"
5193
5196
  });
5194
5197
  return;
5195
5198
  }
5196
5199
  if (sniffer$1.os.isAndroid) {
5197
- _this9.once("timeupdate", _canplay);
5200
+ _this10.once("timeupdate", _canplay);
5198
5201
  } else {
5199
- _this9.once("canplay", _canplay);
5202
+ _this10.once("canplay", _canplay);
5200
5203
  }
5201
- _this9.play();
5204
+ _this10.play();
5202
5205
  });
5203
5206
  }
5204
5207
  }, {
@@ -5209,7 +5212,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5209
5212
  }, {
5210
5213
  key: "mediaPlay",
5211
5214
  value: function mediaPlay() {
5212
- var _this10 = this;
5215
+ var _this11 = this;
5213
5216
  if (!this.hasStart && this.state < STATES.ATTACHED) {
5214
5217
  this.removeClass(STATE_CLASS.NO_START);
5215
5218
  this.addClass(STATE_CLASS.ENTER);
@@ -5224,28 +5227,28 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5224
5227
  var playPromise = _get$2(_getPrototypeOf$2(Player2.prototype), "play", this).call(this);
5225
5228
  if (playPromise !== void 0 && playPromise && playPromise.then) {
5226
5229
  playPromise.then(function() {
5227
- _this10.removeClass(STATE_CLASS.NOT_ALLOW_AUTOPLAY);
5228
- _this10.addClass(STATE_CLASS.PLAYING);
5229
- if (_this10.state < STATES.RUNNING) {
5230
+ _this11.removeClass(STATE_CLASS.NOT_ALLOW_AUTOPLAY);
5231
+ _this11.addClass(STATE_CLASS.PLAYING);
5232
+ if (_this11.state < STATES.RUNNING) {
5230
5233
  XG_DEBUG.logInfo(">>>>playPromise.then");
5231
- _this10.setState(STATES.RUNNING);
5232
- _this10.emit(AUTOPLAY_STARTED);
5234
+ _this11.setState(STATES.RUNNING);
5235
+ _this11.emit(AUTOPLAY_STARTED);
5233
5236
  }
5234
5237
  }).catch(function(e2) {
5235
5238
  XG_DEBUG.logWarn(">>>>playPromise.catch", e2.name);
5236
- if (_this10.media && _this10.media.error) {
5237
- _this10.onError();
5238
- _this10.removeClass(STATE_CLASS.ENTER);
5239
+ if (_this11.media && _this11.media.error) {
5240
+ _this11.onError();
5241
+ _this11.removeClass(STATE_CLASS.ENTER);
5239
5242
  return;
5240
5243
  }
5241
5244
  if (e2.name === "NotAllowedError") {
5242
- _this10._errorTimer = util$1.setTimeout(_this10, function() {
5243
- _this10._errorTimer = null;
5244
- _this10.emit(AUTOPLAY_PREVENTED);
5245
- _this10.addClass(STATE_CLASS.NOT_ALLOW_AUTOPLAY);
5246
- _this10.removeClass(STATE_CLASS.ENTER);
5247
- _this10.pause();
5248
- _this10.setState(STATES.NOTALLOW);
5245
+ _this11._errorTimer = util$1.setTimeout(_this11, function() {
5246
+ _this11._errorTimer = null;
5247
+ _this11.emit(AUTOPLAY_PREVENTED);
5248
+ _this11.addClass(STATE_CLASS.NOT_ALLOW_AUTOPLAY);
5249
+ _this11.removeClass(STATE_CLASS.ENTER);
5250
+ _this11.pause();
5251
+ _this11.setState(STATES.NOTALLOW);
5249
5252
  }, 0);
5250
5253
  }
5251
5254
  });
@@ -5275,24 +5278,24 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5275
5278
  }, {
5276
5279
  key: "play",
5277
5280
  value: function play() {
5278
- var _this11 = this;
5281
+ var _this12 = this;
5279
5282
  this.removeClass(STATE_CLASS.PAUSED);
5280
5283
  return runHooks(this, "play", function() {
5281
- return _this11.mediaPlay();
5284
+ return _this12.mediaPlay();
5282
5285
  });
5283
5286
  }
5284
5287
  }, {
5285
5288
  key: "pause",
5286
5289
  value: function pause() {
5287
- var _this12 = this;
5290
+ var _this13 = this;
5288
5291
  runHooks(this, "pause", function() {
5289
- _get$2(_getPrototypeOf$2(Player2.prototype), "pause", _this12).call(_this12);
5292
+ _get$2(_getPrototypeOf$2(Player2.prototype), "pause", _this13).call(_this13);
5290
5293
  });
5291
5294
  }
5292
5295
  }, {
5293
5296
  key: "seek",
5294
5297
  value: function seek(time, status2) {
5295
- var _this13 = this;
5298
+ var _this14 = this;
5296
5299
  if (!this.media || Number.isNaN(Number(time)) || !this.hasStart) {
5297
5300
  return;
5298
5301
  }
@@ -5302,20 +5305,20 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5302
5305
  !this._isPauseBeforeSeek && (this._isPauseBeforeSeek = this.paused ? 2 : 1);
5303
5306
  this._onceSeekCanplay && this.off(SEEKED, this._onceSeekCanplay);
5304
5307
  this._onceSeekCanplay = function() {
5305
- _this13.removeClass(STATE_CLASS.ENTER);
5306
- _this13.isSeeking = false;
5308
+ _this14.removeClass(STATE_CLASS.ENTER);
5309
+ _this14.isSeeking = false;
5307
5310
  switch (_status) {
5308
5311
  case "play":
5309
- _this13.play();
5312
+ _this14.play();
5310
5313
  break;
5311
5314
  case "pause":
5312
- _this13.pause();
5315
+ _this14.pause();
5313
5316
  break;
5314
5317
  default:
5315
- _this13._isPauseBeforeSeek > 1 || _this13.paused ? _this13.pause() : _this13.play();
5318
+ _this14._isPauseBeforeSeek > 1 || _this14.paused ? _this14.pause() : _this14.play();
5316
5319
  }
5317
- _this13._isPauseBeforeSeek = 0;
5318
- _this13._onceSeekCanplay = null;
5320
+ _this14._isPauseBeforeSeek = 0;
5321
+ _this14._onceSeekCanplay = null;
5319
5322
  };
5320
5323
  this.once(SEEKED, this._onceSeekCanplay);
5321
5324
  if (this.state < STATES.RUNNING) {
@@ -5329,13 +5332,13 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5329
5332
  }, {
5330
5333
  key: "getInitDefinition",
5331
5334
  value: function getInitDefinition() {
5332
- var _this14 = this;
5335
+ var _this15 = this;
5333
5336
  var _this$config5 = this.config, definition = _this$config5.definition, url2 = _this$config5.url;
5334
5337
  if (!url2 && definition && definition.list && definition.list.length > 0 && definition.defaultDefinition) {
5335
5338
  definition.list.map(function(item) {
5336
5339
  if (item.definition === definition.defaultDefinition) {
5337
- _this14.config.url = item.url;
5338
- _this14.curDefinition = item;
5340
+ _this15.config.url = item.url;
5341
+ _this15.curDefinition = item;
5339
5342
  }
5340
5343
  });
5341
5344
  }
@@ -5343,12 +5346,12 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5343
5346
  }, {
5344
5347
  key: "changeDefinition",
5345
5348
  value: function changeDefinition(to, from) {
5346
- var _this15 = this;
5349
+ var _this16 = this;
5347
5350
  var definition = this.config.definition;
5348
5351
  if (Array.isArray(definition === null || definition === void 0 ? void 0 : definition.list)) {
5349
5352
  definition.list.forEach(function(item) {
5350
5353
  if ((to === null || to === void 0 ? void 0 : to.definition) === item.definition) {
5351
- _this15.curDefinition = item;
5354
+ _this16.curDefinition = item;
5352
5355
  }
5353
5356
  });
5354
5357
  }
@@ -5368,7 +5371,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5368
5371
  }, to));
5369
5372
  if (ret && ret.then) {
5370
5373
  ret.then(function() {
5371
- _this15.emit(AFTER_DEFINITION_CHANGE, {
5374
+ _this16.emit(AFTER_DEFINITION_CHANGE, {
5372
5375
  from,
5373
5376
  to
5374
5377
  });
@@ -5392,7 +5395,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5392
5395
  }, {
5393
5396
  key: "resetState",
5394
5397
  value: function resetState() {
5395
- var _this16 = this;
5398
+ var _this17 = this;
5396
5399
  var NOT_ALLOW_AUTOPLAY = STATE_CLASS.NOT_ALLOW_AUTOPLAY, PLAYING2 = STATE_CLASS.PLAYING, NO_START = STATE_CLASS.NO_START, PAUSED = STATE_CLASS.PAUSED, REPLAY2 = STATE_CLASS.REPLAY, ENTER = STATE_CLASS.ENTER, ENDED2 = STATE_CLASS.ENDED, ERROR2 = STATE_CLASS.ERROR, LOADING2 = STATE_CLASS.LOADING;
5397
5400
  var clsList = [NOT_ALLOW_AUTOPLAY, PLAYING2, NO_START, PAUSED, REPLAY2, ENTER, ENDED2, ERROR2, LOADING2];
5398
5401
  this.hasStart = false;
@@ -5403,7 +5406,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5403
5406
  this._accPlayed.t = 0;
5404
5407
  this._accPlayed.loopAcc = 0;
5405
5408
  clsList.forEach(function(cls) {
5406
- _this16.removeClass(cls);
5409
+ _this17.removeClass(cls);
5407
5410
  });
5408
5411
  this.addClass(STATE_CLASS.NO_START);
5409
5412
  this.emit(RESET);
@@ -5411,7 +5414,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5411
5414
  }, {
5412
5415
  key: "reset",
5413
5416
  value: function reset() {
5414
- var _this17 = this;
5417
+ var _this18 = this;
5415
5418
  var unregisterPlugins = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
5416
5419
  var isResetConfig = arguments.length > 1 ? arguments[1] : void 0;
5417
5420
  this.resetState();
@@ -5420,13 +5423,13 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5420
5423
  return;
5421
5424
  }
5422
5425
  unregisterPlugins.map(function(pn2) {
5423
- _this17.deregister(pn2);
5426
+ _this18.deregister(pn2);
5424
5427
  });
5425
5428
  if (isResetConfig) {
5426
5429
  var de2 = getDefaultConfig$1();
5427
5430
  Object.keys(this.config).forEach(function(k2) {
5428
- if (_this17.config[k2] !== "undefined" && (k2 === "plugins" || k2 === "presets" || k2 === "el" || k2 === "id")) {
5429
- _this17.config[k2] = de2[k2];
5431
+ if (_this18.config[k2] !== "undefined" && (k2 === "plugins" || k2 === "presets" || k2 === "el" || k2 === "id")) {
5432
+ _this18.config[k2] = de2[k2];
5430
5433
  }
5431
5434
  });
5432
5435
  }
@@ -5434,7 +5437,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5434
5437
  }, {
5435
5438
  key: "destroy",
5436
5439
  value: function destroy2() {
5437
- var _instManager2, _this18 = this;
5440
+ var _instManager2, _this19 = this;
5438
5441
  var innerContainer = this.innerContainer, root2 = this.root, media = this.media;
5439
5442
  if (!root2 || !media) {
5440
5443
  return;
@@ -5463,8 +5466,8 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5463
5466
  }
5464
5467
  !innerContainer && media instanceof window.Node && root2.contains(media) && !this.config.remainMediaAfterDestroy && root2.removeChild(media);
5465
5468
  ["topBar", "leftBar", "rightBar", "innerContainer"].map(function(item) {
5466
- _this18[item] && root2.removeChild(_this18[item]);
5467
- _this18[item] = null;
5469
+ _this19[item] && root2.removeChild(_this19[item]);
5470
+ _this19[item] = null;
5468
5471
  });
5469
5472
  var cList = root2.className.split(" ");
5470
5473
  if (cList.length > 0) {
@@ -5476,45 +5479,45 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5476
5479
  }
5477
5480
  this.removeAttribute("data-xgfill");
5478
5481
  ["isSeeking", "isCanplay", "isActive", "cssfullscreen", "fullscreen"].forEach(function(key) {
5479
- _this18[key] = false;
5482
+ _this19[key] = false;
5480
5483
  });
5481
5484
  }
5482
5485
  }, {
5483
5486
  key: "replay",
5484
5487
  value: function replay() {
5485
- var _this19 = this;
5488
+ var _this20 = this;
5486
5489
  this.removeClass(STATE_CLASS.ENDED);
5487
5490
  this.currentTime = 0;
5488
5491
  this.isSeeking = false;
5489
5492
  runHooks(this, "replay", function() {
5490
- _this19.once(SEEKED, function() {
5491
- var playPromise = _this19.mediaPlay();
5493
+ _this20.once(SEEKED, function() {
5494
+ var playPromise = _this20.mediaPlay();
5492
5495
  if (playPromise && playPromise.catch) {
5493
5496
  playPromise.catch(function(err) {
5494
5497
  console.log(err);
5495
5498
  });
5496
5499
  }
5497
5500
  });
5498
- _this19.emit(REPLAY);
5499
- _this19.onPlay();
5501
+ _this20.emit(REPLAY);
5502
+ _this20.onPlay();
5500
5503
  });
5501
5504
  }
5502
5505
  }, {
5503
5506
  key: "retry",
5504
5507
  value: function retry() {
5505
- var _this20 = this;
5508
+ var _this21 = this;
5506
5509
  this.removeClass(STATE_CLASS.ERROR);
5507
5510
  this.addClass(STATE_CLASS.LOADING);
5508
5511
  runHooks(this, "retry", function() {
5509
- var cur = _this20.currentTime;
5510
- var url2 = _this20.config.url;
5511
- var _srcRet = !util$1.isMSE(_this20.media) ? _this20.preProcessUrl(url2) : {
5512
+ var cur = _this21.currentTime;
5513
+ var url2 = _this21.config.url;
5514
+ var _srcRet = !util$1.isMSE(_this21.media) ? _this21.preProcessUrl(url2) : {
5512
5515
  url: url2
5513
5516
  };
5514
- _this20.src = _srcRet.url;
5515
- !_this20.config.isLive && (_this20.currentTime = cur);
5516
- _this20.once(CANPLAY, function() {
5517
- _this20.mediaPlay();
5517
+ _this21.src = _srcRet.url;
5518
+ !_this21.config.isLive && (_this21.currentTime = cur);
5519
+ _this21.once(CANPLAY, function() {
5520
+ _this21.mediaPlay();
5518
5521
  });
5519
5522
  });
5520
5523
  }
@@ -5749,7 +5752,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5749
5752
  }, {
5750
5753
  key: "onFocus",
5751
5754
  value: function onFocus() {
5752
- var _this21 = this;
5755
+ var _this22 = this;
5753
5756
  var data2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
5754
5757
  autoHide: true,
5755
5758
  delay: 3e3
@@ -5767,8 +5770,8 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5767
5770
  }
5768
5771
  var time = data2 && data2.delay ? data2.delay : this.config.inactive;
5769
5772
  this.userTimer = util$1.setTimeout(this, function() {
5770
- _this21.userTimer = null;
5771
- _this21.blur();
5773
+ _this22.userTimer = null;
5774
+ _this22.blur();
5772
5775
  }, time);
5773
5776
  }
5774
5777
  }, {
@@ -5801,7 +5804,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5801
5804
  }, {
5802
5805
  key: "onLoadeddata",
5803
5806
  value: function onLoadeddata() {
5804
- var _this22 = this;
5807
+ var _this23 = this;
5805
5808
  this.isError = false;
5806
5809
  this.isSeeking = false;
5807
5810
  if (this.__startTime > 0) {
@@ -5809,7 +5812,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5809
5812
  this._seekToStartTime();
5810
5813
  } else {
5811
5814
  this.once(DURATION_CHANGE, function() {
5812
- _this22._seekToStartTime();
5815
+ _this23._seekToStartTime();
5813
5816
  });
5814
5817
  }
5815
5818
  }
@@ -5880,27 +5883,27 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5880
5883
  }, {
5881
5884
  key: "onWaiting",
5882
5885
  value: function onWaiting() {
5883
- var _this23 = this;
5886
+ var _this24 = this;
5884
5887
  if (this.waitTimer) {
5885
5888
  util$1.clearTimeout(this, this.waitTimer);
5886
5889
  }
5887
5890
  this.updateAcc("waiting");
5888
5891
  this.waitTimer = util$1.setTimeout(this, function() {
5889
- _this23.addClass(STATE_CLASS.LOADING);
5890
- _this23.emit(LOADING);
5891
- util$1.clearTimeout(_this23, _this23.waitTimer);
5892
- _this23.waitTimer = null;
5892
+ _this24.addClass(STATE_CLASS.LOADING);
5893
+ _this24.emit(LOADING);
5894
+ util$1.clearTimeout(_this24, _this24.waitTimer);
5895
+ _this24.waitTimer = null;
5893
5896
  }, this.config.minWaitDelay);
5894
5897
  }
5895
5898
  }, {
5896
5899
  key: "onPlaying",
5897
5900
  value: function onPlaying() {
5898
- var _this24 = this;
5901
+ var _this25 = this;
5899
5902
  this.isError = false;
5900
5903
  var NO_START = STATE_CLASS.NO_START, PAUSED = STATE_CLASS.PAUSED, ENDED2 = STATE_CLASS.ENDED, ERROR2 = STATE_CLASS.ERROR, REPLAY2 = STATE_CLASS.REPLAY, LOADING2 = STATE_CLASS.LOADING;
5901
5904
  var clsList = [NO_START, PAUSED, ENDED2, ERROR2, REPLAY2, LOADING2];
5902
5905
  clsList.forEach(function(cls) {
5903
- _this24.removeClass(cls);
5906
+ _this25.removeClass(cls);
5904
5907
  });
5905
5908
  if (!this._accPlayed.t && !this.paused && !this.ended) {
5906
5909
  this._accPlayed.t = (/* @__PURE__ */ new Date()).getTime();
@@ -5988,7 +5991,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5988
5991
  }, {
5989
5992
  key: "resizePosition",
5990
5993
  value: function resizePosition() {
5991
- var _this25 = this;
5994
+ var _this26 = this;
5992
5995
  var _this$videoPos = this.videoPos, vy = _this$videoPos.vy, vx = _this$videoPos.vx, h2 = _this$videoPos.h, w2 = _this$videoPos.w;
5993
5996
  var rotate = this.videoPos.rotate;
5994
5997
  if (rotate < 0 && h2 < 0 && w2 < 0) {
@@ -6045,7 +6048,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
6045
6048
  styles.transform = formStyle;
6046
6049
  styles.webkitTransform = formStyle;
6047
6050
  Object.keys(styles).map(function(key) {
6048
- _this25.media.style[key] = styles[key];
6051
+ _this26.media.style[key] = styles[key];
6049
6052
  });
6050
6053
  }
6051
6054
  }, {
@@ -6070,14 +6073,14 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
6070
6073
  }, {
6071
6074
  key: "setConfig",
6072
6075
  value: function setConfig(config2) {
6073
- var _this26 = this;
6076
+ var _this27 = this;
6074
6077
  if (!config2) {
6075
6078
  return;
6076
6079
  }
6077
6080
  Object.keys(config2).map(function(key) {
6078
6081
  if (key !== "plugins") {
6079
- _this26.config[key] = config2[key];
6080
- var plugin = _this26.plugins[key.toLowerCase()];
6082
+ _this27.config[key] = config2[key];
6083
+ var plugin = _this27.plugins[key.toLowerCase()];
6081
6084
  if (plugin && util$1.typeOf(plugin.setConfig) === "Function") {
6082
6085
  plugin.setConfig(config2[key]);
6083
6086
  }
@@ -6087,20 +6090,20 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
6087
6090
  }, {
6088
6091
  key: "playNext",
6089
6092
  value: function playNext(config2) {
6090
- var _this27 = this;
6093
+ var _this28 = this;
6091
6094
  this.resetState();
6092
6095
  this.setConfig(config2);
6093
6096
  this._currentTime = 0;
6094
6097
  this._duration = 0;
6095
6098
  runHooks(this, "playnext", function() {
6096
- _this27.start();
6097
- _this27.emit(PLAYNEXT, config2);
6099
+ _this28.start();
6100
+ _this28.emit(PLAYNEXT, config2);
6098
6101
  });
6099
6102
  }
6100
6103
  }, {
6101
6104
  key: "resize",
6102
6105
  value: function resize() {
6103
- var _this28 = this;
6106
+ var _this29 = this;
6104
6107
  if (!this.media || !this.root) {
6105
6108
  return;
6106
6109
  }
@@ -6140,7 +6143,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
6140
6143
  }
6141
6144
  if (!this.fullscreen && !this.cssfullscreen) {
6142
6145
  Object.keys(_style).forEach(function(key) {
6143
- _this28.root.style[key] = _style[key];
6146
+ _this29.root.style[key] = _style[key];
6144
6147
  });
6145
6148
  }
6146
6149
  if (videoFillMode === "fillHeight" && fit < videoFit || videoFillMode === "fillWidth" && fit > videoFit) {
@@ -6240,15 +6243,15 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
6240
6243
  return this.config.definition.list || [];
6241
6244
  },
6242
6245
  set: function set2(list) {
6243
- var _this29 = this;
6246
+ var _this30 = this;
6244
6247
  var definition = this.config.definition;
6245
6248
  var curDef = null;
6246
6249
  var targetDef = null;
6247
6250
  definition.list = list;
6248
6251
  this.emit("resourceReady", list);
6249
6252
  list.forEach(function(item) {
6250
- var _this29$curDefinition;
6251
- if (((_this29$curDefinition = _this29.curDefinition) === null || _this29$curDefinition === void 0 ? void 0 : _this29$curDefinition.definition) === item.definition) {
6253
+ var _this30$curDefinition;
6254
+ if (((_this30$curDefinition = _this30.curDefinition) === null || _this30$curDefinition === void 0 ? void 0 : _this30$curDefinition.definition) === item.definition) {
6252
6255
  curDef = item;
6253
6256
  }
6254
6257
  if (definition.defaultDefinition === item.definition) {
@@ -6424,6 +6427,14 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
6424
6427
  value: function hook$1(hookName, handler) {
6425
6428
  return hook.call.apply(hook, [this].concat(Array.prototype.slice.call(arguments)));
6426
6429
  }
6430
+ }, {
6431
+ key: "runHooks",
6432
+ value: function runHooks$1() {
6433
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
6434
+ args[_key] = arguments[_key];
6435
+ }
6436
+ return runHooks.call.apply(runHooks, [this].concat(Array.prototype.slice.call(arguments)));
6437
+ }
6427
6438
  }, {
6428
6439
  key: "useHooks",
6429
6440
  value: function useHooks$1(hookName, handler) {
@@ -6437,16 +6448,16 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
6437
6448
  }, {
6438
6449
  key: "usePluginHooks",
6439
6450
  value: function usePluginHooks$1(pluginName, hookName, handler) {
6440
- for (var _len = arguments.length, args = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
6441
- args[_key - 3] = arguments[_key];
6451
+ for (var _len2 = arguments.length, args = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
6452
+ args[_key2 - 3] = arguments[_key2];
6442
6453
  }
6443
6454
  return usePluginHooks.call.apply(usePluginHooks, [this].concat(Array.prototype.slice.call(arguments)));
6444
6455
  }
6445
6456
  }, {
6446
6457
  key: "removePluginHooks",
6447
6458
  value: function removePluginHooks$1(pluginName, hookName, handler) {
6448
- for (var _len2 = arguments.length, args = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
6449
- args[_key2 - 3] = arguments[_key2];
6459
+ for (var _len3 = arguments.length, args = new Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) {
6460
+ args[_key3 - 3] = arguments[_key3];
6450
6461
  }
6451
6462
  return removePluginHooks.call.apply(removePluginHooks, [this].concat(Array.prototype.slice.call(arguments)));
6452
6463
  }
@@ -14700,7 +14711,7 @@ class VePlayerBase {
14700
14711
  * @brief Retrieve the player SDK version number.
14701
14712
  */
14702
14713
  get playerVersion() {
14703
- return "2.12.0-rc.1";
14714
+ return "2.12.0-rc.2";
14704
14715
  }
14705
14716
  /** {zh}
14706
14717
  * @brief 获取当前播放视频的清晰度唯一标识(definition)。
@@ -56495,10 +56506,10 @@ let Logger$1 = class Logger2 extends Plugin {
56495
56506
  device_id: deviceId,
56496
56507
  error_report_stop: true,
56497
56508
  ext: {
56498
- veplayer_version: "2.12.0-rc.1",
56499
- flv_version: "3.0.24-rc.2",
56509
+ veplayer_version: "2.12.0-rc.2",
56510
+ flv_version: "3.0.24-rc.6",
56500
56511
  hls_version: "3.0.24-rc.2",
56501
- rts_version: "0.2.1-alpha.57"
56512
+ rts_version: "0.2.1-alpha.64"
56502
56513
  }
56503
56514
  });
56504
56515
  }
@@ -62310,11 +62321,20 @@ function preferNativeForFairplay(options) {
62310
62321
  var _a;
62311
62322
  return ((_a = options == null ? void 0 : options.drm) == null ? void 0 : _a.fairplay) && (sniffer$1.browser === "safari" || sniffer$1.os.isIos);
62312
62323
  }
62324
+ function isBaiduOnOpenHarmony() {
62325
+ const ua2 = navigator.userAgent;
62326
+ const isOpenHarmony = /OpenHarmony/i.test(ua2);
62327
+ const isBaidu = /baiduboxapp|baiduboxlite/i.test(ua2);
62328
+ return isOpenHarmony && isBaidu;
62329
+ }
62313
62330
  function enableMse(options) {
62314
62331
  var _a;
62315
62332
  if (preferNativeForFairplay(options)) {
62316
62333
  return false;
62317
62334
  }
62335
+ if (isBaiduOnOpenHarmony()) {
62336
+ return false;
62337
+ }
62318
62338
  return sniffer$1.device !== "mobile" || (((_a = options == null ? void 0 : options.hls) == null ? void 0 : _a.enableMSE) ?? true);
62319
62339
  }
62320
62340
  function enableHlsJs(options) {
@@ -62579,6 +62599,10 @@ async function isRTMSupportCodec(codec = RTMCodec.H264) {
62579
62599
  return RtmPlugin.isSupportedH264();
62580
62600
  return false;
62581
62601
  }
62602
+ async function isRTMSeiSupported() {
62603
+ const { RtmPlugin } = await load(DynamicModule.PluginRtm);
62604
+ return RtmPlugin.isEncodedTransformSupported();
62605
+ }
62582
62606
  const rtmStrategy = {
62583
62607
  options: {},
62584
62608
  module: DynamicModule.PluginRtm
@@ -74279,7 +74303,7 @@ async function prepare(options) {
74279
74303
  }
74280
74304
  await ((_a = liveVeStrategy.veStrategyManager) == null ? void 0 : _a.init({
74281
74305
  ...options,
74282
- playerVersion: "2.12.0-rc.1",
74306
+ playerVersion: "2.12.0-rc.2",
74283
74307
  type: "LIVE"
74284
74308
  }));
74285
74309
  return liveVeStrategy.veStrategyManager;
@@ -74312,6 +74336,7 @@ export {
74312
74336
  isFLVSupported,
74313
74337
  isMMSSupported$1 as isMMSSupported,
74314
74338
  isMseSupported$2 as isMseSupported,
74339
+ isRTMSeiSupported,
74315
74340
  isRTMSupportCodec,
74316
74341
  isRTMSupported,
74317
74342
  isSoftDecodeSupported,