@volcengine/veplayer 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.
@@ -1312,7 +1312,7 @@ var VERSION_REG = {
1312
1312
  android: /(Android)\s([\d.]+)/,
1313
1313
  ios: /(Version)\/([\d.]+)/
1314
1314
  };
1315
- var H264_MIMETYPES = ["avc1.42E01E, mp4a.40.2", "avc1.58A01E, mp4a.40.2", "avc1.4D401E, mp4a.40.2", "avc1.64001E, mp4a.40.2", "avc1.42E01E", "mp4v.20.8", "avc1.42E01E, mp4a.40.2", "avc1.58A01E, mp4a.40.2", "avc1.4D401E, mp4a.40.2", "avc1.64001E, mp4a.40.2", "mp4v.20.8, mp4a.40.2", "mp4v.20.240, mp4a.40.2"];
1315
+ var H264_MIMETYPES = ["avc1.42E01E, mp4a.40.2", "avc1.58A01E, mp4a.40.2", "avc1.4D401E, mp4a.40.2", "avc1.64001E, mp4a.40.2", "avc1.42E01E", "mp4v.20.8", "mp4v.20.8, mp4a.40.2", "mp4v.20.240, mp4a.40.2"];
1316
1316
  var sniffer$1 = {
1317
1317
  get device() {
1318
1318
  var r2 = sniffer$1.os;
@@ -1457,7 +1457,7 @@ var sniffer$1 = {
1457
1457
  }
1458
1458
  }
1459
1459
  };
1460
- var version = "3.0.19-rc.0";
1460
+ var version = "3.0.20-rc.6";
1461
1461
  var ERROR_TYPE_MAP = {
1462
1462
  1: "media",
1463
1463
  2: "media",
@@ -2427,8 +2427,7 @@ function hook(hookName, handler) {
2427
2427
  }
2428
2428
  if (this.__hooks && this.__hooks[hookName]) {
2429
2429
  try {
2430
- var _this$__hooks$hookNam;
2431
- var preRet = (_this$__hooks$hookNam = this.__hooks[hookName]).call.apply(_this$__hooks$hookNam, [this, this].concat(Array.prototype.slice.call(arguments)));
2430
+ var preRet = runHooks(this, hookName, handler);
2432
2431
  if (preRet) {
2433
2432
  if (preRet.then) {
2434
2433
  preRet.then(function(isContinue) {
@@ -2453,6 +2452,19 @@ function hook(hookName, handler) {
2453
2452
  }
2454
2453
  }.bind(this);
2455
2454
  }
2455
+ function findHookIndex(hookName, handler) {
2456
+ var __hooks = this.__hooks;
2457
+ if (!__hooks || !Array.isArray(__hooks[hookName])) {
2458
+ return -1;
2459
+ }
2460
+ var hookHandlers = __hooks[hookName];
2461
+ for (var i2 = 0; i2 < hookHandlers.length; i2++) {
2462
+ if (hookHandlers[i2] === handler) {
2463
+ return i2;
2464
+ }
2465
+ }
2466
+ return -1;
2467
+ }
2456
2468
  function useHooks(hookName, handler) {
2457
2469
  var __hooks = this.__hooks;
2458
2470
  if (!__hooks) {
@@ -2462,7 +2474,12 @@ function useHooks(hookName, handler) {
2462
2474
  console.warn("has no supported hook which name [".concat(hookName, "]"));
2463
2475
  return false;
2464
2476
  }
2465
- __hooks && (__hooks[hookName] = handler);
2477
+ if (!Array.isArray(__hooks[hookName])) {
2478
+ __hooks[hookName] = [];
2479
+ }
2480
+ if (findHookIndex.call(this, hookName, handler) === -1) {
2481
+ __hooks[hookName].push(handler);
2482
+ }
2466
2483
  return true;
2467
2484
  }
2468
2485
  function removeHooks(hookName, handler) {
@@ -2470,6 +2487,13 @@ function removeHooks(hookName, handler) {
2470
2487
  if (!__hooks) {
2471
2488
  return;
2472
2489
  }
2490
+ if (Array.isArray(__hooks[hookName])) {
2491
+ var hooks = __hooks[hookName];
2492
+ var index = findHookIndex.call(this, hookName, handler);
2493
+ if (index !== -1) {
2494
+ hooks.splice(index, 1);
2495
+ }
2496
+ }
2473
2497
  delete __hooks[hookName];
2474
2498
  }
2475
2499
  function usePluginHooks(pluginName) {
@@ -2517,18 +2541,30 @@ function runHooks(obj, hookName, handler) {
2517
2541
  for (var _len5 = arguments.length, args = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
2518
2542
  args[_key5 - 3] = arguments[_key5];
2519
2543
  }
2520
- if (obj.__hooks && obj.__hooks[hookName]) {
2521
- var _obj$__hooks$hookName;
2522
- var ret = (_obj$__hooks$hookName = obj.__hooks[hookName]).call.apply(_obj$__hooks$hookName, [obj, obj].concat(args));
2523
- if (ret && ret.then) {
2524
- ret.then(function(data) {
2525
- return data === false ? null : handler.call.apply(handler, [obj, obj].concat(args));
2526
- }).catch(function(e3) {
2527
- console.warn("[runHooks]".concat(hookName, " reject"), e3.message);
2528
- });
2529
- } else if (ret !== false) {
2530
- return handler.call.apply(handler, [obj, obj].concat(args));
2531
- }
2544
+ if (obj.__hooks && Array.isArray(obj.__hooks[hookName])) {
2545
+ var hooks = obj.__hooks[hookName];
2546
+ var index = -1;
2547
+ var runHooksRecursive = function runHooksRecursive2(obj2, hookName2, handler2) {
2548
+ for (var _len6 = arguments.length, args2 = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {
2549
+ args2[_key6 - 3] = arguments[_key6];
2550
+ }
2551
+ index++;
2552
+ if (hooks.length === 0 || index === hooks.length) {
2553
+ return handler2.call.apply(handler2, [obj2, obj2].concat(args2));
2554
+ }
2555
+ var hook2 = hooks[index];
2556
+ var ret = hook2.call.apply(hook2, [obj2, obj2].concat(args2));
2557
+ if (ret && ret.then) {
2558
+ return ret.then(function(data) {
2559
+ return data === false ? null : runHooksRecursive2.apply(void 0, [obj2, hookName2, handler2].concat(args2));
2560
+ }).catch(function(e3) {
2561
+ console.warn("[runHooks]".concat(hookName2, " reject"), e3.message);
2562
+ });
2563
+ } else if (ret !== false) {
2564
+ return runHooksRecursive2.apply(void 0, [obj2, hookName2, handler2].concat(args2));
2565
+ }
2566
+ };
2567
+ return runHooksRecursive.apply(void 0, [obj, hookName, handler].concat(args));
2532
2568
  } else {
2533
2569
  return handler.call.apply(handler, [obj, obj].concat(args));
2534
2570
  }
@@ -2772,6 +2808,18 @@ var BasePlugin = /* @__PURE__ */ function() {
2772
2808
  }
2773
2809
  }
2774
2810
  }
2811
+ }, {
2812
+ key: "defineMethod",
2813
+ value: function defineMethod(Obj, map) {
2814
+ for (var key in map) {
2815
+ if (Object.prototype.hasOwnProperty.call(map, key) && typeof map[key] === "function") {
2816
+ Object.defineProperty(Obj, key, {
2817
+ configurable: true,
2818
+ value: map[key]
2819
+ });
2820
+ }
2821
+ }
2822
+ }
2775
2823
  }, {
2776
2824
  key: "defaultConfig",
2777
2825
  get: function get() {
@@ -3417,7 +3465,7 @@ var ResizeObserver = /* @__PURE__ */ function() {
3417
3465
  if (!this.observer) {
3418
3466
  return;
3419
3467
  }
3420
- this.observer && this.observer.observe(target);
3468
+ this.observer.observe(target);
3421
3469
  var _pid = target.getAttribute(PLATER_ID);
3422
3470
  var __handlers = this.__handlers;
3423
3471
  var index = -1;
@@ -3446,16 +3494,17 @@ var ResizeObserver = /* @__PURE__ */ function() {
3446
3494
  }
3447
3495
  });
3448
3496
  try {
3449
- this.observer && this.observer.unobserve(target);
3497
+ var _this$observer;
3498
+ (_this$observer = this.observer) === null || _this$observer === void 0 ? void 0 : _this$observer.unobserve(target);
3450
3499
  } catch (e3) {
3451
3500
  }
3452
- this.observer && this.observer.unobserve(target);
3453
3501
  i2 > -1 && this.__handlers.splice(i2, 1);
3454
3502
  }
3455
3503
  }, {
3456
3504
  key: "destroyObserver",
3457
3505
  value: function destroyObserver() {
3458
- this.observer && this.observer.disconnect();
3506
+ var _this$observer2;
3507
+ (_this$observer2 = this.observer) === null || _this$observer2 === void 0 ? void 0 : _this$observer2.disconnect();
3459
3508
  this.observer = null;
3460
3509
  this.__handlers = null;
3461
3510
  }
@@ -3487,7 +3536,8 @@ function addObserver(target, handler) {
3487
3536
  return resizeObserver;
3488
3537
  }
3489
3538
  function unObserver(target, handler) {
3490
- resizeObserver.unObserver(target, handler);
3539
+ var _resizeObserver;
3540
+ (_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 ? void 0 : _resizeObserver.unObserver(target, handler);
3491
3541
  }
3492
3542
  var pluginsManager = {
3493
3543
  pluginGroup: {},
@@ -4485,10 +4535,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
4485
4535
  }
4486
4536
  var _this$config = _this.config, autoplay2 = _this$config.autoplay, defaultPlaybackRate = _this$config.defaultPlaybackRate;
4487
4537
  XG_DEBUG.logInfo("player", "canPlayFunc, startTime", _this.__startTime);
4488
- if (_this.__startTime > 0 && _this.duration > 0) {
4489
- _this.currentTime = _this.__startTime > _this.duration ? _this.duration : _this.__startTime;
4490
- _this.__startTime = -1;
4491
- }
4538
+ _this._seekToStartTime();
4492
4539
  _this.playbackRate = defaultPlaybackRate;
4493
4540
  (autoplay2 || _this._useAutoplay) && _this.mediaPlay();
4494
4541
  _this.off(CANPLAY, _this.canPlayFunc);
@@ -4578,6 +4625,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
4578
4625
  _this.waitTimer = null;
4579
4626
  _this.handleSource = true;
4580
4627
  _this._state = STATES.INITIAL;
4628
+ _this.isAd = false;
4581
4629
  _this.isError = false;
4582
4630
  _this._hasStart = false;
4583
4631
  _this.isSeeking = false;
@@ -4962,7 +5010,8 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
4962
5010
  _pConfig.position && (options.position = _pConfig.position);
4963
5011
  var position = options.position ? options.position : options.config && options.config.position || PLUFGIN.defaultConfig && PLUFGIN.defaultConfig.position;
4964
5012
  if (!options.root && typeof position === "string" && position.indexOf("controls") > -1) {
4965
- return this.controls && this.controls.registerPlugin(PLUFGIN, options, PLUFGIN.pluginName);
5013
+ var _this$controls;
5014
+ return (_this$controls = this.controls) === null || _this$controls === void 0 ? void 0 : _this$controls.registerPlugin(PLUFGIN, options, PLUFGIN.pluginName);
4966
5015
  }
4967
5016
  if (!options.root) {
4968
5017
  options.root = this._getRootByPosition(position);
@@ -5110,10 +5159,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5110
5159
  reject(e3);
5111
5160
  };
5112
5161
  var _canplay = function _canplay2() {
5113
- if (_this9.duration > 0 && _this9.__startTime > 0) {
5114
- _this9.currentTime = _this9.__startTime;
5115
- _this9.__startTime = -1;
5116
- }
5162
+ _this9._seekToStartTime();
5117
5163
  if (isPaused) {
5118
5164
  _this9.pause();
5119
5165
  }
@@ -5734,11 +5780,17 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5734
5780
  }, {
5735
5781
  key: "onLoadeddata",
5736
5782
  value: function onLoadeddata() {
5783
+ var _this22 = this;
5737
5784
  this.isError = false;
5738
5785
  this.isSeeking = false;
5739
- if (this.__startTime > 0 && this.duration > 0) {
5740
- this.currentTime = this.__startTime;
5741
- this.__startTime = -1;
5786
+ if (this.__startTime > 0) {
5787
+ if (this.duration > 0) {
5788
+ this._seekToStartTime();
5789
+ } else {
5790
+ this.once(DURATION_CHANGE, function() {
5791
+ _this22._seekToStartTime();
5792
+ });
5793
+ }
5742
5794
  }
5743
5795
  }
5744
5796
  }, {
@@ -5807,27 +5859,27 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5807
5859
  }, {
5808
5860
  key: "onWaiting",
5809
5861
  value: function onWaiting() {
5810
- var _this22 = this;
5862
+ var _this23 = this;
5811
5863
  if (this.waitTimer) {
5812
5864
  util$1.clearTimeout(this, this.waitTimer);
5813
5865
  }
5814
5866
  this.updateAcc("waiting");
5815
5867
  this.waitTimer = util$1.setTimeout(this, function() {
5816
- _this22.addClass(STATE_CLASS.LOADING);
5817
- _this22.emit(LOADING);
5818
- util$1.clearTimeout(_this22, _this22.waitTimer);
5819
- _this22.waitTimer = null;
5868
+ _this23.addClass(STATE_CLASS.LOADING);
5869
+ _this23.emit(LOADING);
5870
+ util$1.clearTimeout(_this23, _this23.waitTimer);
5871
+ _this23.waitTimer = null;
5820
5872
  }, this.config.minWaitDelay);
5821
5873
  }
5822
5874
  }, {
5823
5875
  key: "onPlaying",
5824
5876
  value: function onPlaying() {
5825
- var _this23 = this;
5877
+ var _this24 = this;
5826
5878
  this.isError = false;
5827
5879
  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;
5828
5880
  var clsList = [NO_START, PAUSED, ENDED2, ERROR2, REPLAY2, LOADING2];
5829
5881
  clsList.forEach(function(cls) {
5830
- _this23.removeClass(cls);
5882
+ _this24.removeClass(cls);
5831
5883
  });
5832
5884
  if (!this._accPlayed.t && !this.paused && !this.ended) {
5833
5885
  this._accPlayed.t = (/* @__PURE__ */ new Date()).getTime();
@@ -5988,14 +6040,14 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5988
6040
  }, {
5989
6041
  key: "setConfig",
5990
6042
  value: function setConfig(config) {
5991
- var _this24 = this;
6043
+ var _this25 = this;
5992
6044
  if (!config) {
5993
6045
  return;
5994
6046
  }
5995
6047
  Object.keys(config).map(function(key) {
5996
6048
  if (key !== "plugins") {
5997
- _this24.config[key] = config[key];
5998
- var plugin = _this24.plugins[key.toLowerCase()];
6049
+ _this25.config[key] = config[key];
6050
+ var plugin = _this25.plugins[key.toLowerCase()];
5999
6051
  if (plugin && util$1.typeOf(plugin.setConfig) === "Function") {
6000
6052
  plugin.setConfig(config[key]);
6001
6053
  }
@@ -6005,20 +6057,20 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
6005
6057
  }, {
6006
6058
  key: "playNext",
6007
6059
  value: function playNext(config) {
6008
- var _this25 = this;
6060
+ var _this26 = this;
6009
6061
  this.resetState();
6010
6062
  this.setConfig(config);
6011
6063
  this._currentTime = 0;
6012
6064
  this._duration = 0;
6013
6065
  runHooks(this, "playnext", function() {
6014
- _this25.start();
6015
- _this25.emit(PLAYNEXT, config);
6066
+ _this26.start();
6067
+ _this26.emit(PLAYNEXT, config);
6016
6068
  });
6017
6069
  }
6018
6070
  }, {
6019
6071
  key: "resize",
6020
6072
  value: function resize() {
6021
- var _this26 = this;
6073
+ var _this27 = this;
6022
6074
  if (!this.media) {
6023
6075
  return;
6024
6076
  }
@@ -6058,7 +6110,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
6058
6110
  }
6059
6111
  if (!this.fullscreen && !this.cssfullscreen) {
6060
6112
  Object.keys(_style).forEach(function(key) {
6061
- _this26.root.style[key] = _style[key];
6113
+ _this27.root.style[key] = _style[key];
6062
6114
  });
6063
6115
  }
6064
6116
  if (videoFillMode === "fillHeight" && fit < videoFit || videoFillMode === "fillWidth" && fit > videoFit) {
@@ -6100,6 +6152,14 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
6100
6152
  url
6101
6153
  };
6102
6154
  }
6155
+ }, {
6156
+ key: "_seekToStartTime",
6157
+ value: function _seekToStartTime() {
6158
+ if (this.__startTime > 0 && this.duration > 0) {
6159
+ this.currentTime = this.__startTime > this.duration ? this.duration : this.__startTime;
6160
+ this.__startTime = -1;
6161
+ }
6162
+ }
6103
6163
  }, {
6104
6164
  key: "state",
6105
6165
  get: function get() {
@@ -6150,15 +6210,15 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
6150
6210
  return this.config.definition.list || [];
6151
6211
  },
6152
6212
  set: function set(list) {
6153
- var _this27 = this;
6213
+ var _this28 = this;
6154
6214
  var definition = this.config.definition;
6155
6215
  var curDef = null;
6156
6216
  var targetDef = null;
6157
6217
  definition.list = list;
6158
6218
  this.emit("resourceReady", list);
6159
6219
  list.forEach(function(item) {
6160
- var _this27$curDefinition;
6161
- if (((_this27$curDefinition = _this27.curDefinition) === null || _this27$curDefinition === void 0 ? void 0 : _this27$curDefinition.definition) === item.definition) {
6220
+ var _this28$curDefinition;
6221
+ if (((_this28$curDefinition = _this28.curDefinition) === null || _this28$curDefinition === void 0 ? void 0 : _this28$curDefinition.definition) === item.definition) {
6162
6222
  curDef = item;
6163
6223
  }
6164
6224
  if (definition.defaultDefinition === item.definition) {
@@ -6922,7 +6982,7 @@ var Start = /* @__PURE__ */ function(_Plugin) {
6922
6982
  var className = _this.config.mode === "auto" ? "auto-hide" : "hide";
6923
6983
  util$1.addClass(_this.root, className);
6924
6984
  _this.autoPlayStart = true;
6925
- _this.onPlayPause("play");
6985
+ _this.toggleTo("play");
6926
6986
  });
6927
6987
  _this.autoPlayStart = false;
6928
6988
  return _this;
@@ -6930,9 +6990,19 @@ var Start = /* @__PURE__ */ function(_Plugin) {
6930
6990
  _createClass$1(Start2, [{
6931
6991
  key: "afterCreate",
6932
6992
  value: function afterCreate() {
6993
+ var playerConfig = this.playerConfig;
6994
+ this.initIcons();
6995
+ this.listenEvents();
6996
+ this.bindClickEvents();
6997
+ if (!playerConfig.autoplay) {
6998
+ this.show();
6999
+ }
7000
+ }
7001
+ }, {
7002
+ key: "listenEvents",
7003
+ value: function listenEvents() {
6933
7004
  var _this2 = this;
6934
7005
  var player = this.player, playerConfig = this.playerConfig;
6935
- this.initIcons();
6936
7006
  this.once(READY, function() {
6937
7007
  if (playerConfig) {
6938
7008
  if (playerConfig.lang && playerConfig.lang === "en") {
@@ -6943,9 +7013,6 @@ var Start = /* @__PURE__ */ function(_Plugin) {
6943
7013
  }
6944
7014
  });
6945
7015
  this.on(AUTOPLAY_STARTED, this.onAutoplayStart);
6946
- if (!playerConfig.autoplay) {
6947
- this.show();
6948
- }
6949
7016
  this.on(AUTOPLAY_PREVENTED, function() {
6950
7017
  var className = _this2.config.mode === "auto" ? "auto-hide" : "hide";
6951
7018
  _this2.setAttr("data-state", "play");
@@ -6953,20 +7020,25 @@ var Start = /* @__PURE__ */ function(_Plugin) {
6953
7020
  _this2.show();
6954
7021
  });
6955
7022
  this.on(PLAY, function() {
6956
- _this2.onPlayPause("play");
7023
+ _this2.toggleTo("play");
6957
7024
  });
6958
7025
  this.on(PAUSE, function() {
6959
- _this2.onPlayPause("pause");
7026
+ _this2.toggleTo("pause");
6960
7027
  });
6961
7028
  this.on(RESET, function() {
6962
7029
  _this2.onPlayerReset();
6963
7030
  });
7031
+ }
7032
+ }, {
7033
+ key: "bindClickEvents",
7034
+ value: function bindClickEvents() {
7035
+ var _this3 = this;
6964
7036
  this.clickHandler = this.hook("startClick", this.switchPausePlay, {
6965
7037
  pre: function pre(e3) {
6966
7038
  e3.cancelable && e3.preventDefault();
6967
7039
  e3.stopPropagation();
6968
- var paused = _this2.player.paused;
6969
- _this2.emitUserAction(e3, "switch_play_pause", {
7040
+ var paused = _this3.player.paused;
7041
+ _this3.emitUserAction(e3, "switch_play_pause", {
6970
7042
  props: "paused",
6971
7043
  from: paused,
6972
7044
  to: !paused
@@ -7028,17 +7100,17 @@ var Start = /* @__PURE__ */ function(_Plugin) {
7028
7100
  }, {
7029
7101
  key: "animate",
7030
7102
  value: function animate(endShow) {
7031
- var _this3 = this;
7103
+ var _this4 = this;
7032
7104
  this._animateId = addAnimate("pauseplay", 400, {
7033
7105
  start: function start() {
7034
- util$1.addClass(_this3.root, "interact");
7035
- _this3.show();
7036
- _this3.switchStatus(true);
7106
+ util$1.addClass(_this4.root, "interact");
7107
+ _this4.show();
7108
+ _this4.switchStatus(true);
7037
7109
  },
7038
7110
  end: function end() {
7039
- util$1.removeClass(_this3.root, "interact");
7040
- !endShow && _this3.hide();
7041
- _this3._animateId = null;
7111
+ util$1.removeClass(_this4.root, "interact");
7112
+ !endShow && _this4.hide();
7113
+ _this4._animateId = null;
7042
7114
  }
7043
7115
  });
7044
7116
  }
@@ -7068,6 +7140,11 @@ var Start = /* @__PURE__ */ function(_Plugin) {
7068
7140
  }, {
7069
7141
  key: "onPlayPause",
7070
7142
  value: function onPlayPause(status) {
7143
+ this.toggleTo(status);
7144
+ }
7145
+ }, {
7146
+ key: "toggleTo",
7147
+ value: function toggleTo(status) {
7071
7148
  var config = this.config, player = this.player;
7072
7149
  if (!player || player.state < STATES.RUNNING || !this.autoPlayStart) {
7073
7150
  return;
@@ -8443,7 +8520,7 @@ var MobilePlugin = /* @__PURE__ */ function(_Plugin) {
8443
8520
  }
8444
8521
  this.on(DURATION_CHANGE, function() {
8445
8522
  var player2 = _this2.player, config2 = _this2.config;
8446
- if (player2.duration * 1e3 < config2.moveDuration) {
8523
+ if (player2.duration > 0 && player2.duration * 1e3 < config2.moveDuration) {
8447
8524
  config2.moveDuration = player2.duration * 1e3;
8448
8525
  }
8449
8526
  });
@@ -8757,10 +8834,13 @@ var MobilePlugin = /* @__PURE__ */ function(_Plugin) {
8757
8834
  }, {
8758
8835
  key: "updateBrightness",
8759
8836
  value: function updateBrightness(percent) {
8837
+ var pos = this.pos, config = this.config, xgMask = this.xgMask;
8838
+ if (!config.darkness) {
8839
+ return;
8840
+ }
8760
8841
  if (this.player.rotateDeg) {
8761
8842
  percent = -percent;
8762
8843
  }
8763
- var pos = this.pos, config = this.config, xgMask = this.xgMask;
8764
8844
  var light = pos.light + 0.8 * percent;
8765
8845
  light = light > config.maxDarkness ? config.maxDarkness : light < 0 ? 0 : light;
8766
8846
  if (xgMask) {
@@ -8821,12 +8901,12 @@ var MobilePlugin = /* @__PURE__ */ function(_Plugin) {
8821
8901
  }, {
8822
8902
  key: "disableGesture",
8823
8903
  value: function disableGesture() {
8824
- this.config.disableGesture = false;
8904
+ this.config.disableGesture = true;
8825
8905
  }
8826
8906
  }, {
8827
8907
  key: "enableGesture",
8828
8908
  value: function enableGesture() {
8829
- this.config.disableGesture = true;
8909
+ this.config.disableGesture = false;
8830
8910
  }
8831
8911
  }, {
8832
8912
  key: "destroy",
@@ -9398,29 +9478,56 @@ var Play$1 = /* @__PURE__ */ function(_IconPlugin) {
9398
9478
  _inherits(Play2, _IconPlugin);
9399
9479
  var _super = _createSuper(Play2);
9400
9480
  function Play2() {
9481
+ var _this;
9401
9482
  _classCallCheck(this, Play2);
9402
- return _super.apply(this, arguments);
9483
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
9484
+ args[_key] = arguments[_key];
9485
+ }
9486
+ _this = _super.call.apply(_super, [this].concat(args));
9487
+ _defineProperty$1(_assertThisInitialized(_this), "btnClick", function(e3) {
9488
+ e3.preventDefault();
9489
+ e3.stopPropagation();
9490
+ var _assertThisInitialize = _assertThisInitialized(_this), player = _assertThisInitialize.player;
9491
+ _this.emitUserAction(e3, "switch_play_pause", {
9492
+ prop: "paused",
9493
+ from: player.paused,
9494
+ to: !player.paused
9495
+ });
9496
+ if (player.ended) {
9497
+ player.replay();
9498
+ } else if (player.paused) {
9499
+ player.play();
9500
+ _this.animate(false);
9501
+ } else {
9502
+ player.pause();
9503
+ _this.animate(true);
9504
+ }
9505
+ return false;
9506
+ });
9507
+ return _this;
9403
9508
  }
9404
9509
  _createClass$1(Play2, [{
9405
9510
  key: "afterCreate",
9406
9511
  value: function afterCreate() {
9407
- var _this = this;
9408
9512
  _get(_getPrototypeOf(Play2.prototype), "afterCreate", this).call(this);
9409
- var player = this.player, config = this.config;
9513
+ var config = this.config;
9410
9514
  if (config.disable) {
9411
9515
  return;
9412
9516
  }
9413
9517
  this.initIcons();
9414
- this.btnClick = this.btnClick.bind(this);
9415
9518
  this.bind(["touchend", "click"], this.btnClick);
9416
- this.on([PAUSE, ERROR, EMPTIED], function() {
9417
- _this.animate(player.paused);
9418
- });
9419
- this.on(PLAY, function() {
9420
- _this.animate(player.paused);
9421
- });
9519
+ this.listenEvents();
9422
9520
  this.animate(true);
9423
9521
  }
9522
+ }, {
9523
+ key: "listenEvents",
9524
+ value: function listenEvents() {
9525
+ var _this2 = this;
9526
+ var player = this.player;
9527
+ this.on([PLAY, PAUSE, ERROR, EMPTIED], function() {
9528
+ _this2.animate(player.paused);
9529
+ });
9530
+ }
9424
9531
  }, {
9425
9532
  key: "registerIcons",
9426
9533
  value: function registerIcons() {
@@ -9435,28 +9542,6 @@ var Play$1 = /* @__PURE__ */ function(_IconPlugin) {
9435
9542
  }
9436
9543
  };
9437
9544
  }
9438
- }, {
9439
- key: "btnClick",
9440
- value: function btnClick(e3) {
9441
- e3.preventDefault();
9442
- e3.stopPropagation();
9443
- var player = this.player;
9444
- this.emitUserAction(e3, "switch_play_pause", {
9445
- prop: "paused",
9446
- from: player.paused,
9447
- to: !player.paused
9448
- });
9449
- if (player.ended) {
9450
- player.replay();
9451
- } else if (player.paused) {
9452
- player.play();
9453
- this.animate(false);
9454
- } else {
9455
- player.pause();
9456
- this.animate(true);
9457
- }
9458
- return false;
9459
- }
9460
9545
  }, {
9461
9546
  key: "initIcons",
9462
9547
  value: function initIcons() {
@@ -11575,10 +11660,10 @@ class OptionsIcon extends Plugin {
11575
11660
  const { controls } = this.player;
11576
11661
  const { listType } = this.config;
11577
11662
  if (isActive) {
11578
- listType && MODAL_TYPES.includes(listType) ? controls.blur() : controls.focus();
11663
+ listType && MODAL_TYPES.includes(listType) ? controls == null ? void 0 : controls.blur() : controls == null ? void 0 : controls.focus();
11579
11664
  this.optionsList && this.optionsList.show();
11580
11665
  } else {
11581
- listType && MODAL_TYPES.includes(listType) ? controls.focus() : controls.focusAwhile();
11666
+ listType && MODAL_TYPES.includes(listType) ? controls == null ? void 0 : controls.focus() : controls == null ? void 0 : controls.focusAwhile();
11582
11667
  this.optionsList && this.optionsList.hide();
11583
11668
  }
11584
11669
  this._isActive = isActive;
@@ -13742,7 +13827,7 @@ class VePlayerBase {
13742
13827
  * @returns
13743
13828
  */
13744
13829
  get playerVersion() {
13745
- return "2.4.2-rc.1";
13830
+ return "2.4.3-rc.0";
13746
13831
  }
13747
13832
  /** {zh}
13748
13833
  * @brief 获取当前播放视频的清晰度唯一标识(definition)。
@@ -21994,10 +22079,10 @@ class Logger extends Plugin {
21994
22079
  user_id: this._userId,
21995
22080
  device_id: this._deviceId,
21996
22081
  ext: {
21997
- veplayer_version: "2.4.2-rc.1",
21998
- flv_version: "3.0.19-rc.0",
21999
- hls_version: "3.0.19-rc.0",
22000
- rts_version: "0.2.1-alpha.4"
22082
+ veplayer_version: "2.4.3-rc.0",
22083
+ flv_version: "v3.0.20-rc.6",
22084
+ hls_version: "v3.0.20-rc.6",
22085
+ rts_version: "0.2.1-alpha.0"
22001
22086
  }
22002
22087
  });
22003
22088
  }