@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.
- package/esm/index.d.ts +73 -3
- package/esm/veplayer.biz.live.development.js +92 -21
- package/esm/veplayer.biz.live.production.js +1 -1
- package/esm/veplayer.d.ts +290 -5
- package/esm/veplayer.development.css +1 -1
- package/esm/veplayer.development.js +217 -75
- package/esm/veplayer.live.d.ts +290 -5
- package/esm/veplayer.live.development.css +1 -1
- package/esm/veplayer.live.development.js +217 -75
- package/esm/veplayer.live.production.css +1 -1
- package/esm/veplayer.live.production.js +3 -3
- package/esm/veplayer.production.css +1 -1
- package/esm/veplayer.production.js +3 -3
- package/esm/veplayer.vod.d.ts +73 -3
- package/esm/veplayer.vod.development.css +1 -1
- package/esm/veplayer.vod.development.js +169 -68
- package/esm/veplayer.vod.production.css +1 -1
- package/esm/veplayer.vod.production.js +2 -2
- package/package.json +1 -1
- package/umd/index.d.ts +73 -3
- package/umd/veplayer.biz.live.development.js +92 -21
- package/umd/veplayer.biz.live.production.js +1 -1
- package/umd/veplayer.d.ts +290 -5
- package/umd/veplayer.development.css +1 -1
- package/umd/veplayer.development.js +217 -75
- package/umd/veplayer.live.d.ts +290 -5
- package/umd/veplayer.live.development.css +1 -1
- package/umd/veplayer.live.development.js +217 -75
- package/umd/veplayer.live.production.css +1 -1
- package/umd/veplayer.live.production.js +1 -1
- package/umd/veplayer.production.css +1 -1
- package/umd/veplayer.production.js +1 -1
- package/umd/veplayer.vod.d.ts +73 -3
- package/umd/veplayer.vod.development.css +1 -1
- package/umd/veplayer.vod.development.js +169 -68
- package/umd/veplayer.vod.production.css +1 -1
- package/umd/veplayer.vod.production.js +1 -1
- package/veplayer.d.ts +290 -5
- package/veplayer.live.d.ts +290 -5
- package/veplayer.vod.d.ts +73 -3
|
@@ -1005,6 +1005,9 @@ util.cancelAnimationFrame = function(frameId) {
|
|
|
1005
1005
|
_fun && _fun(frameId);
|
|
1006
1006
|
};
|
|
1007
1007
|
util.isMSE = function(video) {
|
|
1008
|
+
if (video.media) {
|
|
1009
|
+
video = video.media;
|
|
1010
|
+
}
|
|
1008
1011
|
if (!video || !(video instanceof HTMLMediaElement)) {
|
|
1009
1012
|
return false;
|
|
1010
1013
|
}
|
|
@@ -1449,7 +1452,7 @@ var sniffer = {
|
|
|
1449
1452
|
}
|
|
1450
1453
|
}
|
|
1451
1454
|
};
|
|
1452
|
-
var version = "3.0.
|
|
1455
|
+
var version = "3.0.17";
|
|
1453
1456
|
var ERROR_TYPE_MAP = {
|
|
1454
1457
|
1: "media",
|
|
1455
1458
|
2: "media",
|
|
@@ -1555,6 +1558,9 @@ var REPLAY = "replay";
|
|
|
1555
1558
|
var DESTROY = "destroy";
|
|
1556
1559
|
var URL_CHANGE = "urlchange";
|
|
1557
1560
|
var DOWNLOAD_SPEED_CHANGE = "download_speed_change";
|
|
1561
|
+
var LEAVE_PLAYER = "leaveplayer";
|
|
1562
|
+
var ENTER_PLAYER = "enterplayer";
|
|
1563
|
+
var LOADING = "loading";
|
|
1558
1564
|
var FULLSCREEN_CHANGE = "fullscreen_change";
|
|
1559
1565
|
var CSS_FULLSCREEN_CHANGE = "cssFullscreen_change";
|
|
1560
1566
|
var MINI_STATE_CHANGE = "mini_state_change";
|
|
@@ -1600,11 +1606,14 @@ var XGEvents = /* @__PURE__ */ Object.freeze({
|
|
|
1600
1606
|
DURATION_CHANGE,
|
|
1601
1607
|
EMPTIED,
|
|
1602
1608
|
ENDED,
|
|
1609
|
+
ENTER_PLAYER,
|
|
1603
1610
|
ERROR,
|
|
1604
1611
|
FPS_STUCK,
|
|
1605
1612
|
FULLSCREEN_CHANGE,
|
|
1613
|
+
LEAVE_PLAYER,
|
|
1606
1614
|
LOADED_DATA,
|
|
1607
1615
|
LOADED_METADATA,
|
|
1616
|
+
LOADING,
|
|
1608
1617
|
LOAD_START,
|
|
1609
1618
|
MINI_STATE_CHANGE,
|
|
1610
1619
|
PAUSE,
|
|
@@ -2204,6 +2213,11 @@ var MediaProxy = /* @__PURE__ */ function(_EventEmitter) {
|
|
|
2204
2213
|
}
|
|
2205
2214
|
this.media.volume = vol;
|
|
2206
2215
|
}
|
|
2216
|
+
}, {
|
|
2217
|
+
key: "aspectRatio",
|
|
2218
|
+
get: function get() {
|
|
2219
|
+
return this.media ? this.media.videoWidth / this.media.videoHeight : 0;
|
|
2220
|
+
}
|
|
2207
2221
|
}, {
|
|
2208
2222
|
key: "addInnerOP",
|
|
2209
2223
|
value: function addInnerOP(event) {
|
|
@@ -2829,6 +2843,10 @@ var POSITIONS$1 = {
|
|
|
2829
2843
|
CONTROLS_CENTER: "controlsCenter",
|
|
2830
2844
|
CONTROLS: "controls"
|
|
2831
2845
|
};
|
|
2846
|
+
var PLUGIN_STATE_CLASS = {
|
|
2847
|
+
ICON_DISABLE: "xg-icon-disable",
|
|
2848
|
+
ICON_HIDE: "xg-icon-hide"
|
|
2849
|
+
};
|
|
2832
2850
|
function isUrl(str) {
|
|
2833
2851
|
if (!str) {
|
|
2834
2852
|
return false;
|
|
@@ -3062,6 +3080,18 @@ var Plugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
3062
3080
|
value: function plugins() {
|
|
3063
3081
|
return this._children;
|
|
3064
3082
|
}
|
|
3083
|
+
}, {
|
|
3084
|
+
key: "disable",
|
|
3085
|
+
value: function disable() {
|
|
3086
|
+
this.config.disable = true;
|
|
3087
|
+
util.addClass(this.find(".xgplayer-icon"), PLUGIN_STATE_CLASS.ICON_DISABLE);
|
|
3088
|
+
}
|
|
3089
|
+
}, {
|
|
3090
|
+
key: "enable",
|
|
3091
|
+
value: function enable() {
|
|
3092
|
+
this.config.disable = false;
|
|
3093
|
+
util.removeClass(this.find(".xgplayer-icon"), PLUGIN_STATE_CLASS.ICON_DISABLE);
|
|
3094
|
+
}
|
|
3065
3095
|
}, {
|
|
3066
3096
|
key: "children",
|
|
3067
3097
|
value: function children() {
|
|
@@ -3208,7 +3238,7 @@ var Plugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
3208
3238
|
var cs = window.getComputedStyle(this.root, null);
|
|
3209
3239
|
var cssDisplayValue = cs.getPropertyValue("display");
|
|
3210
3240
|
if (cssDisplayValue === "none") {
|
|
3211
|
-
this.root.style.display = "block";
|
|
3241
|
+
return this.root.style.display = "block";
|
|
3212
3242
|
}
|
|
3213
3243
|
}
|
|
3214
3244
|
}, {
|
|
@@ -3754,15 +3784,8 @@ var pluginsManager = {
|
|
|
3754
3784
|
var item = _Object$keys[_i];
|
|
3755
3785
|
this.unRegister(cgid, item);
|
|
3756
3786
|
}
|
|
3757
|
-
var _isUseActive = player.isUseActive;
|
|
3758
3787
|
delete this.pluginGroup[cgid];
|
|
3759
3788
|
delete player._pluginInfoId;
|
|
3760
|
-
if (_isUseActive) {
|
|
3761
|
-
var keys = Object.keys(this.pluginGroup);
|
|
3762
|
-
if (keys.length > 0) {
|
|
3763
|
-
this.setCurrentUserActive(keys[keys.length - 1], true);
|
|
3764
|
-
}
|
|
3765
|
-
}
|
|
3766
3789
|
}
|
|
3767
3790
|
};
|
|
3768
3791
|
var STATE_CLASS = {
|
|
@@ -4544,6 +4567,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4544
4567
|
}
|
|
4545
4568
|
_this.userTimer = null;
|
|
4546
4569
|
_this.waitTimer = null;
|
|
4570
|
+
_this.handleSource = true;
|
|
4547
4571
|
_this._state = STATES.INITIAL;
|
|
4548
4572
|
_this.isError = false;
|
|
4549
4573
|
_this._hasStart = false;
|
|
@@ -4772,6 +4796,15 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4772
4796
|
this.media.removeEventListener("webkitbeginfullscreen", this._onWebkitbeginfullscreen);
|
|
4773
4797
|
this.media.removeEventListener("webkitendfullscreen", this._onWebkitendfullscreen);
|
|
4774
4798
|
}
|
|
4799
|
+
}, {
|
|
4800
|
+
key: "_clearUserTimer",
|
|
4801
|
+
value: function _clearUserTimer() {
|
|
4802
|
+
if (!this.userTimer) {
|
|
4803
|
+
return;
|
|
4804
|
+
}
|
|
4805
|
+
util.clearTimeout(this, this.userTimer);
|
|
4806
|
+
this.userTimer = null;
|
|
4807
|
+
}
|
|
4775
4808
|
}, {
|
|
4776
4809
|
key: "_startInit",
|
|
4777
4810
|
value: function _startInit(url) {
|
|
@@ -4787,13 +4820,15 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4787
4820
|
return;
|
|
4788
4821
|
}
|
|
4789
4822
|
}
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
this.media.src
|
|
4795
|
-
|
|
4796
|
-
|
|
4823
|
+
if (this.handleSource) {
|
|
4824
|
+
this._detachSourceEvents(this.media);
|
|
4825
|
+
if (util.typeOf(url) === "Array" && url.length > 0) {
|
|
4826
|
+
this._attachSourceEvents(this.media, url);
|
|
4827
|
+
} else if (!this.media.src || this.media.src !== url) {
|
|
4828
|
+
this.media.src = url;
|
|
4829
|
+
} else if (!url) {
|
|
4830
|
+
this.media.removeAttribute("src");
|
|
4831
|
+
}
|
|
4797
4832
|
}
|
|
4798
4833
|
if (util.typeOf(this.config.volume) === "Number") {
|
|
4799
4834
|
this.volume = this.config.volume;
|
|
@@ -5036,7 +5071,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5036
5071
|
if (!url) {
|
|
5037
5072
|
url = _this8.url || _this8.config.url;
|
|
5038
5073
|
}
|
|
5039
|
-
var _furl = _this8.
|
|
5074
|
+
var _furl = _this8._preProcessUrl(url);
|
|
5040
5075
|
var ret = _this8._startInit(_furl.url);
|
|
5041
5076
|
return ret;
|
|
5042
5077
|
}).catch(function(e) {
|
|
@@ -5054,7 +5089,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5054
5089
|
if (util.typeOf(url) === "Object") {
|
|
5055
5090
|
_src = url.url;
|
|
5056
5091
|
}
|
|
5057
|
-
_src = this.
|
|
5092
|
+
_src = this._preProcessUrl(_src).url;
|
|
5058
5093
|
var curTime = this.currentTime;
|
|
5059
5094
|
this.__startTime = curTime;
|
|
5060
5095
|
var isPaused = this.paused && !this.isError;
|
|
@@ -5284,8 +5319,8 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5284
5319
|
key: "resetState",
|
|
5285
5320
|
value: function resetState() {
|
|
5286
5321
|
var _this16 = this;
|
|
5287
|
-
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,
|
|
5288
|
-
var clsList = [NOT_ALLOW_AUTOPLAY, PLAYING2, NO_START, PAUSED, REPLAY2, ENTER, ENDED2, ERROR2,
|
|
5322
|
+
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;
|
|
5323
|
+
var clsList = [NOT_ALLOW_AUTOPLAY, PLAYING2, NO_START, PAUSED, REPLAY2, ENTER, ENDED2, ERROR2, LOADING2];
|
|
5289
5324
|
this.hasStart = false;
|
|
5290
5325
|
this.isError = false;
|
|
5291
5326
|
this._useAutoplay = false;
|
|
@@ -5385,7 +5420,6 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5385
5420
|
});
|
|
5386
5421
|
}
|
|
5387
5422
|
});
|
|
5388
|
-
_this19.play();
|
|
5389
5423
|
_this19.emit(REPLAY);
|
|
5390
5424
|
_this19.onPlay();
|
|
5391
5425
|
});
|
|
@@ -5399,7 +5433,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5399
5433
|
runHooks(this, "retry", function() {
|
|
5400
5434
|
var cur = _this20.currentTime;
|
|
5401
5435
|
var url = _this20.config.url;
|
|
5402
|
-
var _srcRet = !util.isMSE(_this20.media) ? _this20.
|
|
5436
|
+
var _srcRet = !util.isMSE(_this20.media) ? _this20._preProcessUrl(url) : {
|
|
5403
5437
|
url
|
|
5404
5438
|
};
|
|
5405
5439
|
_this20.src = _srcRet.url;
|
|
@@ -5627,6 +5661,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5627
5661
|
this.onBlur(data);
|
|
5628
5662
|
return;
|
|
5629
5663
|
}
|
|
5664
|
+
this._clearUserTimer();
|
|
5630
5665
|
this.emit(PLAYER_BLUR, _objectSpread2({
|
|
5631
5666
|
paused: this.paused,
|
|
5632
5667
|
ended: this.ended
|
|
@@ -5643,18 +5678,12 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5643
5678
|
var innerStates = this.innerStates;
|
|
5644
5679
|
this.isActive = true;
|
|
5645
5680
|
this.removeClass(STATE_CLASS.INACTIVE);
|
|
5646
|
-
|
|
5647
|
-
util.clearTimeout(this, this.userTimer);
|
|
5648
|
-
this.userTimer = null;
|
|
5649
|
-
}
|
|
5681
|
+
this._clearUserTimer();
|
|
5650
5682
|
if (data.isLock !== void 0) {
|
|
5651
5683
|
innerStates.isActiveLocked = data.isLock;
|
|
5652
5684
|
}
|
|
5653
5685
|
if (data.autoHide === false || data.isLock === true || innerStates.isActiveLocked) {
|
|
5654
|
-
|
|
5655
|
-
util.clearTimeout(this, this.userTimer);
|
|
5656
|
-
this.userTimer = null;
|
|
5657
|
-
}
|
|
5686
|
+
this._clearUserTimer();
|
|
5658
5687
|
return;
|
|
5659
5688
|
}
|
|
5660
5689
|
var time = data && data.delay ? data.delay : this.config.inactive;
|
|
@@ -5667,7 +5696,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5667
5696
|
key: "onBlur",
|
|
5668
5697
|
value: function onBlur() {
|
|
5669
5698
|
var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref$ignorePaused = _ref.ignorePaused, ignorePaused = _ref$ignorePaused === void 0 ? false : _ref$ignorePaused;
|
|
5670
|
-
if (
|
|
5699
|
+
if (this.innerStates.isActiveLocked) {
|
|
5671
5700
|
return;
|
|
5672
5701
|
}
|
|
5673
5702
|
var closePauseVideoFocus = this.config.closePauseVideoFocus;
|
|
@@ -5726,10 +5755,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5726
5755
|
this.addClass(STATE_CLASS.PAUSED);
|
|
5727
5756
|
this.updateAcc("pause");
|
|
5728
5757
|
if (!this.config.closePauseVideoFocus) {
|
|
5729
|
-
|
|
5730
|
-
util.clearTimeout(this, this.userTimer);
|
|
5731
|
-
this.userTimer = null;
|
|
5732
|
-
}
|
|
5758
|
+
this._clearUserTimer();
|
|
5733
5759
|
this.focus();
|
|
5734
5760
|
}
|
|
5735
5761
|
}
|
|
@@ -5780,6 +5806,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5780
5806
|
this.updateAcc("waiting");
|
|
5781
5807
|
this.waitTimer = util.setTimeout(this, function() {
|
|
5782
5808
|
_this22.addClass(STATE_CLASS.LOADING);
|
|
5809
|
+
_this22.emit(LOADING);
|
|
5783
5810
|
util.clearTimeout(_this22, _this22.waitTimer);
|
|
5784
5811
|
_this22.waitTimer = null;
|
|
5785
5812
|
}, this.config.minWaitDelay);
|
|
@@ -5789,8 +5816,8 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5789
5816
|
value: function onPlaying() {
|
|
5790
5817
|
var _this23 = this;
|
|
5791
5818
|
this.isError = false;
|
|
5792
|
-
var NO_START = STATE_CLASS.NO_START, PAUSED = STATE_CLASS.PAUSED, ENDED2 = STATE_CLASS.ENDED, ERROR2 = STATE_CLASS.ERROR, REPLAY2 = STATE_CLASS.REPLAY,
|
|
5793
|
-
var clsList = [NO_START, PAUSED, ENDED2, ERROR2, REPLAY2,
|
|
5819
|
+
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;
|
|
5820
|
+
var clsList = [NO_START, PAUSED, ENDED2, ERROR2, REPLAY2, LOADING2];
|
|
5794
5821
|
clsList.forEach(function(cls) {
|
|
5795
5822
|
_this23.removeClass(cls);
|
|
5796
5823
|
});
|
|
@@ -5859,6 +5886,11 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5859
5886
|
}, {
|
|
5860
5887
|
key: "checkBuffer",
|
|
5861
5888
|
value: function checkBuffer(time) {
|
|
5889
|
+
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
5890
|
+
startDiff: 0,
|
|
5891
|
+
endDiff: 0
|
|
5892
|
+
};
|
|
5893
|
+
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;
|
|
5862
5894
|
var buffered = this.media.buffered;
|
|
5863
5895
|
if (!buffered || buffered.length === 0 || !this.duration) {
|
|
5864
5896
|
return true;
|
|
@@ -5866,7 +5898,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5866
5898
|
var currentTime = time || this.media.currentTime || 0.2;
|
|
5867
5899
|
var len = buffered.length;
|
|
5868
5900
|
for (var i = 0; i < len; i++) {
|
|
5869
|
-
if (buffered.start(i) <= currentTime && buffered.end(i) > currentTime) {
|
|
5901
|
+
if (buffered.start(i) + startDiff <= currentTime && buffered.end(i) - endDiff > currentTime) {
|
|
5870
5902
|
return true;
|
|
5871
5903
|
}
|
|
5872
5904
|
}
|
|
@@ -6052,10 +6084,10 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6052
6084
|
this._state = newState;
|
|
6053
6085
|
}
|
|
6054
6086
|
}, {
|
|
6055
|
-
key: "
|
|
6056
|
-
value: function
|
|
6057
|
-
var
|
|
6058
|
-
return !util.isBlob(url) &&
|
|
6087
|
+
key: "_preProcessUrl",
|
|
6088
|
+
value: function _preProcessUrl(url, ext) {
|
|
6089
|
+
var preProcessUrl = this.config.preProcessUrl;
|
|
6090
|
+
return !util.isBlob(url) && typeof preProcessUrl === "function" ? preProcessUrl(url, ext) : {
|
|
6059
6091
|
url
|
|
6060
6092
|
};
|
|
6061
6093
|
}
|
|
@@ -6321,13 +6353,15 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6321
6353
|
}
|
|
6322
6354
|
}, {
|
|
6323
6355
|
key: "setUserActive",
|
|
6324
|
-
value: function setUserActive(isActive) {
|
|
6325
|
-
var
|
|
6356
|
+
value: function setUserActive(isActive, isMuted) {
|
|
6357
|
+
var _instManager3;
|
|
6326
6358
|
if (typeof isMuted === "boolean" && isMuted !== this.muted) {
|
|
6327
6359
|
this.addInnerOP("volumechange");
|
|
6328
|
-
|
|
6360
|
+
if (util.typeOf(isMuted) === Boolean) {
|
|
6361
|
+
this.muted = isMuted;
|
|
6362
|
+
}
|
|
6329
6363
|
}
|
|
6330
|
-
|
|
6364
|
+
(_instManager3 = instManager) === null || _instManager3 === void 0 ? void 0 : _instManager3.setActive(this.playerId, isActive);
|
|
6331
6365
|
}
|
|
6332
6366
|
}], [{
|
|
6333
6367
|
key: "debugger",
|
|
@@ -6348,14 +6382,14 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6348
6382
|
}, {
|
|
6349
6383
|
key: "getCurrentUserActivePlayerId",
|
|
6350
6384
|
value: function getCurrentUserActivePlayerId() {
|
|
6351
|
-
var
|
|
6352
|
-
return (
|
|
6385
|
+
var _instManager4;
|
|
6386
|
+
return (_instManager4 = instManager) === null || _instManager4 === void 0 ? void 0 : _instManager4.getActiveId();
|
|
6353
6387
|
}
|
|
6354
6388
|
}, {
|
|
6355
6389
|
key: "setCurrentUserActive",
|
|
6356
6390
|
value: function setCurrentUserActive(playerId, isActive) {
|
|
6357
|
-
var
|
|
6358
|
-
(
|
|
6391
|
+
var _instManager5;
|
|
6392
|
+
(_instManager5 = instManager) === null || _instManager5 === void 0 ? void 0 : _instManager5.setActive(playerId, isActive);
|
|
6359
6393
|
}
|
|
6360
6394
|
}, {
|
|
6361
6395
|
key: "isHevcSupported",
|
|
@@ -6748,8 +6782,8 @@ var Poster = /* @__PURE__ */ function(_Plugin) {
|
|
|
6748
6782
|
case "cover":
|
|
6749
6783
|
_bg = "cover";
|
|
6750
6784
|
break;
|
|
6751
|
-
case "
|
|
6752
|
-
_bg = "
|
|
6785
|
+
case "contain":
|
|
6786
|
+
_bg = "contain";
|
|
6753
6787
|
break;
|
|
6754
6788
|
case "fixHeight":
|
|
6755
6789
|
_bg = "auto 100%";
|
|
@@ -7792,6 +7826,7 @@ var PCPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
7792
7826
|
} else {
|
|
7793
7827
|
player.focus();
|
|
7794
7828
|
}
|
|
7829
|
+
_this.emit(ENTER_PLAYER);
|
|
7795
7830
|
});
|
|
7796
7831
|
_defineProperty(_assertThisInitialized(_this), "onMouseLeave", function(e) {
|
|
7797
7832
|
var _this$playerConfig = _this.playerConfig, closePlayerBlur = _this$playerConfig.closePlayerBlur, leavePlayerTime = _this$playerConfig.leavePlayerTime, closeDelayBlur = _this$playerConfig.closeDelayBlur;
|
|
@@ -7802,9 +7837,12 @@ var PCPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
7802
7837
|
delay: leavePlayerTime
|
|
7803
7838
|
});
|
|
7804
7839
|
} else {
|
|
7805
|
-
_this.player.blur(
|
|
7840
|
+
_this.player.blur({
|
|
7841
|
+
ignorePaused: true
|
|
7842
|
+
});
|
|
7806
7843
|
}
|
|
7807
7844
|
}
|
|
7845
|
+
_this.emit(LEAVE_PLAYER);
|
|
7808
7846
|
});
|
|
7809
7847
|
_defineProperty(_assertThisInitialized(_this), "onVideoClick", function(e) {
|
|
7810
7848
|
var _assertThisInitialize3 = _assertThisInitialized(_this), player = _assertThisInitialize3.player, playerConfig = _assertThisInitialize3.playerConfig;
|
|
@@ -8183,6 +8221,7 @@ var MobilePlugin = /* @__PURE__ */ function(_Plugin) {
|
|
|
8183
8221
|
var touche = _this.getTouche(e);
|
|
8184
8222
|
if (touche && !config.disableGesture && _this.duration > 0 && !player.ended) {
|
|
8185
8223
|
pos.isStart = true;
|
|
8224
|
+
_this.timer && clearTimeout(_this.timer);
|
|
8186
8225
|
util.checkIsFunction(playerConfig.disableSwipeHandler) && playerConfig.disableSwipeHandler();
|
|
8187
8226
|
_this.find(".xg-dur").innerHTML = util.format(_this.duration);
|
|
8188
8227
|
var rect = _this.root.getBoundingClientRect();
|
|
@@ -8243,6 +8282,9 @@ var MobilePlugin = /* @__PURE__ */ function(_Plugin) {
|
|
|
8243
8282
|
});
|
|
8244
8283
|
_defineProperty(_assertThisInitialized(_this), "onTouchEnd", function(e) {
|
|
8245
8284
|
var _assertThisInitialize3 = _assertThisInitialized(_this), player = _assertThisInitialize3.player, pos = _assertThisInitialize3.pos, playerConfig = _assertThisInitialize3.playerConfig;
|
|
8285
|
+
setTimeout(function() {
|
|
8286
|
+
player.getPlugin("progress") && player.getPlugin("progress").resetSeekState();
|
|
8287
|
+
}, 10);
|
|
8246
8288
|
if (!pos.isStart) {
|
|
8247
8289
|
return;
|
|
8248
8290
|
}
|
|
@@ -8252,9 +8294,6 @@ var MobilePlugin = /* @__PURE__ */ function(_Plugin) {
|
|
|
8252
8294
|
var _this$config = _this.config, disableGesture = _this$config.disableGesture, gestureX = _this$config.gestureX;
|
|
8253
8295
|
if (!disableGesture && gestureX) {
|
|
8254
8296
|
_this.endLastMove(pos.scope);
|
|
8255
|
-
setTimeout(function() {
|
|
8256
|
-
player.getPlugin("progress") && player.getPlugin("progress").resetSeekState();
|
|
8257
|
-
}, 10);
|
|
8258
8297
|
} else {
|
|
8259
8298
|
pos.time = 0;
|
|
8260
8299
|
}
|
|
@@ -8383,8 +8422,10 @@ var MobilePlugin = /* @__PURE__ */ function(_Plugin) {
|
|
|
8383
8422
|
progressPlugin.addCallBack("dragmove", function(data) {
|
|
8384
8423
|
_this2.activeSeekNote(data.currentTime, data.forward);
|
|
8385
8424
|
});
|
|
8386
|
-
|
|
8387
|
-
|
|
8425
|
+
["dragend", "click"].forEach(function(key) {
|
|
8426
|
+
progressPlugin.addCallBack(key, function() {
|
|
8427
|
+
_this2.changeAction(ACTIONS.AUTO);
|
|
8428
|
+
});
|
|
8388
8429
|
});
|
|
8389
8430
|
}
|
|
8390
8431
|
}
|
|
@@ -8404,15 +8445,23 @@ var MobilePlugin = /* @__PURE__ */ function(_Plugin) {
|
|
|
8404
8445
|
key: "initCustomStyle",
|
|
8405
8446
|
value: function initCustomStyle() {
|
|
8406
8447
|
var _ref = this.playerConfig || {}, commonStyle = _ref.commonStyle;
|
|
8407
|
-
var playedColor = commonStyle.playedColor, progressColor = commonStyle.progressColor;
|
|
8448
|
+
var playedColor = commonStyle.playedColor, progressColor = commonStyle.progressColor, timePreviewStyle = commonStyle.timePreviewStyle, curTimeColor = commonStyle.curTimeColor, durationColor = commonStyle.durationColor;
|
|
8408
8449
|
if (playedColor) {
|
|
8409
8450
|
this.find(".xg-curbar").style.backgroundColor = playedColor;
|
|
8410
|
-
this.find(".xg-cur").style.color = playedColor;
|
|
8411
8451
|
}
|
|
8412
8452
|
if (progressColor) {
|
|
8413
8453
|
this.find(".xg-bar").style.backgroundColor = progressColor;
|
|
8414
|
-
this.find(".time-preview").style.color = progressColor;
|
|
8415
8454
|
}
|
|
8455
|
+
if (timePreviewStyle) {
|
|
8456
|
+
var previewDom = this.find(".time-preview");
|
|
8457
|
+
Object.keys(timePreviewStyle).forEach(function(key) {
|
|
8458
|
+
previewDom.style[key] = timePreviewStyle[key];
|
|
8459
|
+
});
|
|
8460
|
+
}
|
|
8461
|
+
var curColor = curTimeColor || playedColor;
|
|
8462
|
+
var durColor = durationColor;
|
|
8463
|
+
curColor && (this.find(".xg-cur").style.color = curColor);
|
|
8464
|
+
durColor && (this.find(".xg-dur").style.color = durColor);
|
|
8416
8465
|
this.config.disableTimeProgress && util.addClass(this.find(".xg-timebar"), "hide");
|
|
8417
8466
|
}
|
|
8418
8467
|
}, {
|
|
@@ -8745,7 +8794,7 @@ var MobilePlugin = /* @__PURE__ */ function(_Plugin) {
|
|
|
8745
8794
|
key: "render",
|
|
8746
8795
|
value: function render() {
|
|
8747
8796
|
var className = this.config.gradient !== "normal" ? "gradient ".concat(this.config.gradient) : "gradient";
|
|
8748
|
-
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 ");
|
|
8797
|
+
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 ");
|
|
8749
8798
|
}
|
|
8750
8799
|
}], [{
|
|
8751
8800
|
key: "pluginName",
|
|
@@ -8939,6 +8988,14 @@ var Keyboard = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
8939
8988
|
this.player.root.addEventListener("keydown", this.onKeydown);
|
|
8940
8989
|
document.addEventListener("keydown", this.onBodyKeyDown);
|
|
8941
8990
|
}
|
|
8991
|
+
}, {
|
|
8992
|
+
key: "setConfig",
|
|
8993
|
+
value: function setConfig(newConfig) {
|
|
8994
|
+
var _this3 = this;
|
|
8995
|
+
Object.keys(newConfig).forEach(function(key) {
|
|
8996
|
+
_this3.config[key] = newConfig[key];
|
|
8997
|
+
});
|
|
8998
|
+
}
|
|
8942
8999
|
}, {
|
|
8943
9000
|
key: "checkIsVisible",
|
|
8944
9001
|
value: function checkIsVisible() {
|
|
@@ -8956,11 +9013,11 @@ var Keyboard = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
8956
9013
|
}, {
|
|
8957
9014
|
key: "checkCode",
|
|
8958
9015
|
value: function checkCode(code, isBodyTarget) {
|
|
8959
|
-
var
|
|
9016
|
+
var _this4 = this;
|
|
8960
9017
|
var flag = false;
|
|
8961
9018
|
Object.keys(this.keyCodeMap).map(function(key) {
|
|
8962
|
-
if (
|
|
8963
|
-
flag = !isBodyTarget || isBodyTarget && !
|
|
9019
|
+
if (_this4.keyCodeMap[key] && code === _this4.keyCodeMap[key].keyCode && !_this4.keyCodeMap[key].disable) {
|
|
9020
|
+
flag = !isBodyTarget || isBodyTarget && !_this4.keyCodeMap[key].noBodyTarget;
|
|
8964
9021
|
}
|
|
8965
9022
|
});
|
|
8966
9023
|
return flag;
|
|
@@ -9151,6 +9208,7 @@ var Keyboard = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
9151
9208
|
}, this.keyCodeMap[arr[i]]));
|
|
9152
9209
|
}
|
|
9153
9210
|
preventDefault(event);
|
|
9211
|
+
event.stopPropagation();
|
|
9154
9212
|
break;
|
|
9155
9213
|
}
|
|
9156
9214
|
}
|
|
@@ -9265,6 +9323,9 @@ var Icon = /* @__PURE__ */ function(_Plugin) {
|
|
|
9265
9323
|
value: function afterCreate() {
|
|
9266
9324
|
this.bind("mouseenter", this._onMouseenter);
|
|
9267
9325
|
this.bind("mouseleave", this._onMouseLeave);
|
|
9326
|
+
if (this.config.disable) {
|
|
9327
|
+
this.disable();
|
|
9328
|
+
}
|
|
9268
9329
|
}
|
|
9269
9330
|
}, {
|
|
9270
9331
|
key: "destroy",
|
|
@@ -9596,9 +9657,15 @@ var Fullscreen = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
9596
9657
|
} else {
|
|
9597
9658
|
if (player.fullscreen) {
|
|
9598
9659
|
player.exitFullscreen();
|
|
9660
|
+
if (config.useScreenOrientation) {
|
|
9661
|
+
this.unlockScreen();
|
|
9662
|
+
}
|
|
9599
9663
|
} else {
|
|
9600
9664
|
player.getFullscreen().catch(function(e2) {
|
|
9601
9665
|
});
|
|
9666
|
+
if (config.useScreenOrientation && player.aspectRatio > 1) {
|
|
9667
|
+
this.lockScreen(config.lockOrientationType);
|
|
9668
|
+
}
|
|
9602
9669
|
}
|
|
9603
9670
|
}
|
|
9604
9671
|
}
|
|
@@ -9625,6 +9692,24 @@ var Fullscreen = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
9625
9692
|
var langKey = "FULLSCREEN_TIPS";
|
|
9626
9693
|
return '<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n '.concat(xgIconTips(this, langKey, this.playerConfig.isHideTips), "\n </xg-icon>");
|
|
9627
9694
|
}
|
|
9695
|
+
}, {
|
|
9696
|
+
key: "lockScreen",
|
|
9697
|
+
value: function lockScreen(orientation) {
|
|
9698
|
+
try {
|
|
9699
|
+
screen.orientation.lock(orientation).catch(function(e) {
|
|
9700
|
+
});
|
|
9701
|
+
} catch (e) {
|
|
9702
|
+
}
|
|
9703
|
+
}
|
|
9704
|
+
}, {
|
|
9705
|
+
key: "unlockScreen",
|
|
9706
|
+
value: function unlockScreen() {
|
|
9707
|
+
try {
|
|
9708
|
+
screen.orientation.unlock().catch(function(e) {
|
|
9709
|
+
});
|
|
9710
|
+
} catch (e) {
|
|
9711
|
+
}
|
|
9712
|
+
}
|
|
9628
9713
|
}], [{
|
|
9629
9714
|
key: "pluginName",
|
|
9630
9715
|
get: function get() {
|
|
@@ -9638,6 +9723,8 @@ var Fullscreen = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
9638
9723
|
index: 0,
|
|
9639
9724
|
useCssFullscreen: false,
|
|
9640
9725
|
rotateFullscreen: false,
|
|
9726
|
+
useScreenOrientation: false,
|
|
9727
|
+
lockOrientationType: "landscape",
|
|
9641
9728
|
switchCallback: null,
|
|
9642
9729
|
target: null,
|
|
9643
9730
|
disable: false,
|
|
@@ -10424,7 +10511,10 @@ const BaseEvents = {
|
|
|
10424
10511
|
AUTOPLAY_FAIL: "autoplayFail",
|
|
10425
10512
|
AUTOPLAY_SUCCESS: "autoplaySuccess",
|
|
10426
10513
|
ERROR_REFRESH_CLICK: "errorRefreshClick",
|
|
10427
|
-
SOURCE_CHANGE: "sourceChange"
|
|
10514
|
+
SOURCE_CHANGE: "sourceChange",
|
|
10515
|
+
SWITCH_DEFINITION_START: "switchDefinitionStart",
|
|
10516
|
+
SWITCH_DEFINITION_SUCCESS: "switchDefinitionSuccess",
|
|
10517
|
+
DOWN_DEFINITION: "downDefinition"
|
|
10428
10518
|
};
|
|
10429
10519
|
const Events = {
|
|
10430
10520
|
...XGEvents,
|
|
@@ -10470,6 +10560,15 @@ const EVENT_TRANSFORMATION = {
|
|
|
10470
10560
|
},
|
|
10471
10561
|
[BaseEvents.DOWNLOAD_SPEED_CHANGE]: {
|
|
10472
10562
|
event: DOWNLOAD_SPEED_CHANGE
|
|
10563
|
+
},
|
|
10564
|
+
[BaseEvents.SWITCH_DEFINITION_START]: {
|
|
10565
|
+
event: "switch_definition_start"
|
|
10566
|
+
},
|
|
10567
|
+
[BaseEvents.SWITCH_DEFINITION_SUCCESS]: {
|
|
10568
|
+
event: "switch_definition_success"
|
|
10569
|
+
},
|
|
10570
|
+
[BaseEvents.DOWN_DEFINITION]: {
|
|
10571
|
+
event: "down_definition"
|
|
10473
10572
|
}
|
|
10474
10573
|
};
|
|
10475
10574
|
function transform(event, callback) {
|
|
@@ -12369,7 +12468,8 @@ const NAME_MAP = {
|
|
|
12369
12468
|
"plugin:shaka": "veplayer.plugin.shaka.[env].[ext]",
|
|
12370
12469
|
"plugin:rtm": "veplayer.plugin.rtm.[env].[ext]",
|
|
12371
12470
|
"plugin:xgvideo": "veplayer.plugin.xgvideo.[env].[ext]",
|
|
12372
|
-
"plugin:drm": "veplayer.plugin.drm.[env].[ext]"
|
|
12471
|
+
"plugin:drm": "veplayer.plugin.drm.[env].[ext]",
|
|
12472
|
+
"plugin:abr": "veplayer.plugin.abr.[env].[ext]"
|
|
12373
12473
|
};
|
|
12374
12474
|
var DynamicModule = /* @__PURE__ */ ((DynamicModule2) => {
|
|
12375
12475
|
DynamicModule2["BizVod"] = "biz:vod";
|
|
@@ -12381,6 +12481,7 @@ var DynamicModule = /* @__PURE__ */ ((DynamicModule2) => {
|
|
|
12381
12481
|
DynamicModule2["PluginRtm"] = "plugin:rtm";
|
|
12382
12482
|
DynamicModule2["PluginXgvideo"] = "plugin:xgvideo";
|
|
12383
12483
|
DynamicModule2["PluginDrm"] = "plugin:drm";
|
|
12484
|
+
DynamicModule2["PluginAbr"] = "plugin:abr";
|
|
12384
12485
|
return DynamicModule2;
|
|
12385
12486
|
})(DynamicModule || {});
|
|
12386
12487
|
class Loader {
|
|
@@ -13640,7 +13741,7 @@ class VePlayerBase {
|
|
|
13640
13741
|
* @param callback 表示事件的回调函数。
|
|
13641
13742
|
*/
|
|
13642
13743
|
/** {en}
|
|
13643
|
-
* @brief
|
|
13744
|
+
* @brief Add a one-time listener function for the specified event.
|
|
13644
13745
|
* @param event The event name.
|
|
13645
13746
|
* @param callback The callback function for the event.
|
|
13646
13747
|
*/
|