@volcengine/veplayer 2.3.0 → 2.4.0-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.
Files changed (40) hide show
  1. package/esm/index.d.ts +73 -3
  2. package/esm/veplayer.biz.live.development.js +92 -21
  3. package/esm/veplayer.biz.live.production.js +1 -1
  4. package/esm/veplayer.d.ts +290 -5
  5. package/esm/veplayer.development.css +1 -1
  6. package/esm/veplayer.development.js +217 -75
  7. package/esm/veplayer.live.d.ts +290 -5
  8. package/esm/veplayer.live.development.css +1 -1
  9. package/esm/veplayer.live.development.js +217 -75
  10. package/esm/veplayer.live.production.css +1 -1
  11. package/esm/veplayer.live.production.js +3 -3
  12. package/esm/veplayer.production.css +1 -1
  13. package/esm/veplayer.production.js +3 -3
  14. package/esm/veplayer.vod.d.ts +73 -3
  15. package/esm/veplayer.vod.development.css +1 -1
  16. package/esm/veplayer.vod.development.js +169 -68
  17. package/esm/veplayer.vod.production.css +1 -1
  18. package/esm/veplayer.vod.production.js +2 -2
  19. package/package.json +1 -1
  20. package/umd/index.d.ts +73 -3
  21. package/umd/veplayer.biz.live.development.js +92 -21
  22. package/umd/veplayer.biz.live.production.js +1 -1
  23. package/umd/veplayer.d.ts +290 -5
  24. package/umd/veplayer.development.css +1 -1
  25. package/umd/veplayer.development.js +217 -75
  26. package/umd/veplayer.live.d.ts +290 -5
  27. package/umd/veplayer.live.development.css +1 -1
  28. package/umd/veplayer.live.development.js +217 -75
  29. package/umd/veplayer.live.production.css +1 -1
  30. package/umd/veplayer.live.production.js +1 -1
  31. package/umd/veplayer.production.css +1 -1
  32. package/umd/veplayer.production.js +1 -1
  33. package/umd/veplayer.vod.d.ts +73 -3
  34. package/umd/veplayer.vod.development.css +1 -1
  35. package/umd/veplayer.vod.development.js +169 -68
  36. package/umd/veplayer.vod.production.css +1 -1
  37. package/umd/veplayer.vod.production.js +1 -1
  38. package/veplayer.d.ts +290 -5
  39. package/veplayer.live.d.ts +290 -5
  40. package/veplayer.vod.d.ts +73 -3
@@ -1009,6 +1009,9 @@ var __publicField = (obj, key, value) => {
1009
1009
  _fun && _fun(frameId);
1010
1010
  };
1011
1011
  util.isMSE = function(video) {
1012
+ if (video.media) {
1013
+ video = video.media;
1014
+ }
1012
1015
  if (!video || !(video instanceof HTMLMediaElement)) {
1013
1016
  return false;
1014
1017
  }
@@ -1453,7 +1456,7 @@ var __publicField = (obj, key, value) => {
1453
1456
  }
1454
1457
  }
1455
1458
  };
1456
- var version = "3.0.12";
1459
+ var version = "3.0.17";
1457
1460
  var ERROR_TYPE_MAP = {
1458
1461
  1: "media",
1459
1462
  2: "media",
@@ -1559,6 +1562,9 @@ var __publicField = (obj, key, value) => {
1559
1562
  var DESTROY = "destroy";
1560
1563
  var URL_CHANGE = "urlchange";
1561
1564
  var DOWNLOAD_SPEED_CHANGE = "download_speed_change";
1565
+ var LEAVE_PLAYER = "leaveplayer";
1566
+ var ENTER_PLAYER = "enterplayer";
1567
+ var LOADING = "loading";
1562
1568
  var FULLSCREEN_CHANGE = "fullscreen_change";
1563
1569
  var CSS_FULLSCREEN_CHANGE = "cssFullscreen_change";
1564
1570
  var MINI_STATE_CHANGE = "mini_state_change";
@@ -1604,11 +1610,14 @@ var __publicField = (obj, key, value) => {
1604
1610
  DURATION_CHANGE,
1605
1611
  EMPTIED,
1606
1612
  ENDED,
1613
+ ENTER_PLAYER,
1607
1614
  ERROR,
1608
1615
  FPS_STUCK,
1609
1616
  FULLSCREEN_CHANGE,
1617
+ LEAVE_PLAYER,
1610
1618
  LOADED_DATA,
1611
1619
  LOADED_METADATA,
1620
+ LOADING,
1612
1621
  LOAD_START,
1613
1622
  MINI_STATE_CHANGE,
1614
1623
  PAUSE,
@@ -2208,6 +2217,11 @@ var __publicField = (obj, key, value) => {
2208
2217
  }
2209
2218
  this.media.volume = vol;
2210
2219
  }
2220
+ }, {
2221
+ key: "aspectRatio",
2222
+ get: function get() {
2223
+ return this.media ? this.media.videoWidth / this.media.videoHeight : 0;
2224
+ }
2211
2225
  }, {
2212
2226
  key: "addInnerOP",
2213
2227
  value: function addInnerOP(event) {
@@ -2833,6 +2847,10 @@ var __publicField = (obj, key, value) => {
2833
2847
  CONTROLS_CENTER: "controlsCenter",
2834
2848
  CONTROLS: "controls"
2835
2849
  };
2850
+ var PLUGIN_STATE_CLASS = {
2851
+ ICON_DISABLE: "xg-icon-disable",
2852
+ ICON_HIDE: "xg-icon-hide"
2853
+ };
2836
2854
  function isUrl(str) {
2837
2855
  if (!str) {
2838
2856
  return false;
@@ -3066,6 +3084,18 @@ var __publicField = (obj, key, value) => {
3066
3084
  value: function plugins() {
3067
3085
  return this._children;
3068
3086
  }
3087
+ }, {
3088
+ key: "disable",
3089
+ value: function disable() {
3090
+ this.config.disable = true;
3091
+ util.addClass(this.find(".xgplayer-icon"), PLUGIN_STATE_CLASS.ICON_DISABLE);
3092
+ }
3093
+ }, {
3094
+ key: "enable",
3095
+ value: function enable() {
3096
+ this.config.disable = false;
3097
+ util.removeClass(this.find(".xgplayer-icon"), PLUGIN_STATE_CLASS.ICON_DISABLE);
3098
+ }
3069
3099
  }, {
3070
3100
  key: "children",
3071
3101
  value: function children() {
@@ -3212,7 +3242,7 @@ var __publicField = (obj, key, value) => {
3212
3242
  var cs = window.getComputedStyle(this.root, null);
3213
3243
  var cssDisplayValue = cs.getPropertyValue("display");
3214
3244
  if (cssDisplayValue === "none") {
3215
- this.root.style.display = "block";
3245
+ return this.root.style.display = "block";
3216
3246
  }
3217
3247
  }
3218
3248
  }, {
@@ -3758,15 +3788,8 @@ var __publicField = (obj, key, value) => {
3758
3788
  var item = _Object$keys[_i];
3759
3789
  this.unRegister(cgid, item);
3760
3790
  }
3761
- var _isUseActive = player.isUseActive;
3762
3791
  delete this.pluginGroup[cgid];
3763
3792
  delete player._pluginInfoId;
3764
- if (_isUseActive) {
3765
- var keys = Object.keys(this.pluginGroup);
3766
- if (keys.length > 0) {
3767
- this.setCurrentUserActive(keys[keys.length - 1], true);
3768
- }
3769
- }
3770
3793
  }
3771
3794
  };
3772
3795
  var STATE_CLASS = {
@@ -4548,6 +4571,7 @@ var __publicField = (obj, key, value) => {
4548
4571
  }
4549
4572
  _this.userTimer = null;
4550
4573
  _this.waitTimer = null;
4574
+ _this.handleSource = true;
4551
4575
  _this._state = STATES.INITIAL;
4552
4576
  _this.isError = false;
4553
4577
  _this._hasStart = false;
@@ -4776,6 +4800,15 @@ var __publicField = (obj, key, value) => {
4776
4800
  this.media.removeEventListener("webkitbeginfullscreen", this._onWebkitbeginfullscreen);
4777
4801
  this.media.removeEventListener("webkitendfullscreen", this._onWebkitendfullscreen);
4778
4802
  }
4803
+ }, {
4804
+ key: "_clearUserTimer",
4805
+ value: function _clearUserTimer() {
4806
+ if (!this.userTimer) {
4807
+ return;
4808
+ }
4809
+ util.clearTimeout(this, this.userTimer);
4810
+ this.userTimer = null;
4811
+ }
4779
4812
  }, {
4780
4813
  key: "_startInit",
4781
4814
  value: function _startInit(url) {
@@ -4791,13 +4824,15 @@ var __publicField = (obj, key, value) => {
4791
4824
  return;
4792
4825
  }
4793
4826
  }
4794
- this._detachSourceEvents(this.media);
4795
- if (util.typeOf(url) === "Array" && url.length > 0) {
4796
- this._attachSourceEvents(this.media, url);
4797
- } else if (!this.media.src || this.media.src !== url) {
4798
- this.media.src = url;
4799
- } else if (!url) {
4800
- this.media.removeAttribute("src");
4827
+ if (this.handleSource) {
4828
+ this._detachSourceEvents(this.media);
4829
+ if (util.typeOf(url) === "Array" && url.length > 0) {
4830
+ this._attachSourceEvents(this.media, url);
4831
+ } else if (!this.media.src || this.media.src !== url) {
4832
+ this.media.src = url;
4833
+ } else if (!url) {
4834
+ this.media.removeAttribute("src");
4835
+ }
4801
4836
  }
4802
4837
  if (util.typeOf(this.config.volume) === "Number") {
4803
4838
  this.volume = this.config.volume;
@@ -5040,7 +5075,7 @@ var __publicField = (obj, key, value) => {
5040
5075
  if (!url) {
5041
5076
  url = _this8.url || _this8.config.url;
5042
5077
  }
5043
- var _furl = _this8.preProcessUrl(url);
5078
+ var _furl = _this8._preProcessUrl(url);
5044
5079
  var ret = _this8._startInit(_furl.url);
5045
5080
  return ret;
5046
5081
  }).catch(function(e) {
@@ -5058,7 +5093,7 @@ var __publicField = (obj, key, value) => {
5058
5093
  if (util.typeOf(url) === "Object") {
5059
5094
  _src = url.url;
5060
5095
  }
5061
- _src = this.preProcessUrl(_src).url;
5096
+ _src = this._preProcessUrl(_src).url;
5062
5097
  var curTime = this.currentTime;
5063
5098
  this.__startTime = curTime;
5064
5099
  var isPaused = this.paused && !this.isError;
@@ -5288,8 +5323,8 @@ var __publicField = (obj, key, value) => {
5288
5323
  key: "resetState",
5289
5324
  value: function resetState() {
5290
5325
  var _this16 = this;
5291
- 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, LOADING = STATE_CLASS.LOADING;
5292
- var clsList = [NOT_ALLOW_AUTOPLAY, PLAYING2, NO_START, PAUSED, REPLAY2, ENTER, ENDED2, ERROR2, LOADING];
5326
+ 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;
5327
+ var clsList = [NOT_ALLOW_AUTOPLAY, PLAYING2, NO_START, PAUSED, REPLAY2, ENTER, ENDED2, ERROR2, LOADING2];
5293
5328
  this.hasStart = false;
5294
5329
  this.isError = false;
5295
5330
  this._useAutoplay = false;
@@ -5389,7 +5424,6 @@ var __publicField = (obj, key, value) => {
5389
5424
  });
5390
5425
  }
5391
5426
  });
5392
- _this19.play();
5393
5427
  _this19.emit(REPLAY);
5394
5428
  _this19.onPlay();
5395
5429
  });
@@ -5403,7 +5437,7 @@ var __publicField = (obj, key, value) => {
5403
5437
  runHooks(this, "retry", function() {
5404
5438
  var cur = _this20.currentTime;
5405
5439
  var url = _this20.config.url;
5406
- var _srcRet = !util.isMSE(_this20.media) ? _this20.preProcessUrl(url) : {
5440
+ var _srcRet = !util.isMSE(_this20.media) ? _this20._preProcessUrl(url) : {
5407
5441
  url
5408
5442
  };
5409
5443
  _this20.src = _srcRet.url;
@@ -5631,6 +5665,7 @@ var __publicField = (obj, key, value) => {
5631
5665
  this.onBlur(data);
5632
5666
  return;
5633
5667
  }
5668
+ this._clearUserTimer();
5634
5669
  this.emit(PLAYER_BLUR, _objectSpread2({
5635
5670
  paused: this.paused,
5636
5671
  ended: this.ended
@@ -5647,18 +5682,12 @@ var __publicField = (obj, key, value) => {
5647
5682
  var innerStates = this.innerStates;
5648
5683
  this.isActive = true;
5649
5684
  this.removeClass(STATE_CLASS.INACTIVE);
5650
- if (this.userTimer) {
5651
- util.clearTimeout(this, this.userTimer);
5652
- this.userTimer = null;
5653
- }
5685
+ this._clearUserTimer();
5654
5686
  if (data.isLock !== void 0) {
5655
5687
  innerStates.isActiveLocked = data.isLock;
5656
5688
  }
5657
5689
  if (data.autoHide === false || data.isLock === true || innerStates.isActiveLocked) {
5658
- if (this.userTimer) {
5659
- util.clearTimeout(this, this.userTimer);
5660
- this.userTimer = null;
5661
- }
5690
+ this._clearUserTimer();
5662
5691
  return;
5663
5692
  }
5664
5693
  var time = data && data.delay ? data.delay : this.config.inactive;
@@ -5671,7 +5700,7 @@ var __publicField = (obj, key, value) => {
5671
5700
  key: "onBlur",
5672
5701
  value: function onBlur() {
5673
5702
  var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref$ignorePaused = _ref.ignorePaused, ignorePaused = _ref$ignorePaused === void 0 ? false : _ref$ignorePaused;
5674
- if (!this.isActive || this.innerStates.isActiveLocked) {
5703
+ if (this.innerStates.isActiveLocked) {
5675
5704
  return;
5676
5705
  }
5677
5706
  var closePauseVideoFocus = this.config.closePauseVideoFocus;
@@ -5730,10 +5759,7 @@ var __publicField = (obj, key, value) => {
5730
5759
  this.addClass(STATE_CLASS.PAUSED);
5731
5760
  this.updateAcc("pause");
5732
5761
  if (!this.config.closePauseVideoFocus) {
5733
- if (this.userTimer) {
5734
- util.clearTimeout(this, this.userTimer);
5735
- this.userTimer = null;
5736
- }
5762
+ this._clearUserTimer();
5737
5763
  this.focus();
5738
5764
  }
5739
5765
  }
@@ -5784,6 +5810,7 @@ var __publicField = (obj, key, value) => {
5784
5810
  this.updateAcc("waiting");
5785
5811
  this.waitTimer = util.setTimeout(this, function() {
5786
5812
  _this22.addClass(STATE_CLASS.LOADING);
5813
+ _this22.emit(LOADING);
5787
5814
  util.clearTimeout(_this22, _this22.waitTimer);
5788
5815
  _this22.waitTimer = null;
5789
5816
  }, this.config.minWaitDelay);
@@ -5793,8 +5820,8 @@ var __publicField = (obj, key, value) => {
5793
5820
  value: function onPlaying() {
5794
5821
  var _this23 = this;
5795
5822
  this.isError = false;
5796
- var NO_START = STATE_CLASS.NO_START, PAUSED = STATE_CLASS.PAUSED, ENDED2 = STATE_CLASS.ENDED, ERROR2 = STATE_CLASS.ERROR, REPLAY2 = STATE_CLASS.REPLAY, LOADING = STATE_CLASS.LOADING;
5797
- var clsList = [NO_START, PAUSED, ENDED2, ERROR2, REPLAY2, LOADING];
5823
+ 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;
5824
+ var clsList = [NO_START, PAUSED, ENDED2, ERROR2, REPLAY2, LOADING2];
5798
5825
  clsList.forEach(function(cls) {
5799
5826
  _this23.removeClass(cls);
5800
5827
  });
@@ -5863,6 +5890,11 @@ var __publicField = (obj, key, value) => {
5863
5890
  }, {
5864
5891
  key: "checkBuffer",
5865
5892
  value: function checkBuffer(time) {
5893
+ var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
5894
+ startDiff: 0,
5895
+ endDiff: 0
5896
+ };
5897
+ var _ref2 = options || {}, _ref2$startDiff = _ref2.startDiff, startDiff = _ref2$startDiff === void 0 ? 0 : _ref2$startDiff, _ref2$endDiff = _ref2.endDiff, endDiff = _ref2$endDiff === void 0 ? 0 : _ref2$endDiff;
5866
5898
  var buffered = this.media.buffered;
5867
5899
  if (!buffered || buffered.length === 0 || !this.duration) {
5868
5900
  return true;
@@ -5870,7 +5902,7 @@ var __publicField = (obj, key, value) => {
5870
5902
  var currentTime = time || this.media.currentTime || 0.2;
5871
5903
  var len = buffered.length;
5872
5904
  for (var i = 0; i < len; i++) {
5873
- if (buffered.start(i) <= currentTime && buffered.end(i) > currentTime) {
5905
+ if (buffered.start(i) + startDiff <= currentTime && buffered.end(i) - endDiff > currentTime) {
5874
5906
  return true;
5875
5907
  }
5876
5908
  }
@@ -6056,10 +6088,10 @@ var __publicField = (obj, key, value) => {
6056
6088
  this._state = newState;
6057
6089
  }
6058
6090
  }, {
6059
- key: "preProcessUrl",
6060
- value: function preProcessUrl(url, ext) {
6061
- var preProcessUrl2 = this.config.preProcessUrl;
6062
- return !util.isBlob(url) && preProcessUrl2 && typeof preProcessUrl2 === "function" ? preProcessUrl2(url, ext) : {
6091
+ key: "_preProcessUrl",
6092
+ value: function _preProcessUrl(url, ext) {
6093
+ var preProcessUrl = this.config.preProcessUrl;
6094
+ return !util.isBlob(url) && typeof preProcessUrl === "function" ? preProcessUrl(url, ext) : {
6063
6095
  url
6064
6096
  };
6065
6097
  }
@@ -6325,13 +6357,15 @@ var __publicField = (obj, key, value) => {
6325
6357
  }
6326
6358
  }, {
6327
6359
  key: "setUserActive",
6328
- value: function setUserActive(isActive) {
6329
- var isMuted = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
6360
+ value: function setUserActive(isActive, isMuted) {
6361
+ var _instManager3;
6330
6362
  if (typeof isMuted === "boolean" && isMuted !== this.muted) {
6331
6363
  this.addInnerOP("volumechange");
6332
- this.muted = isMuted;
6364
+ if (util.typeOf(isMuted) === Boolean) {
6365
+ this.muted = isMuted;
6366
+ }
6333
6367
  }
6334
- pluginsManager.setCurrentUserActive(this.playerId, isActive);
6368
+ (_instManager3 = instManager) === null || _instManager3 === void 0 ? void 0 : _instManager3.setActive(this.playerId, isActive);
6335
6369
  }
6336
6370
  }], [{
6337
6371
  key: "debugger",
@@ -6352,14 +6386,14 @@ var __publicField = (obj, key, value) => {
6352
6386
  }, {
6353
6387
  key: "getCurrentUserActivePlayerId",
6354
6388
  value: function getCurrentUserActivePlayerId() {
6355
- var _instManager3;
6356
- return (_instManager3 = instManager) === null || _instManager3 === void 0 ? void 0 : _instManager3.getActiveId();
6389
+ var _instManager4;
6390
+ return (_instManager4 = instManager) === null || _instManager4 === void 0 ? void 0 : _instManager4.getActiveId();
6357
6391
  }
6358
6392
  }, {
6359
6393
  key: "setCurrentUserActive",
6360
6394
  value: function setCurrentUserActive(playerId, isActive) {
6361
- var _instManager4;
6362
- (_instManager4 = instManager) === null || _instManager4 === void 0 ? void 0 : _instManager4.setActive(playerId, isActive);
6395
+ var _instManager5;
6396
+ (_instManager5 = instManager) === null || _instManager5 === void 0 ? void 0 : _instManager5.setActive(playerId, isActive);
6363
6397
  }
6364
6398
  }, {
6365
6399
  key: "isHevcSupported",
@@ -6752,8 +6786,8 @@ var __publicField = (obj, key, value) => {
6752
6786
  case "cover":
6753
6787
  _bg = "cover";
6754
6788
  break;
6755
- case "container":
6756
- _bg = "container";
6789
+ case "contain":
6790
+ _bg = "contain";
6757
6791
  break;
6758
6792
  case "fixHeight":
6759
6793
  _bg = "auto 100%";
@@ -7796,6 +7830,7 @@ var __publicField = (obj, key, value) => {
7796
7830
  } else {
7797
7831
  player.focus();
7798
7832
  }
7833
+ _this.emit(ENTER_PLAYER);
7799
7834
  });
7800
7835
  _defineProperty(_assertThisInitialized(_this), "onMouseLeave", function(e) {
7801
7836
  var _this$playerConfig = _this.playerConfig, closePlayerBlur = _this$playerConfig.closePlayerBlur, leavePlayerTime = _this$playerConfig.leavePlayerTime, closeDelayBlur = _this$playerConfig.closeDelayBlur;
@@ -7806,9 +7841,12 @@ var __publicField = (obj, key, value) => {
7806
7841
  delay: leavePlayerTime
7807
7842
  });
7808
7843
  } else {
7809
- _this.player.blur();
7844
+ _this.player.blur({
7845
+ ignorePaused: true
7846
+ });
7810
7847
  }
7811
7848
  }
7849
+ _this.emit(LEAVE_PLAYER);
7812
7850
  });
7813
7851
  _defineProperty(_assertThisInitialized(_this), "onVideoClick", function(e) {
7814
7852
  var _assertThisInitialize3 = _assertThisInitialized(_this), player = _assertThisInitialize3.player, playerConfig = _assertThisInitialize3.playerConfig;
@@ -8187,6 +8225,7 @@ var __publicField = (obj, key, value) => {
8187
8225
  var touche = _this.getTouche(e);
8188
8226
  if (touche && !config.disableGesture && _this.duration > 0 && !player.ended) {
8189
8227
  pos.isStart = true;
8228
+ _this.timer && clearTimeout(_this.timer);
8190
8229
  util.checkIsFunction(playerConfig.disableSwipeHandler) && playerConfig.disableSwipeHandler();
8191
8230
  _this.find(".xg-dur").innerHTML = util.format(_this.duration);
8192
8231
  var rect = _this.root.getBoundingClientRect();
@@ -8247,6 +8286,9 @@ var __publicField = (obj, key, value) => {
8247
8286
  });
8248
8287
  _defineProperty(_assertThisInitialized(_this), "onTouchEnd", function(e) {
8249
8288
  var _assertThisInitialize3 = _assertThisInitialized(_this), player = _assertThisInitialize3.player, pos = _assertThisInitialize3.pos, playerConfig = _assertThisInitialize3.playerConfig;
8289
+ setTimeout(function() {
8290
+ player.getPlugin("progress") && player.getPlugin("progress").resetSeekState();
8291
+ }, 10);
8250
8292
  if (!pos.isStart) {
8251
8293
  return;
8252
8294
  }
@@ -8256,9 +8298,6 @@ var __publicField = (obj, key, value) => {
8256
8298
  var _this$config = _this.config, disableGesture = _this$config.disableGesture, gestureX = _this$config.gestureX;
8257
8299
  if (!disableGesture && gestureX) {
8258
8300
  _this.endLastMove(pos.scope);
8259
- setTimeout(function() {
8260
- player.getPlugin("progress") && player.getPlugin("progress").resetSeekState();
8261
- }, 10);
8262
8301
  } else {
8263
8302
  pos.time = 0;
8264
8303
  }
@@ -8387,8 +8426,10 @@ var __publicField = (obj, key, value) => {
8387
8426
  progressPlugin.addCallBack("dragmove", function(data) {
8388
8427
  _this2.activeSeekNote(data.currentTime, data.forward);
8389
8428
  });
8390
- progressPlugin.addCallBack("dragend", function() {
8391
- _this2.changeAction(ACTIONS.AUTO);
8429
+ ["dragend", "click"].forEach(function(key) {
8430
+ progressPlugin.addCallBack(key, function() {
8431
+ _this2.changeAction(ACTIONS.AUTO);
8432
+ });
8392
8433
  });
8393
8434
  }
8394
8435
  }
@@ -8408,15 +8449,23 @@ var __publicField = (obj, key, value) => {
8408
8449
  key: "initCustomStyle",
8409
8450
  value: function initCustomStyle() {
8410
8451
  var _ref = this.playerConfig || {}, commonStyle = _ref.commonStyle;
8411
- var playedColor = commonStyle.playedColor, progressColor = commonStyle.progressColor;
8452
+ var playedColor = commonStyle.playedColor, progressColor = commonStyle.progressColor, timePreviewStyle = commonStyle.timePreviewStyle, curTimeColor = commonStyle.curTimeColor, durationColor = commonStyle.durationColor;
8412
8453
  if (playedColor) {
8413
8454
  this.find(".xg-curbar").style.backgroundColor = playedColor;
8414
- this.find(".xg-cur").style.color = playedColor;
8415
8455
  }
8416
8456
  if (progressColor) {
8417
8457
  this.find(".xg-bar").style.backgroundColor = progressColor;
8418
- this.find(".time-preview").style.color = progressColor;
8419
8458
  }
8459
+ if (timePreviewStyle) {
8460
+ var previewDom = this.find(".time-preview");
8461
+ Object.keys(timePreviewStyle).forEach(function(key) {
8462
+ previewDom.style[key] = timePreviewStyle[key];
8463
+ });
8464
+ }
8465
+ var curColor = curTimeColor || playedColor;
8466
+ var durColor = durationColor;
8467
+ curColor && (this.find(".xg-cur").style.color = curColor);
8468
+ durColor && (this.find(".xg-dur").style.color = durColor);
8420
8469
  this.config.disableTimeProgress && util.addClass(this.find(".xg-timebar"), "hide");
8421
8470
  }
8422
8471
  }, {
@@ -8749,7 +8798,7 @@ var __publicField = (obj, key, value) => {
8749
8798
  key: "render",
8750
8799
  value: function render() {
8751
8800
  var className = this.config.gradient !== "normal" ? "gradient ".concat(this.config.gradient) : "gradient";
8752
- return '\n <xg-trigger class="trigger">\n <div class="'.concat(className, '"></div>\n <div class="time-preview">\n <div class="xg-seek-show ').concat(this.config.disableSeekIcon ? " hide-seek-icon" : "", '">\n <i class="xg-seek-icon"></i>\n <span class="xg-cur">00:00</span>\n <span>/</span>\n <span class="xg-dur">00:00</span>\n </div>\n <div class="xg-bar xg-timebar">\n <div class="xg-curbar"></div>\n </div>\n </div>\n <div class="xg-playbackrate xg-top-note">\n <span><i>').concat(this.config.pressRate, "X</i>").concat(this.i18n.FORWARD, "</span>\n </div>\n </xg-trigger>\n ");
8801
+ return '\n <xg-trigger class="trigger">\n <div class="'.concat(className, '"></div>\n <div class="time-preview">\n <div class="xg-seek-show ').concat(this.config.disableSeekIcon ? " hide-seek-icon" : "", '">\n <i class="xg-seek-icon"></i>\n <span class="xg-cur">00:00</span>\n <span class="xg-separator">/</span>\n <span class="xg-dur">00:00</span>\n </div>\n <div class="xg-bar xg-timebar">\n <div class="xg-curbar"></div>\n </div>\n </div>\n <div class="xg-playbackrate xg-top-note">\n <span><i>').concat(this.config.pressRate, "X</i>").concat(this.i18n.FORWARD, "</span>\n </div>\n </xg-trigger>\n ");
8753
8802
  }
8754
8803
  }], [{
8755
8804
  key: "pluginName",
@@ -8943,6 +8992,14 @@ var __publicField = (obj, key, value) => {
8943
8992
  this.player.root.addEventListener("keydown", this.onKeydown);
8944
8993
  document.addEventListener("keydown", this.onBodyKeyDown);
8945
8994
  }
8995
+ }, {
8996
+ key: "setConfig",
8997
+ value: function setConfig(newConfig) {
8998
+ var _this3 = this;
8999
+ Object.keys(newConfig).forEach(function(key) {
9000
+ _this3.config[key] = newConfig[key];
9001
+ });
9002
+ }
8946
9003
  }, {
8947
9004
  key: "checkIsVisible",
8948
9005
  value: function checkIsVisible() {
@@ -8960,11 +9017,11 @@ var __publicField = (obj, key, value) => {
8960
9017
  }, {
8961
9018
  key: "checkCode",
8962
9019
  value: function checkCode(code, isBodyTarget) {
8963
- var _this3 = this;
9020
+ var _this4 = this;
8964
9021
  var flag = false;
8965
9022
  Object.keys(this.keyCodeMap).map(function(key) {
8966
- if (_this3.keyCodeMap[key] && code === _this3.keyCodeMap[key].keyCode && !_this3.keyCodeMap[key].disable) {
8967
- flag = !isBodyTarget || isBodyTarget && !_this3.keyCodeMap[key].noBodyTarget;
9023
+ if (_this4.keyCodeMap[key] && code === _this4.keyCodeMap[key].keyCode && !_this4.keyCodeMap[key].disable) {
9024
+ flag = !isBodyTarget || isBodyTarget && !_this4.keyCodeMap[key].noBodyTarget;
8968
9025
  }
8969
9026
  });
8970
9027
  return flag;
@@ -9155,6 +9212,7 @@ var __publicField = (obj, key, value) => {
9155
9212
  }, this.keyCodeMap[arr[i]]));
9156
9213
  }
9157
9214
  preventDefault(event);
9215
+ event.stopPropagation();
9158
9216
  break;
9159
9217
  }
9160
9218
  }
@@ -9269,6 +9327,9 @@ var __publicField = (obj, key, value) => {
9269
9327
  value: function afterCreate() {
9270
9328
  this.bind("mouseenter", this._onMouseenter);
9271
9329
  this.bind("mouseleave", this._onMouseLeave);
9330
+ if (this.config.disable) {
9331
+ this.disable();
9332
+ }
9272
9333
  }
9273
9334
  }, {
9274
9335
  key: "destroy",
@@ -9600,9 +9661,15 @@ var __publicField = (obj, key, value) => {
9600
9661
  } else {
9601
9662
  if (player.fullscreen) {
9602
9663
  player.exitFullscreen();
9664
+ if (config.useScreenOrientation) {
9665
+ this.unlockScreen();
9666
+ }
9603
9667
  } else {
9604
9668
  player.getFullscreen().catch(function(e2) {
9605
9669
  });
9670
+ if (config.useScreenOrientation && player.aspectRatio > 1) {
9671
+ this.lockScreen(config.lockOrientationType);
9672
+ }
9606
9673
  }
9607
9674
  }
9608
9675
  }
@@ -9629,6 +9696,24 @@ var __publicField = (obj, key, value) => {
9629
9696
  var langKey = "FULLSCREEN_TIPS";
9630
9697
  return '<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n '.concat(xgIconTips(this, langKey, this.playerConfig.isHideTips), "\n </xg-icon>");
9631
9698
  }
9699
+ }, {
9700
+ key: "lockScreen",
9701
+ value: function lockScreen(orientation) {
9702
+ try {
9703
+ screen.orientation.lock(orientation).catch(function(e) {
9704
+ });
9705
+ } catch (e) {
9706
+ }
9707
+ }
9708
+ }, {
9709
+ key: "unlockScreen",
9710
+ value: function unlockScreen() {
9711
+ try {
9712
+ screen.orientation.unlock().catch(function(e) {
9713
+ });
9714
+ } catch (e) {
9715
+ }
9716
+ }
9632
9717
  }], [{
9633
9718
  key: "pluginName",
9634
9719
  get: function get() {
@@ -9642,6 +9727,8 @@ var __publicField = (obj, key, value) => {
9642
9727
  index: 0,
9643
9728
  useCssFullscreen: false,
9644
9729
  rotateFullscreen: false,
9730
+ useScreenOrientation: false,
9731
+ lockOrientationType: "landscape",
9645
9732
  switchCallback: null,
9646
9733
  target: null,
9647
9734
  disable: false,
@@ -10428,7 +10515,10 @@ var __publicField = (obj, key, value) => {
10428
10515
  AUTOPLAY_FAIL: "autoplayFail",
10429
10516
  AUTOPLAY_SUCCESS: "autoplaySuccess",
10430
10517
  ERROR_REFRESH_CLICK: "errorRefreshClick",
10431
- SOURCE_CHANGE: "sourceChange"
10518
+ SOURCE_CHANGE: "sourceChange",
10519
+ SWITCH_DEFINITION_START: "switchDefinitionStart",
10520
+ SWITCH_DEFINITION_SUCCESS: "switchDefinitionSuccess",
10521
+ DOWN_DEFINITION: "downDefinition"
10432
10522
  };
10433
10523
  const Events = {
10434
10524
  ...XGEvents,
@@ -10474,6 +10564,15 @@ var __publicField = (obj, key, value) => {
10474
10564
  },
10475
10565
  [BaseEvents.DOWNLOAD_SPEED_CHANGE]: {
10476
10566
  event: DOWNLOAD_SPEED_CHANGE
10567
+ },
10568
+ [BaseEvents.SWITCH_DEFINITION_START]: {
10569
+ event: "switch_definition_start"
10570
+ },
10571
+ [BaseEvents.SWITCH_DEFINITION_SUCCESS]: {
10572
+ event: "switch_definition_success"
10573
+ },
10574
+ [BaseEvents.DOWN_DEFINITION]: {
10575
+ event: "down_definition"
10477
10576
  }
10478
10577
  };
10479
10578
  function transform(event, callback) {
@@ -12373,7 +12472,8 @@ var __publicField = (obj, key, value) => {
12373
12472
  "plugin:shaka": "veplayer.plugin.shaka.[env].[ext]",
12374
12473
  "plugin:rtm": "veplayer.plugin.rtm.[env].[ext]",
12375
12474
  "plugin:xgvideo": "veplayer.plugin.xgvideo.[env].[ext]",
12376
- "plugin:drm": "veplayer.plugin.drm.[env].[ext]"
12475
+ "plugin:drm": "veplayer.plugin.drm.[env].[ext]",
12476
+ "plugin:abr": "veplayer.plugin.abr.[env].[ext]"
12377
12477
  };
12378
12478
  var DynamicModule = /* @__PURE__ */ ((DynamicModule2) => {
12379
12479
  DynamicModule2["BizVod"] = "biz:vod";
@@ -12385,6 +12485,7 @@ var __publicField = (obj, key, value) => {
12385
12485
  DynamicModule2["PluginRtm"] = "plugin:rtm";
12386
12486
  DynamicModule2["PluginXgvideo"] = "plugin:xgvideo";
12387
12487
  DynamicModule2["PluginDrm"] = "plugin:drm";
12488
+ DynamicModule2["PluginAbr"] = "plugin:abr";
12388
12489
  return DynamicModule2;
12389
12490
  })(DynamicModule || {});
12390
12491
  class Loader {
@@ -13644,7 +13745,7 @@ var __publicField = (obj, key, value) => {
13644
13745
  * @param callback 表示事件的回调函数。
13645
13746
  */
13646
13747
  /** {en}
13647
- * @brief Listens for a specified event. The event handler is executed only once.
13748
+ * @brief Add a one-time listener function for the specified event.
13648
13749
  * @param event The event name.
13649
13750
  * @param callback The callback function for the event.
13650
13751
  */