@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.
@@ -1465,7 +1465,7 @@ var __publicField = (obj, key, value) => {
1465
1465
  }
1466
1466
  }
1467
1467
  };
1468
- var version$3 = "3.0.24-rc.2";
1468
+ var version$3 = "3.0.24-rc.6";
1469
1469
  var ERROR_TYPE_MAP = {
1470
1470
  1: "media",
1471
1471
  2: "media",
@@ -4546,6 +4546,7 @@ var __publicField = (obj, key, value) => {
4546
4546
  _inherits$2(Player2, _MediaProxy);
4547
4547
  var _super = _createSuper$2(Player2);
4548
4548
  function Player2(options) {
4549
+ var _this$onReady, _this2;
4549
4550
  var _this;
4550
4551
  _classCallCheck$2(this, Player2);
4551
4552
  var _config = util$1.deepMerge(getDefaultConfig$1(), options);
@@ -4714,16 +4715,18 @@ var __publicField = (obj, key, value) => {
4714
4715
  return _possibleConstructorReturn$2(_this);
4715
4716
  }
4716
4717
  var _this$config2 = _this.config, _this$config2$definit = _this$config2.definition, definition = _this$config2$definit === void 0 ? {} : _this$config2$definit, url2 = _this$config2.url;
4717
- if (!url2 && definition.list && definition.list.length > 0) {
4718
- var defaultDefinitionObj = definition.list.find(function(e2) {
4718
+ if (Array.isArray(definition === null || definition === void 0 ? void 0 : definition.list) && definition.list.length > 0) {
4719
+ var curDefinition = definition.list.find(function(e2) {
4719
4720
  return e2.definition && e2.definition === definition.defaultDefinition;
4720
4721
  });
4721
- if (!defaultDefinitionObj) {
4722
+ if (!curDefinition) {
4722
4723
  definition.defaultDefinition = definition.list[0].definition;
4723
- defaultDefinitionObj = definition.list[0];
4724
+ curDefinition = definition.list[0];
4725
+ }
4726
+ _this.curDefinition = curDefinition;
4727
+ if (!url2) {
4728
+ _this.config.url = curDefinition.url;
4724
4729
  }
4725
- _this.config.url = defaultDefinitionObj.url;
4726
- _this.curDefinition = defaultDefinitionObj;
4727
4730
  }
4728
4731
  _this._bindEvents();
4729
4732
  _this._registerPresets();
@@ -4734,7 +4737,7 @@ var __publicField = (obj, key, value) => {
4734
4737
  util$1.setTimeout(_assertThisInitialized$2(_this), function() {
4735
4738
  _this.emit(READY);
4736
4739
  }, 0);
4737
- _this.onReady && _this.onReady();
4740
+ (_this$onReady = (_this2 = _this).onReady) === null || _this$onReady === void 0 ? void 0 : _this$onReady.call(_this2);
4738
4741
  if (_this.config.videoInit || _this.config.autoplay) {
4739
4742
  if (!_this.hasStart || _this.state < STATES.ATTACHED) {
4740
4743
  _this.start();
@@ -4745,7 +4748,7 @@ var __publicField = (obj, key, value) => {
4745
4748
  _createClass$3(Player2, [{
4746
4749
  key: "_initDOM",
4747
4750
  value: function _initDOM() {
4748
- var _instManager, _this2 = this;
4751
+ var _instManager, _this3 = this;
4749
4752
  this.root = this.config.id ? document.getElementById(this.config.id) : null;
4750
4753
  if (!this.root) {
4751
4754
  var el = this.config.el;
@@ -4798,15 +4801,15 @@ var __publicField = (obj, key, value) => {
4798
4801
  "padding-top": "".concat(_height * 100 / _width, "%")
4799
4802
  };
4800
4803
  Object.keys(style).forEach(function(key) {
4801
- _this2.root.style[key] = style[key];
4804
+ _this3.root.style[key] = style[key];
4802
4805
  });
4803
4806
  } else {
4804
4807
  ["width", "height"].forEach(function(key) {
4805
- if (_this2.config[key]) {
4806
- if (typeof _this2.config[key] !== "number") {
4807
- _this2.root.style[key] = _this2.config[key];
4808
+ if (_this3.config[key]) {
4809
+ if (typeof _this3.config[key] !== "number") {
4810
+ _this3.root.style[key] = _this3.config[key];
4808
4811
  } else {
4809
- _this2.root.style[key] = "".concat(_this2.config[key], "px");
4812
+ _this3.root.style[key] = "".concat(_this3.config[key], "px");
4810
4813
  }
4811
4814
  }
4812
4815
  });
@@ -4834,12 +4837,12 @@ var __publicField = (obj, key, value) => {
4834
4837
  }, {
4835
4838
  key: "_bindEvents",
4836
4839
  value: function _bindEvents() {
4837
- var _this3 = this;
4840
+ var _this4 = this;
4838
4841
  ["focus", "blur"].forEach(function(item) {
4839
- _this3.on(item, _this3["on" + item.charAt(0).toUpperCase() + item.slice(1)]);
4842
+ _this4.on(item, _this4["on" + item.charAt(0).toUpperCase() + item.slice(1)]);
4840
4843
  });
4841
4844
  FULLSCREEN_EVENTS.forEach(function(item) {
4842
- document && document.addEventListener(item, _this3.onFullscreenChange);
4845
+ document && document.addEventListener(item, _this4.onFullscreenChange);
4843
4846
  });
4844
4847
  if (sniffer$1.os.isIos) {
4845
4848
  this.media.addEventListener("webkitbeginfullscreen", this._onWebkitbeginfullscreen);
@@ -4847,8 +4850,8 @@ var __publicField = (obj, key, value) => {
4847
4850
  }
4848
4851
  this.once(LOADED_DATA, this.resize);
4849
4852
  this.playFunc = function() {
4850
- if (!_this3.config.closeFocusVideoFocus) {
4851
- _this3.media.focus();
4853
+ if (!_this4.config.closeFocusVideoFocus) {
4854
+ _this4.media.focus();
4852
4855
  }
4853
4856
  };
4854
4857
  this.once(PLAY, this.playFunc);
@@ -4856,10 +4859,10 @@ var __publicField = (obj, key, value) => {
4856
4859
  }, {
4857
4860
  key: "_unbindEvents",
4858
4861
  value: function _unbindEvents() {
4859
- var _this4 = this;
4862
+ var _this5 = this;
4860
4863
  this.root.removeEventListener("mousemove", this.mousemoveFunc);
4861
4864
  FULLSCREEN_EVENTS.forEach(function(item) {
4862
- document.removeEventListener(item, _this4.onFullscreenChange);
4865
+ document.removeEventListener(item, _this5.onFullscreenChange);
4863
4866
  });
4864
4867
  this.playFunc && this.off(PLAY, this.playFunc);
4865
4868
  this.off(CANPLAY, this.canPlayFunc);
@@ -4878,7 +4881,7 @@ var __publicField = (obj, key, value) => {
4878
4881
  }, {
4879
4882
  key: "_startInit",
4880
4883
  value: function _startInit(url2) {
4881
- var _this5 = this;
4884
+ var _this6 = this;
4882
4885
  var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
4883
4886
  if (!this.media) {
4884
4887
  return;
@@ -4931,13 +4934,13 @@ var __publicField = (obj, key, value) => {
4931
4934
  this.hasStart = true;
4932
4935
  this.setState(STATES.ATTACHED);
4933
4936
  util$1.setTimeout(this, function() {
4934
- _this5.emit(COMPLETE);
4937
+ _this6.emit(COMPLETE);
4935
4938
  }, 0);
4936
4939
  }
4937
4940
  }, {
4938
4941
  key: "_registerPlugins",
4939
4942
  value: function _registerPlugins() {
4940
- var _this6 = this;
4943
+ var _this7 = this;
4941
4944
  var isInit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
4942
4945
  this._loadingPlugins = [];
4943
4946
  var ignores = this.config.ignores || [];
@@ -4956,19 +4959,19 @@ var __publicField = (obj, key, value) => {
4956
4959
  return;
4957
4960
  }
4958
4961
  if (plugin.lazy && plugin.loader) {
4959
- var loadingPlugin = pluginsManager.lazyRegister(_this6, plugin);
4962
+ var loadingPlugin = pluginsManager.lazyRegister(_this7, plugin);
4960
4963
  if (plugin.forceBeforeInit) {
4961
4964
  loadingPlugin.then(function() {
4962
- _this6._loadingPlugins.splice(_this6._loadingPlugins.indexOf(loadingPlugin), 1);
4965
+ _this7._loadingPlugins.splice(_this7._loadingPlugins.indexOf(loadingPlugin), 1);
4963
4966
  }).catch(function(e2) {
4964
4967
  XG_DEBUG.logError("_registerPlugins:loadingPlugin", e2);
4965
- _this6._loadingPlugins.splice(_this6._loadingPlugins.indexOf(loadingPlugin), 1);
4968
+ _this7._loadingPlugins.splice(_this7._loadingPlugins.indexOf(loadingPlugin), 1);
4966
4969
  });
4967
- _this6._loadingPlugins.push(loadingPlugin);
4970
+ _this7._loadingPlugins.push(loadingPlugin);
4968
4971
  }
4969
4972
  return;
4970
4973
  }
4971
- return _this6.registerPlugin(plugin);
4974
+ return _this7.registerPlugin(plugin);
4972
4975
  } catch (err) {
4973
4976
  XG_DEBUG.logError("_registerPlugins:", err);
4974
4977
  }
@@ -4977,9 +4980,9 @@ var __publicField = (obj, key, value) => {
4977
4980
  }, {
4978
4981
  key: "_registerPresets",
4979
4982
  value: function _registerPresets() {
4980
- var _this7 = this;
4983
+ var _this8 = this;
4981
4984
  this.config.presets.forEach(function(preset) {
4982
- usePreset(_this7, preset);
4985
+ usePreset(_this8, preset);
4983
4986
  });
4984
4987
  }
4985
4988
  }, {
@@ -5129,7 +5132,7 @@ var __publicField = (obj, key, value) => {
5129
5132
  }, {
5130
5133
  key: "start",
5131
5134
  value: function start(url2) {
5132
- var _this8 = this;
5135
+ var _this9 = this;
5133
5136
  if (this.state > STATES.ATTACHING) {
5134
5137
  return;
5135
5138
  }
@@ -5144,14 +5147,14 @@ var __publicField = (obj, key, value) => {
5144
5147
  this.setState(STATES.ATTACHING);
5145
5148
  this._registerPlugins(false);
5146
5149
  return pluginsManager.beforeInit(this).then(function() {
5147
- if (!_this8.config) {
5150
+ if (!_this9.config) {
5148
5151
  return;
5149
5152
  }
5150
5153
  if (!url2) {
5151
- url2 = _this8.url || _this8.config.url;
5154
+ url2 = _this9.url || _this9.config.url;
5152
5155
  }
5153
- var _furl = _this8.preProcessUrl(url2);
5154
- var ret = _this8._startInit(_furl.url, {
5156
+ var _furl = _this9.preProcessUrl(url2);
5157
+ var ret = _this9._startInit(_furl.url, {
5155
5158
  playSessionId
5156
5159
  });
5157
5160
  return ret;
@@ -5165,7 +5168,7 @@ var __publicField = (obj, key, value) => {
5165
5168
  }, {
5166
5169
  key: "switchURL",
5167
5170
  value: function switchURL(url2, options) {
5168
- var _this9 = this;
5171
+ var _this10 = this;
5169
5172
  var _src = url2;
5170
5173
  if (util$1.typeOf(url2) === "Object") {
5171
5174
  _src = url2.url;
@@ -5177,32 +5180,32 @@ var __publicField = (obj, key, value) => {
5177
5180
  this.src = _src;
5178
5181
  return new Promise(function(resolve, reject) {
5179
5182
  var _error = function _error2(e2) {
5180
- _this9.off("timeupdate", _canplay);
5181
- _this9.off("canplay", _canplay);
5183
+ _this10.off("timeupdate", _canplay);
5184
+ _this10.off("canplay", _canplay);
5182
5185
  reject(e2);
5183
5186
  };
5184
5187
  var _canplay = function _canplay2() {
5185
- _this9._seekToStartTime();
5188
+ _this10._seekToStartTime();
5186
5189
  if (isPaused) {
5187
- _this9.pause();
5190
+ _this10.pause();
5188
5191
  }
5189
- _this9.off("error", _error);
5192
+ _this10.off("error", _error);
5190
5193
  resolve(true);
5191
5194
  };
5192
- _this9.once("error", _error);
5195
+ _this10.once("error", _error);
5193
5196
  if (!_src) {
5194
- _this9.errorHandler("error", {
5197
+ _this10.errorHandler("error", {
5195
5198
  code: 6,
5196
5199
  message: "empty_src"
5197
5200
  });
5198
5201
  return;
5199
5202
  }
5200
5203
  if (sniffer$1.os.isAndroid) {
5201
- _this9.once("timeupdate", _canplay);
5204
+ _this10.once("timeupdate", _canplay);
5202
5205
  } else {
5203
- _this9.once("canplay", _canplay);
5206
+ _this10.once("canplay", _canplay);
5204
5207
  }
5205
- _this9.play();
5208
+ _this10.play();
5206
5209
  });
5207
5210
  }
5208
5211
  }, {
@@ -5213,7 +5216,7 @@ var __publicField = (obj, key, value) => {
5213
5216
  }, {
5214
5217
  key: "mediaPlay",
5215
5218
  value: function mediaPlay() {
5216
- var _this10 = this;
5219
+ var _this11 = this;
5217
5220
  if (!this.hasStart && this.state < STATES.ATTACHED) {
5218
5221
  this.removeClass(STATE_CLASS.NO_START);
5219
5222
  this.addClass(STATE_CLASS.ENTER);
@@ -5228,28 +5231,28 @@ var __publicField = (obj, key, value) => {
5228
5231
  var playPromise = _get$2(_getPrototypeOf$2(Player2.prototype), "play", this).call(this);
5229
5232
  if (playPromise !== void 0 && playPromise && playPromise.then) {
5230
5233
  playPromise.then(function() {
5231
- _this10.removeClass(STATE_CLASS.NOT_ALLOW_AUTOPLAY);
5232
- _this10.addClass(STATE_CLASS.PLAYING);
5233
- if (_this10.state < STATES.RUNNING) {
5234
+ _this11.removeClass(STATE_CLASS.NOT_ALLOW_AUTOPLAY);
5235
+ _this11.addClass(STATE_CLASS.PLAYING);
5236
+ if (_this11.state < STATES.RUNNING) {
5234
5237
  XG_DEBUG.logInfo(">>>>playPromise.then");
5235
- _this10.setState(STATES.RUNNING);
5236
- _this10.emit(AUTOPLAY_STARTED);
5238
+ _this11.setState(STATES.RUNNING);
5239
+ _this11.emit(AUTOPLAY_STARTED);
5237
5240
  }
5238
5241
  }).catch(function(e2) {
5239
5242
  XG_DEBUG.logWarn(">>>>playPromise.catch", e2.name);
5240
- if (_this10.media && _this10.media.error) {
5241
- _this10.onError();
5242
- _this10.removeClass(STATE_CLASS.ENTER);
5243
+ if (_this11.media && _this11.media.error) {
5244
+ _this11.onError();
5245
+ _this11.removeClass(STATE_CLASS.ENTER);
5243
5246
  return;
5244
5247
  }
5245
5248
  if (e2.name === "NotAllowedError") {
5246
- _this10._errorTimer = util$1.setTimeout(_this10, function() {
5247
- _this10._errorTimer = null;
5248
- _this10.emit(AUTOPLAY_PREVENTED);
5249
- _this10.addClass(STATE_CLASS.NOT_ALLOW_AUTOPLAY);
5250
- _this10.removeClass(STATE_CLASS.ENTER);
5251
- _this10.pause();
5252
- _this10.setState(STATES.NOTALLOW);
5249
+ _this11._errorTimer = util$1.setTimeout(_this11, function() {
5250
+ _this11._errorTimer = null;
5251
+ _this11.emit(AUTOPLAY_PREVENTED);
5252
+ _this11.addClass(STATE_CLASS.NOT_ALLOW_AUTOPLAY);
5253
+ _this11.removeClass(STATE_CLASS.ENTER);
5254
+ _this11.pause();
5255
+ _this11.setState(STATES.NOTALLOW);
5253
5256
  }, 0);
5254
5257
  }
5255
5258
  });
@@ -5279,24 +5282,24 @@ var __publicField = (obj, key, value) => {
5279
5282
  }, {
5280
5283
  key: "play",
5281
5284
  value: function play() {
5282
- var _this11 = this;
5285
+ var _this12 = this;
5283
5286
  this.removeClass(STATE_CLASS.PAUSED);
5284
5287
  return runHooks(this, "play", function() {
5285
- return _this11.mediaPlay();
5288
+ return _this12.mediaPlay();
5286
5289
  });
5287
5290
  }
5288
5291
  }, {
5289
5292
  key: "pause",
5290
5293
  value: function pause() {
5291
- var _this12 = this;
5294
+ var _this13 = this;
5292
5295
  runHooks(this, "pause", function() {
5293
- _get$2(_getPrototypeOf$2(Player2.prototype), "pause", _this12).call(_this12);
5296
+ _get$2(_getPrototypeOf$2(Player2.prototype), "pause", _this13).call(_this13);
5294
5297
  });
5295
5298
  }
5296
5299
  }, {
5297
5300
  key: "seek",
5298
5301
  value: function seek(time, status2) {
5299
- var _this13 = this;
5302
+ var _this14 = this;
5300
5303
  if (!this.media || Number.isNaN(Number(time)) || !this.hasStart) {
5301
5304
  return;
5302
5305
  }
@@ -5306,20 +5309,20 @@ var __publicField = (obj, key, value) => {
5306
5309
  !this._isPauseBeforeSeek && (this._isPauseBeforeSeek = this.paused ? 2 : 1);
5307
5310
  this._onceSeekCanplay && this.off(SEEKED, this._onceSeekCanplay);
5308
5311
  this._onceSeekCanplay = function() {
5309
- _this13.removeClass(STATE_CLASS.ENTER);
5310
- _this13.isSeeking = false;
5312
+ _this14.removeClass(STATE_CLASS.ENTER);
5313
+ _this14.isSeeking = false;
5311
5314
  switch (_status) {
5312
5315
  case "play":
5313
- _this13.play();
5316
+ _this14.play();
5314
5317
  break;
5315
5318
  case "pause":
5316
- _this13.pause();
5319
+ _this14.pause();
5317
5320
  break;
5318
5321
  default:
5319
- _this13._isPauseBeforeSeek > 1 || _this13.paused ? _this13.pause() : _this13.play();
5322
+ _this14._isPauseBeforeSeek > 1 || _this14.paused ? _this14.pause() : _this14.play();
5320
5323
  }
5321
- _this13._isPauseBeforeSeek = 0;
5322
- _this13._onceSeekCanplay = null;
5324
+ _this14._isPauseBeforeSeek = 0;
5325
+ _this14._onceSeekCanplay = null;
5323
5326
  };
5324
5327
  this.once(SEEKED, this._onceSeekCanplay);
5325
5328
  if (this.state < STATES.RUNNING) {
@@ -5333,13 +5336,13 @@ var __publicField = (obj, key, value) => {
5333
5336
  }, {
5334
5337
  key: "getInitDefinition",
5335
5338
  value: function getInitDefinition() {
5336
- var _this14 = this;
5339
+ var _this15 = this;
5337
5340
  var _this$config5 = this.config, definition = _this$config5.definition, url2 = _this$config5.url;
5338
5341
  if (!url2 && definition && definition.list && definition.list.length > 0 && definition.defaultDefinition) {
5339
5342
  definition.list.map(function(item) {
5340
5343
  if (item.definition === definition.defaultDefinition) {
5341
- _this14.config.url = item.url;
5342
- _this14.curDefinition = item;
5344
+ _this15.config.url = item.url;
5345
+ _this15.curDefinition = item;
5343
5346
  }
5344
5347
  });
5345
5348
  }
@@ -5347,12 +5350,12 @@ var __publicField = (obj, key, value) => {
5347
5350
  }, {
5348
5351
  key: "changeDefinition",
5349
5352
  value: function changeDefinition(to, from) {
5350
- var _this15 = this;
5353
+ var _this16 = this;
5351
5354
  var definition = this.config.definition;
5352
5355
  if (Array.isArray(definition === null || definition === void 0 ? void 0 : definition.list)) {
5353
5356
  definition.list.forEach(function(item) {
5354
5357
  if ((to === null || to === void 0 ? void 0 : to.definition) === item.definition) {
5355
- _this15.curDefinition = item;
5358
+ _this16.curDefinition = item;
5356
5359
  }
5357
5360
  });
5358
5361
  }
@@ -5372,7 +5375,7 @@ var __publicField = (obj, key, value) => {
5372
5375
  }, to));
5373
5376
  if (ret && ret.then) {
5374
5377
  ret.then(function() {
5375
- _this15.emit(AFTER_DEFINITION_CHANGE, {
5378
+ _this16.emit(AFTER_DEFINITION_CHANGE, {
5376
5379
  from,
5377
5380
  to
5378
5381
  });
@@ -5396,7 +5399,7 @@ var __publicField = (obj, key, value) => {
5396
5399
  }, {
5397
5400
  key: "resetState",
5398
5401
  value: function resetState() {
5399
- var _this16 = this;
5402
+ var _this17 = this;
5400
5403
  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;
5401
5404
  var clsList = [NOT_ALLOW_AUTOPLAY, PLAYING2, NO_START, PAUSED, REPLAY2, ENTER, ENDED2, ERROR2, LOADING2];
5402
5405
  this.hasStart = false;
@@ -5407,7 +5410,7 @@ var __publicField = (obj, key, value) => {
5407
5410
  this._accPlayed.t = 0;
5408
5411
  this._accPlayed.loopAcc = 0;
5409
5412
  clsList.forEach(function(cls) {
5410
- _this16.removeClass(cls);
5413
+ _this17.removeClass(cls);
5411
5414
  });
5412
5415
  this.addClass(STATE_CLASS.NO_START);
5413
5416
  this.emit(RESET);
@@ -5415,7 +5418,7 @@ var __publicField = (obj, key, value) => {
5415
5418
  }, {
5416
5419
  key: "reset",
5417
5420
  value: function reset() {
5418
- var _this17 = this;
5421
+ var _this18 = this;
5419
5422
  var unregisterPlugins = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
5420
5423
  var isResetConfig = arguments.length > 1 ? arguments[1] : void 0;
5421
5424
  this.resetState();
@@ -5424,13 +5427,13 @@ var __publicField = (obj, key, value) => {
5424
5427
  return;
5425
5428
  }
5426
5429
  unregisterPlugins.map(function(pn2) {
5427
- _this17.deregister(pn2);
5430
+ _this18.deregister(pn2);
5428
5431
  });
5429
5432
  if (isResetConfig) {
5430
5433
  var de2 = getDefaultConfig$1();
5431
5434
  Object.keys(this.config).forEach(function(k2) {
5432
- if (_this17.config[k2] !== "undefined" && (k2 === "plugins" || k2 === "presets" || k2 === "el" || k2 === "id")) {
5433
- _this17.config[k2] = de2[k2];
5435
+ if (_this18.config[k2] !== "undefined" && (k2 === "plugins" || k2 === "presets" || k2 === "el" || k2 === "id")) {
5436
+ _this18.config[k2] = de2[k2];
5434
5437
  }
5435
5438
  });
5436
5439
  }
@@ -5438,7 +5441,7 @@ var __publicField = (obj, key, value) => {
5438
5441
  }, {
5439
5442
  key: "destroy",
5440
5443
  value: function destroy() {
5441
- var _instManager2, _this18 = this;
5444
+ var _instManager2, _this19 = this;
5442
5445
  var innerContainer = this.innerContainer, root2 = this.root, media = this.media;
5443
5446
  if (!root2 || !media) {
5444
5447
  return;
@@ -5467,8 +5470,8 @@ var __publicField = (obj, key, value) => {
5467
5470
  }
5468
5471
  !innerContainer && media instanceof window.Node && root2.contains(media) && !this.config.remainMediaAfterDestroy && root2.removeChild(media);
5469
5472
  ["topBar", "leftBar", "rightBar", "innerContainer"].map(function(item) {
5470
- _this18[item] && root2.removeChild(_this18[item]);
5471
- _this18[item] = null;
5473
+ _this19[item] && root2.removeChild(_this19[item]);
5474
+ _this19[item] = null;
5472
5475
  });
5473
5476
  var cList = root2.className.split(" ");
5474
5477
  if (cList.length > 0) {
@@ -5480,45 +5483,45 @@ var __publicField = (obj, key, value) => {
5480
5483
  }
5481
5484
  this.removeAttribute("data-xgfill");
5482
5485
  ["isSeeking", "isCanplay", "isActive", "cssfullscreen", "fullscreen"].forEach(function(key) {
5483
- _this18[key] = false;
5486
+ _this19[key] = false;
5484
5487
  });
5485
5488
  }
5486
5489
  }, {
5487
5490
  key: "replay",
5488
5491
  value: function replay() {
5489
- var _this19 = this;
5492
+ var _this20 = this;
5490
5493
  this.removeClass(STATE_CLASS.ENDED);
5491
5494
  this.currentTime = 0;
5492
5495
  this.isSeeking = false;
5493
5496
  runHooks(this, "replay", function() {
5494
- _this19.once(SEEKED, function() {
5495
- var playPromise = _this19.mediaPlay();
5497
+ _this20.once(SEEKED, function() {
5498
+ var playPromise = _this20.mediaPlay();
5496
5499
  if (playPromise && playPromise.catch) {
5497
5500
  playPromise.catch(function(err) {
5498
5501
  console.log(err);
5499
5502
  });
5500
5503
  }
5501
5504
  });
5502
- _this19.emit(REPLAY);
5503
- _this19.onPlay();
5505
+ _this20.emit(REPLAY);
5506
+ _this20.onPlay();
5504
5507
  });
5505
5508
  }
5506
5509
  }, {
5507
5510
  key: "retry",
5508
5511
  value: function retry() {
5509
- var _this20 = this;
5512
+ var _this21 = this;
5510
5513
  this.removeClass(STATE_CLASS.ERROR);
5511
5514
  this.addClass(STATE_CLASS.LOADING);
5512
5515
  runHooks(this, "retry", function() {
5513
- var cur = _this20.currentTime;
5514
- var url2 = _this20.config.url;
5515
- var _srcRet = !util$1.isMSE(_this20.media) ? _this20.preProcessUrl(url2) : {
5516
+ var cur = _this21.currentTime;
5517
+ var url2 = _this21.config.url;
5518
+ var _srcRet = !util$1.isMSE(_this21.media) ? _this21.preProcessUrl(url2) : {
5516
5519
  url: url2
5517
5520
  };
5518
- _this20.src = _srcRet.url;
5519
- !_this20.config.isLive && (_this20.currentTime = cur);
5520
- _this20.once(CANPLAY, function() {
5521
- _this20.mediaPlay();
5521
+ _this21.src = _srcRet.url;
5522
+ !_this21.config.isLive && (_this21.currentTime = cur);
5523
+ _this21.once(CANPLAY, function() {
5524
+ _this21.mediaPlay();
5522
5525
  });
5523
5526
  });
5524
5527
  }
@@ -5753,7 +5756,7 @@ var __publicField = (obj, key, value) => {
5753
5756
  }, {
5754
5757
  key: "onFocus",
5755
5758
  value: function onFocus() {
5756
- var _this21 = this;
5759
+ var _this22 = this;
5757
5760
  var data2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
5758
5761
  autoHide: true,
5759
5762
  delay: 3e3
@@ -5771,8 +5774,8 @@ var __publicField = (obj, key, value) => {
5771
5774
  }
5772
5775
  var time = data2 && data2.delay ? data2.delay : this.config.inactive;
5773
5776
  this.userTimer = util$1.setTimeout(this, function() {
5774
- _this21.userTimer = null;
5775
- _this21.blur();
5777
+ _this22.userTimer = null;
5778
+ _this22.blur();
5776
5779
  }, time);
5777
5780
  }
5778
5781
  }, {
@@ -5805,7 +5808,7 @@ var __publicField = (obj, key, value) => {
5805
5808
  }, {
5806
5809
  key: "onLoadeddata",
5807
5810
  value: function onLoadeddata() {
5808
- var _this22 = this;
5811
+ var _this23 = this;
5809
5812
  this.isError = false;
5810
5813
  this.isSeeking = false;
5811
5814
  if (this.__startTime > 0) {
@@ -5813,7 +5816,7 @@ var __publicField = (obj, key, value) => {
5813
5816
  this._seekToStartTime();
5814
5817
  } else {
5815
5818
  this.once(DURATION_CHANGE, function() {
5816
- _this22._seekToStartTime();
5819
+ _this23._seekToStartTime();
5817
5820
  });
5818
5821
  }
5819
5822
  }
@@ -5884,27 +5887,27 @@ var __publicField = (obj, key, value) => {
5884
5887
  }, {
5885
5888
  key: "onWaiting",
5886
5889
  value: function onWaiting() {
5887
- var _this23 = this;
5890
+ var _this24 = this;
5888
5891
  if (this.waitTimer) {
5889
5892
  util$1.clearTimeout(this, this.waitTimer);
5890
5893
  }
5891
5894
  this.updateAcc("waiting");
5892
5895
  this.waitTimer = util$1.setTimeout(this, function() {
5893
- _this23.addClass(STATE_CLASS.LOADING);
5894
- _this23.emit(LOADING);
5895
- util$1.clearTimeout(_this23, _this23.waitTimer);
5896
- _this23.waitTimer = null;
5896
+ _this24.addClass(STATE_CLASS.LOADING);
5897
+ _this24.emit(LOADING);
5898
+ util$1.clearTimeout(_this24, _this24.waitTimer);
5899
+ _this24.waitTimer = null;
5897
5900
  }, this.config.minWaitDelay);
5898
5901
  }
5899
5902
  }, {
5900
5903
  key: "onPlaying",
5901
5904
  value: function onPlaying() {
5902
- var _this24 = this;
5905
+ var _this25 = this;
5903
5906
  this.isError = false;
5904
5907
  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;
5905
5908
  var clsList = [NO_START, PAUSED, ENDED2, ERROR2, REPLAY2, LOADING2];
5906
5909
  clsList.forEach(function(cls) {
5907
- _this24.removeClass(cls);
5910
+ _this25.removeClass(cls);
5908
5911
  });
5909
5912
  if (!this._accPlayed.t && !this.paused && !this.ended) {
5910
5913
  this._accPlayed.t = (/* @__PURE__ */ new Date()).getTime();
@@ -5992,7 +5995,7 @@ var __publicField = (obj, key, value) => {
5992
5995
  }, {
5993
5996
  key: "resizePosition",
5994
5997
  value: function resizePosition() {
5995
- var _this25 = this;
5998
+ var _this26 = this;
5996
5999
  var _this$videoPos = this.videoPos, vy = _this$videoPos.vy, vx = _this$videoPos.vx, h2 = _this$videoPos.h, w2 = _this$videoPos.w;
5997
6000
  var rotate = this.videoPos.rotate;
5998
6001
  if (rotate < 0 && h2 < 0 && w2 < 0) {
@@ -6049,7 +6052,7 @@ var __publicField = (obj, key, value) => {
6049
6052
  styles.transform = formStyle;
6050
6053
  styles.webkitTransform = formStyle;
6051
6054
  Object.keys(styles).map(function(key) {
6052
- _this25.media.style[key] = styles[key];
6055
+ _this26.media.style[key] = styles[key];
6053
6056
  });
6054
6057
  }
6055
6058
  }, {
@@ -6074,14 +6077,14 @@ var __publicField = (obj, key, value) => {
6074
6077
  }, {
6075
6078
  key: "setConfig",
6076
6079
  value: function setConfig(config2) {
6077
- var _this26 = this;
6080
+ var _this27 = this;
6078
6081
  if (!config2) {
6079
6082
  return;
6080
6083
  }
6081
6084
  Object.keys(config2).map(function(key) {
6082
6085
  if (key !== "plugins") {
6083
- _this26.config[key] = config2[key];
6084
- var plugin = _this26.plugins[key.toLowerCase()];
6086
+ _this27.config[key] = config2[key];
6087
+ var plugin = _this27.plugins[key.toLowerCase()];
6085
6088
  if (plugin && util$1.typeOf(plugin.setConfig) === "Function") {
6086
6089
  plugin.setConfig(config2[key]);
6087
6090
  }
@@ -6091,20 +6094,20 @@ var __publicField = (obj, key, value) => {
6091
6094
  }, {
6092
6095
  key: "playNext",
6093
6096
  value: function playNext(config2) {
6094
- var _this27 = this;
6097
+ var _this28 = this;
6095
6098
  this.resetState();
6096
6099
  this.setConfig(config2);
6097
6100
  this._currentTime = 0;
6098
6101
  this._duration = 0;
6099
6102
  runHooks(this, "playnext", function() {
6100
- _this27.start();
6101
- _this27.emit(PLAYNEXT, config2);
6103
+ _this28.start();
6104
+ _this28.emit(PLAYNEXT, config2);
6102
6105
  });
6103
6106
  }
6104
6107
  }, {
6105
6108
  key: "resize",
6106
6109
  value: function resize() {
6107
- var _this28 = this;
6110
+ var _this29 = this;
6108
6111
  if (!this.media || !this.root) {
6109
6112
  return;
6110
6113
  }
@@ -6144,7 +6147,7 @@ var __publicField = (obj, key, value) => {
6144
6147
  }
6145
6148
  if (!this.fullscreen && !this.cssfullscreen) {
6146
6149
  Object.keys(_style).forEach(function(key) {
6147
- _this28.root.style[key] = _style[key];
6150
+ _this29.root.style[key] = _style[key];
6148
6151
  });
6149
6152
  }
6150
6153
  if (videoFillMode === "fillHeight" && fit < videoFit || videoFillMode === "fillWidth" && fit > videoFit) {
@@ -6244,15 +6247,15 @@ var __publicField = (obj, key, value) => {
6244
6247
  return this.config.definition.list || [];
6245
6248
  },
6246
6249
  set: function set2(list) {
6247
- var _this29 = this;
6250
+ var _this30 = this;
6248
6251
  var definition = this.config.definition;
6249
6252
  var curDef = null;
6250
6253
  var targetDef = null;
6251
6254
  definition.list = list;
6252
6255
  this.emit("resourceReady", list);
6253
6256
  list.forEach(function(item) {
6254
- var _this29$curDefinition;
6255
- if (((_this29$curDefinition = _this29.curDefinition) === null || _this29$curDefinition === void 0 ? void 0 : _this29$curDefinition.definition) === item.definition) {
6257
+ var _this30$curDefinition;
6258
+ if (((_this30$curDefinition = _this30.curDefinition) === null || _this30$curDefinition === void 0 ? void 0 : _this30$curDefinition.definition) === item.definition) {
6256
6259
  curDef = item;
6257
6260
  }
6258
6261
  if (definition.defaultDefinition === item.definition) {
@@ -6428,6 +6431,14 @@ var __publicField = (obj, key, value) => {
6428
6431
  value: function hook$1(hookName, handler) {
6429
6432
  return hook.call.apply(hook, [this].concat(Array.prototype.slice.call(arguments)));
6430
6433
  }
6434
+ }, {
6435
+ key: "runHooks",
6436
+ value: function runHooks$1() {
6437
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
6438
+ args[_key] = arguments[_key];
6439
+ }
6440
+ return runHooks.call.apply(runHooks, [this].concat(Array.prototype.slice.call(arguments)));
6441
+ }
6431
6442
  }, {
6432
6443
  key: "useHooks",
6433
6444
  value: function useHooks$1(hookName, handler) {
@@ -6441,16 +6452,16 @@ var __publicField = (obj, key, value) => {
6441
6452
  }, {
6442
6453
  key: "usePluginHooks",
6443
6454
  value: function usePluginHooks$1(pluginName, hookName, handler) {
6444
- for (var _len = arguments.length, args = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
6445
- args[_key - 3] = arguments[_key];
6455
+ for (var _len2 = arguments.length, args = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
6456
+ args[_key2 - 3] = arguments[_key2];
6446
6457
  }
6447
6458
  return usePluginHooks.call.apply(usePluginHooks, [this].concat(Array.prototype.slice.call(arguments)));
6448
6459
  }
6449
6460
  }, {
6450
6461
  key: "removePluginHooks",
6451
6462
  value: function removePluginHooks$1(pluginName, hookName, handler) {
6452
- for (var _len2 = arguments.length, args = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
6453
- args[_key2 - 3] = arguments[_key2];
6463
+ for (var _len3 = arguments.length, args = new Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) {
6464
+ args[_key3 - 3] = arguments[_key3];
6454
6465
  }
6455
6466
  return removePluginHooks.call.apply(removePluginHooks, [this].concat(Array.prototype.slice.call(arguments)));
6456
6467
  }
@@ -14704,7 +14715,7 @@ var __publicField = (obj, key, value) => {
14704
14715
  * @brief Retrieve the player SDK version number.
14705
14716
  */
14706
14717
  get playerVersion() {
14707
- return "2.12.0-rc.1";
14718
+ return "2.12.0-rc.2";
14708
14719
  }
14709
14720
  /** {zh}
14710
14721
  * @brief 获取当前播放视频的清晰度唯一标识(definition)。
@@ -56499,10 +56510,10 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
56499
56510
  device_id: deviceId,
56500
56511
  error_report_stop: true,
56501
56512
  ext: {
56502
- veplayer_version: "2.12.0-rc.1",
56503
- flv_version: "3.0.24-rc.2",
56513
+ veplayer_version: "2.12.0-rc.2",
56514
+ flv_version: "3.0.24-rc.6",
56504
56515
  hls_version: "3.0.24-rc.2",
56505
- rts_version: "0.2.1-alpha.57"
56516
+ rts_version: "0.2.1-alpha.64"
56506
56517
  }
56507
56518
  });
56508
56519
  }
@@ -62314,11 +62325,20 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
62314
62325
  var _a;
62315
62326
  return ((_a = options == null ? void 0 : options.drm) == null ? void 0 : _a.fairplay) && (sniffer$1.browser === "safari" || sniffer$1.os.isIos);
62316
62327
  }
62328
+ function isBaiduOnOpenHarmony() {
62329
+ const ua2 = navigator.userAgent;
62330
+ const isOpenHarmony = /OpenHarmony/i.test(ua2);
62331
+ const isBaidu = /baiduboxapp|baiduboxlite/i.test(ua2);
62332
+ return isOpenHarmony && isBaidu;
62333
+ }
62317
62334
  function enableMse(options) {
62318
62335
  var _a;
62319
62336
  if (preferNativeForFairplay(options)) {
62320
62337
  return false;
62321
62338
  }
62339
+ if (isBaiduOnOpenHarmony()) {
62340
+ return false;
62341
+ }
62322
62342
  return sniffer$1.device !== "mobile" || (((_a = options == null ? void 0 : options.hls) == null ? void 0 : _a.enableMSE) ?? true);
62323
62343
  }
62324
62344
  function enableHlsJs(options) {
@@ -62583,6 +62603,10 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
62583
62603
  return RtmPlugin.isSupportedH264();
62584
62604
  return false;
62585
62605
  }
62606
+ async function isRTMSeiSupported() {
62607
+ const { RtmPlugin } = await load(DynamicModule.PluginRtm);
62608
+ return RtmPlugin.isEncodedTransformSupported();
62609
+ }
62586
62610
  const rtmStrategy = {
62587
62611
  options: {},
62588
62612
  module: DynamicModule.PluginRtm
@@ -74283,7 +74307,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
74283
74307
  }
74284
74308
  await ((_a = liveVeStrategy.veStrategyManager) == null ? void 0 : _a.init({
74285
74309
  ...options,
74286
- playerVersion: "2.12.0-rc.1",
74310
+ playerVersion: "2.12.0-rc.2",
74287
74311
  type: "LIVE"
74288
74312
  }));
74289
74313
  return liveVeStrategy.veStrategyManager;
@@ -74315,6 +74339,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
74315
74339
  exports2.isFLVSupported = isFLVSupported;
74316
74340
  exports2.isMMSSupported = isMMSSupported$1;
74317
74341
  exports2.isMseSupported = isMseSupported$2;
74342
+ exports2.isRTMSeiSupported = isRTMSeiSupported;
74318
74343
  exports2.isRTMSupportCodec = isRTMSupportCodec;
74319
74344
  exports2.isRTMSupported = isRTMSupported;
74320
74345
  exports2.isSoftDecodeSupported = isSoftDecodeSupported;