@volcengine/veplayer 2.4.1-rc.0 → 2.5.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/veplayer.biz.live.development.js +76 -88
- package/esm/veplayer.biz.live.production.js +1 -1
- package/esm/veplayer.development.js +200 -143
- package/esm/veplayer.live.development.js +200 -143
- package/esm/veplayer.live.production.js +3 -3
- package/esm/veplayer.production.js +3 -3
- package/esm/veplayer.vod.development.js +167 -98
- package/esm/veplayer.vod.production.js +2 -2
- package/package.json +1 -1
- package/umd/veplayer.biz.live.development.js +76 -88
- package/umd/veplayer.biz.live.production.js +1 -1
- package/umd/veplayer.development.js +200 -143
- package/umd/veplayer.live.development.js +200 -143
- package/umd/veplayer.live.production.js +1 -1
- package/umd/veplayer.production.js +1 -1
- package/umd/veplayer.vod.development.js +167 -98
- package/umd/veplayer.vod.production.js +1 -1
|
@@ -1307,7 +1307,7 @@ var VERSION_REG = {
|
|
|
1307
1307
|
android: /(Android)\s([\d.]+)/,
|
|
1308
1308
|
ios: /(Version)\/([\d.]+)/
|
|
1309
1309
|
};
|
|
1310
|
-
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", "
|
|
1310
|
+
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"];
|
|
1311
1311
|
var sniffer = {
|
|
1312
1312
|
get device() {
|
|
1313
1313
|
var r = sniffer.os;
|
|
@@ -1452,7 +1452,7 @@ var sniffer = {
|
|
|
1452
1452
|
}
|
|
1453
1453
|
}
|
|
1454
1454
|
};
|
|
1455
|
-
var version = "3.0.
|
|
1455
|
+
var version = "3.0.20-alpha.4";
|
|
1456
1456
|
var ERROR_TYPE_MAP = {
|
|
1457
1457
|
1: "media",
|
|
1458
1458
|
2: "media",
|
|
@@ -2422,8 +2422,7 @@ function hook(hookName, handler) {
|
|
|
2422
2422
|
}
|
|
2423
2423
|
if (this.__hooks && this.__hooks[hookName]) {
|
|
2424
2424
|
try {
|
|
2425
|
-
var
|
|
2426
|
-
var preRet = (_this$__hooks$hookNam = this.__hooks[hookName]).call.apply(_this$__hooks$hookNam, [this, this].concat(Array.prototype.slice.call(arguments)));
|
|
2425
|
+
var preRet = runHooks(this, hookName, handler);
|
|
2427
2426
|
if (preRet) {
|
|
2428
2427
|
if (preRet.then) {
|
|
2429
2428
|
preRet.then(function(isContinue) {
|
|
@@ -2448,6 +2447,19 @@ function hook(hookName, handler) {
|
|
|
2448
2447
|
}
|
|
2449
2448
|
}.bind(this);
|
|
2450
2449
|
}
|
|
2450
|
+
function findHookIndex(hookName, handler) {
|
|
2451
|
+
var __hooks = this.__hooks;
|
|
2452
|
+
if (!__hooks || !Array.isArray(__hooks[hookName])) {
|
|
2453
|
+
return -1;
|
|
2454
|
+
}
|
|
2455
|
+
var hookHandlers = __hooks[hookName];
|
|
2456
|
+
for (var i = 0; i < hookHandlers.length; i++) {
|
|
2457
|
+
if (hookHandlers[i] === handler) {
|
|
2458
|
+
return i;
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2461
|
+
return -1;
|
|
2462
|
+
}
|
|
2451
2463
|
function useHooks(hookName, handler) {
|
|
2452
2464
|
var __hooks = this.__hooks;
|
|
2453
2465
|
if (!__hooks) {
|
|
@@ -2457,7 +2469,12 @@ function useHooks(hookName, handler) {
|
|
|
2457
2469
|
console.warn("has no supported hook which name [".concat(hookName, "]"));
|
|
2458
2470
|
return false;
|
|
2459
2471
|
}
|
|
2460
|
-
|
|
2472
|
+
if (!Array.isArray(__hooks[hookName])) {
|
|
2473
|
+
__hooks[hookName] = [];
|
|
2474
|
+
}
|
|
2475
|
+
if (findHookIndex.call(this, hookName, handler) === -1) {
|
|
2476
|
+
__hooks[hookName].push(handler);
|
|
2477
|
+
}
|
|
2461
2478
|
return true;
|
|
2462
2479
|
}
|
|
2463
2480
|
function removeHooks(hookName, handler) {
|
|
@@ -2465,6 +2482,13 @@ function removeHooks(hookName, handler) {
|
|
|
2465
2482
|
if (!__hooks) {
|
|
2466
2483
|
return;
|
|
2467
2484
|
}
|
|
2485
|
+
if (Array.isArray(__hooks[hookName])) {
|
|
2486
|
+
var hooks = __hooks[hookName];
|
|
2487
|
+
var index = findHookIndex.call(this, hookName, handler);
|
|
2488
|
+
if (index !== -1) {
|
|
2489
|
+
hooks.splice(index, 1);
|
|
2490
|
+
}
|
|
2491
|
+
}
|
|
2468
2492
|
delete __hooks[hookName];
|
|
2469
2493
|
}
|
|
2470
2494
|
function usePluginHooks(pluginName) {
|
|
@@ -2512,18 +2536,30 @@ function runHooks(obj, hookName, handler) {
|
|
|
2512
2536
|
for (var _len5 = arguments.length, args = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
|
|
2513
2537
|
args[_key5 - 3] = arguments[_key5];
|
|
2514
2538
|
}
|
|
2515
|
-
if (obj.__hooks && obj.__hooks[hookName]) {
|
|
2516
|
-
var
|
|
2517
|
-
var
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
}
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2539
|
+
if (obj.__hooks && Array.isArray(obj.__hooks[hookName])) {
|
|
2540
|
+
var hooks = obj.__hooks[hookName];
|
|
2541
|
+
var index = -1;
|
|
2542
|
+
var runHooksRecursive = function runHooksRecursive2(obj2, hookName2, handler2) {
|
|
2543
|
+
for (var _len6 = arguments.length, args2 = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {
|
|
2544
|
+
args2[_key6 - 3] = arguments[_key6];
|
|
2545
|
+
}
|
|
2546
|
+
index++;
|
|
2547
|
+
if (hooks.length === 0 || index === hooks.length) {
|
|
2548
|
+
return handler2.call.apply(handler2, [obj2, obj2].concat(args2));
|
|
2549
|
+
}
|
|
2550
|
+
var hook2 = hooks[index];
|
|
2551
|
+
var ret = hook2.call.apply(hook2, [obj2, obj2].concat(args2));
|
|
2552
|
+
if (ret && ret.then) {
|
|
2553
|
+
return ret.then(function(data) {
|
|
2554
|
+
return data === false ? null : runHooksRecursive2.apply(void 0, [obj2, hookName2, handler2].concat(args2));
|
|
2555
|
+
}).catch(function(e) {
|
|
2556
|
+
console.warn("[runHooks]".concat(hookName2, " reject"), e.message);
|
|
2557
|
+
});
|
|
2558
|
+
} else if (ret !== false) {
|
|
2559
|
+
return runHooksRecursive2.apply(void 0, [obj2, hookName2, handler2].concat(args2));
|
|
2560
|
+
}
|
|
2561
|
+
};
|
|
2562
|
+
return runHooksRecursive.apply(void 0, [obj, hookName, handler].concat(args));
|
|
2527
2563
|
} else {
|
|
2528
2564
|
return handler.call.apply(handler, [obj, obj].concat(args));
|
|
2529
2565
|
}
|
|
@@ -4480,10 +4516,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4480
4516
|
}
|
|
4481
4517
|
var _this$config = _this.config, autoplay2 = _this$config.autoplay, defaultPlaybackRate = _this$config.defaultPlaybackRate;
|
|
4482
4518
|
XG_DEBUG.logInfo("player", "canPlayFunc, startTime", _this.__startTime);
|
|
4483
|
-
|
|
4484
|
-
_this.currentTime = _this.__startTime > _this.duration ? _this.duration : _this.__startTime;
|
|
4485
|
-
_this.__startTime = -1;
|
|
4486
|
-
}
|
|
4519
|
+
_this._seekToStartTime();
|
|
4487
4520
|
_this.playbackRate = defaultPlaybackRate;
|
|
4488
4521
|
(autoplay2 || _this._useAutoplay) && _this.mediaPlay();
|
|
4489
4522
|
_this.off(CANPLAY, _this.canPlayFunc);
|
|
@@ -4573,6 +4606,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4573
4606
|
_this.waitTimer = null;
|
|
4574
4607
|
_this.handleSource = true;
|
|
4575
4608
|
_this._state = STATES.INITIAL;
|
|
4609
|
+
_this.isAd = false;
|
|
4576
4610
|
_this.isError = false;
|
|
4577
4611
|
_this._hasStart = false;
|
|
4578
4612
|
_this.isSeeking = false;
|
|
@@ -4957,7 +4991,8 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4957
4991
|
_pConfig.position && (options.position = _pConfig.position);
|
|
4958
4992
|
var position = options.position ? options.position : options.config && options.config.position || PLUFGIN.defaultConfig && PLUFGIN.defaultConfig.position;
|
|
4959
4993
|
if (!options.root && typeof position === "string" && position.indexOf("controls") > -1) {
|
|
4960
|
-
|
|
4994
|
+
var _this$controls;
|
|
4995
|
+
return (_this$controls = this.controls) === null || _this$controls === void 0 ? void 0 : _this$controls.registerPlugin(PLUFGIN, options, PLUFGIN.pluginName);
|
|
4961
4996
|
}
|
|
4962
4997
|
if (!options.root) {
|
|
4963
4998
|
options.root = this._getRootByPosition(position);
|
|
@@ -5105,10 +5140,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5105
5140
|
reject(e);
|
|
5106
5141
|
};
|
|
5107
5142
|
var _canplay = function _canplay2() {
|
|
5108
|
-
|
|
5109
|
-
_this9.currentTime = _this9.__startTime;
|
|
5110
|
-
_this9.__startTime = -1;
|
|
5111
|
-
}
|
|
5143
|
+
_this9._seekToStartTime();
|
|
5112
5144
|
if (isPaused) {
|
|
5113
5145
|
_this9.pause();
|
|
5114
5146
|
}
|
|
@@ -5729,11 +5761,17 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5729
5761
|
}, {
|
|
5730
5762
|
key: "onLoadeddata",
|
|
5731
5763
|
value: function onLoadeddata() {
|
|
5764
|
+
var _this22 = this;
|
|
5732
5765
|
this.isError = false;
|
|
5733
5766
|
this.isSeeking = false;
|
|
5734
|
-
if (this.__startTime > 0
|
|
5735
|
-
this.
|
|
5736
|
-
|
|
5767
|
+
if (this.__startTime > 0) {
|
|
5768
|
+
if (this.duration > 0) {
|
|
5769
|
+
this._seekToStartTime();
|
|
5770
|
+
} else {
|
|
5771
|
+
this.once(DURATION_CHANGE, function() {
|
|
5772
|
+
_this22._seekToStartTime();
|
|
5773
|
+
});
|
|
5774
|
+
}
|
|
5737
5775
|
}
|
|
5738
5776
|
}
|
|
5739
5777
|
}, {
|
|
@@ -5802,27 +5840,27 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5802
5840
|
}, {
|
|
5803
5841
|
key: "onWaiting",
|
|
5804
5842
|
value: function onWaiting() {
|
|
5805
|
-
var
|
|
5843
|
+
var _this23 = this;
|
|
5806
5844
|
if (this.waitTimer) {
|
|
5807
5845
|
util.clearTimeout(this, this.waitTimer);
|
|
5808
5846
|
}
|
|
5809
5847
|
this.updateAcc("waiting");
|
|
5810
5848
|
this.waitTimer = util.setTimeout(this, function() {
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
util.clearTimeout(
|
|
5814
|
-
|
|
5849
|
+
_this23.addClass(STATE_CLASS.LOADING);
|
|
5850
|
+
_this23.emit(LOADING);
|
|
5851
|
+
util.clearTimeout(_this23, _this23.waitTimer);
|
|
5852
|
+
_this23.waitTimer = null;
|
|
5815
5853
|
}, this.config.minWaitDelay);
|
|
5816
5854
|
}
|
|
5817
5855
|
}, {
|
|
5818
5856
|
key: "onPlaying",
|
|
5819
5857
|
value: function onPlaying() {
|
|
5820
|
-
var
|
|
5858
|
+
var _this24 = this;
|
|
5821
5859
|
this.isError = false;
|
|
5822
5860
|
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;
|
|
5823
5861
|
var clsList = [NO_START, PAUSED, ENDED2, ERROR2, REPLAY2, LOADING2];
|
|
5824
5862
|
clsList.forEach(function(cls) {
|
|
5825
|
-
|
|
5863
|
+
_this24.removeClass(cls);
|
|
5826
5864
|
});
|
|
5827
5865
|
if (!this._accPlayed.t && !this.paused && !this.ended) {
|
|
5828
5866
|
this._accPlayed.t = (/* @__PURE__ */ new Date()).getTime();
|
|
@@ -5983,14 +6021,14 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5983
6021
|
}, {
|
|
5984
6022
|
key: "setConfig",
|
|
5985
6023
|
value: function setConfig(config) {
|
|
5986
|
-
var
|
|
6024
|
+
var _this25 = this;
|
|
5987
6025
|
if (!config) {
|
|
5988
6026
|
return;
|
|
5989
6027
|
}
|
|
5990
6028
|
Object.keys(config).map(function(key) {
|
|
5991
6029
|
if (key !== "plugins") {
|
|
5992
|
-
|
|
5993
|
-
var plugin =
|
|
6030
|
+
_this25.config[key] = config[key];
|
|
6031
|
+
var plugin = _this25.plugins[key.toLowerCase()];
|
|
5994
6032
|
if (plugin && util.typeOf(plugin.setConfig) === "Function") {
|
|
5995
6033
|
plugin.setConfig(config[key]);
|
|
5996
6034
|
}
|
|
@@ -6000,20 +6038,20 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6000
6038
|
}, {
|
|
6001
6039
|
key: "playNext",
|
|
6002
6040
|
value: function playNext(config) {
|
|
6003
|
-
var
|
|
6041
|
+
var _this26 = this;
|
|
6004
6042
|
this.resetState();
|
|
6005
6043
|
this.setConfig(config);
|
|
6006
6044
|
this._currentTime = 0;
|
|
6007
6045
|
this._duration = 0;
|
|
6008
6046
|
runHooks(this, "playnext", function() {
|
|
6009
|
-
|
|
6010
|
-
|
|
6047
|
+
_this26.start();
|
|
6048
|
+
_this26.emit(PLAYNEXT, config);
|
|
6011
6049
|
});
|
|
6012
6050
|
}
|
|
6013
6051
|
}, {
|
|
6014
6052
|
key: "resize",
|
|
6015
6053
|
value: function resize() {
|
|
6016
|
-
var
|
|
6054
|
+
var _this27 = this;
|
|
6017
6055
|
if (!this.media) {
|
|
6018
6056
|
return;
|
|
6019
6057
|
}
|
|
@@ -6053,7 +6091,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6053
6091
|
}
|
|
6054
6092
|
if (!this.fullscreen && !this.cssfullscreen) {
|
|
6055
6093
|
Object.keys(_style).forEach(function(key) {
|
|
6056
|
-
|
|
6094
|
+
_this27.root.style[key] = _style[key];
|
|
6057
6095
|
});
|
|
6058
6096
|
}
|
|
6059
6097
|
if (videoFillMode === "fillHeight" && fit < videoFit || videoFillMode === "fillWidth" && fit > videoFit) {
|
|
@@ -6095,6 +6133,14 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6095
6133
|
url
|
|
6096
6134
|
};
|
|
6097
6135
|
}
|
|
6136
|
+
}, {
|
|
6137
|
+
key: "_seekToStartTime",
|
|
6138
|
+
value: function _seekToStartTime() {
|
|
6139
|
+
if (this.__startTime > 0 && this.duration > 0) {
|
|
6140
|
+
this.currentTime = this.__startTime > this.duration ? this.duration : this.__startTime;
|
|
6141
|
+
this.__startTime = -1;
|
|
6142
|
+
}
|
|
6143
|
+
}
|
|
6098
6144
|
}, {
|
|
6099
6145
|
key: "state",
|
|
6100
6146
|
get: function get() {
|
|
@@ -6145,15 +6191,15 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6145
6191
|
return this.config.definition.list || [];
|
|
6146
6192
|
},
|
|
6147
6193
|
set: function set(list) {
|
|
6148
|
-
var
|
|
6194
|
+
var _this28 = this;
|
|
6149
6195
|
var definition = this.config.definition;
|
|
6150
6196
|
var curDef = null;
|
|
6151
6197
|
var targetDef = null;
|
|
6152
6198
|
definition.list = list;
|
|
6153
6199
|
this.emit("resourceReady", list);
|
|
6154
6200
|
list.forEach(function(item) {
|
|
6155
|
-
var
|
|
6156
|
-
if (((
|
|
6201
|
+
var _this28$curDefinition;
|
|
6202
|
+
if (((_this28$curDefinition = _this28.curDefinition) === null || _this28$curDefinition === void 0 ? void 0 : _this28$curDefinition.definition) === item.definition) {
|
|
6157
6203
|
curDef = item;
|
|
6158
6204
|
}
|
|
6159
6205
|
if (definition.defaultDefinition === item.definition) {
|
|
@@ -6890,7 +6936,7 @@ var Start = /* @__PURE__ */ function(_Plugin) {
|
|
|
6890
6936
|
var className = _this.config.mode === "auto" ? "auto-hide" : "hide";
|
|
6891
6937
|
util.addClass(_this.root, className);
|
|
6892
6938
|
_this.autoPlayStart = true;
|
|
6893
|
-
_this.
|
|
6939
|
+
_this.toggleTo("play");
|
|
6894
6940
|
});
|
|
6895
6941
|
_this.autoPlayStart = false;
|
|
6896
6942
|
return _this;
|
|
@@ -6898,9 +6944,19 @@ var Start = /* @__PURE__ */ function(_Plugin) {
|
|
|
6898
6944
|
_createClass(Start2, [{
|
|
6899
6945
|
key: "afterCreate",
|
|
6900
6946
|
value: function afterCreate() {
|
|
6947
|
+
var playerConfig = this.playerConfig;
|
|
6948
|
+
this.initIcons();
|
|
6949
|
+
this.listenEvents();
|
|
6950
|
+
this.bindClickEvents();
|
|
6951
|
+
if (!playerConfig.autoplay) {
|
|
6952
|
+
this.show();
|
|
6953
|
+
}
|
|
6954
|
+
}
|
|
6955
|
+
}, {
|
|
6956
|
+
key: "listenEvents",
|
|
6957
|
+
value: function listenEvents() {
|
|
6901
6958
|
var _this2 = this;
|
|
6902
6959
|
var player = this.player, playerConfig = this.playerConfig;
|
|
6903
|
-
this.initIcons();
|
|
6904
6960
|
this.once(READY, function() {
|
|
6905
6961
|
if (playerConfig) {
|
|
6906
6962
|
if (playerConfig.lang && playerConfig.lang === "en") {
|
|
@@ -6911,9 +6967,6 @@ var Start = /* @__PURE__ */ function(_Plugin) {
|
|
|
6911
6967
|
}
|
|
6912
6968
|
});
|
|
6913
6969
|
this.on(AUTOPLAY_STARTED, this.onAutoplayStart);
|
|
6914
|
-
if (!playerConfig.autoplay) {
|
|
6915
|
-
this.show();
|
|
6916
|
-
}
|
|
6917
6970
|
this.on(AUTOPLAY_PREVENTED, function() {
|
|
6918
6971
|
var className = _this2.config.mode === "auto" ? "auto-hide" : "hide";
|
|
6919
6972
|
_this2.setAttr("data-state", "play");
|
|
@@ -6921,20 +6974,25 @@ var Start = /* @__PURE__ */ function(_Plugin) {
|
|
|
6921
6974
|
_this2.show();
|
|
6922
6975
|
});
|
|
6923
6976
|
this.on(PLAY, function() {
|
|
6924
|
-
_this2.
|
|
6977
|
+
_this2.toggleTo("play");
|
|
6925
6978
|
});
|
|
6926
6979
|
this.on(PAUSE, function() {
|
|
6927
|
-
_this2.
|
|
6980
|
+
_this2.toggleTo("pause");
|
|
6928
6981
|
});
|
|
6929
6982
|
this.on(RESET, function() {
|
|
6930
6983
|
_this2.onPlayerReset();
|
|
6931
6984
|
});
|
|
6985
|
+
}
|
|
6986
|
+
}, {
|
|
6987
|
+
key: "bindClickEvents",
|
|
6988
|
+
value: function bindClickEvents() {
|
|
6989
|
+
var _this3 = this;
|
|
6932
6990
|
this.clickHandler = this.hook("startClick", this.switchPausePlay, {
|
|
6933
6991
|
pre: function pre(e) {
|
|
6934
6992
|
e.cancelable && e.preventDefault();
|
|
6935
6993
|
e.stopPropagation();
|
|
6936
|
-
var paused =
|
|
6937
|
-
|
|
6994
|
+
var paused = _this3.player.paused;
|
|
6995
|
+
_this3.emitUserAction(e, "switch_play_pause", {
|
|
6938
6996
|
props: "paused",
|
|
6939
6997
|
from: paused,
|
|
6940
6998
|
to: !paused
|
|
@@ -6996,17 +7054,17 @@ var Start = /* @__PURE__ */ function(_Plugin) {
|
|
|
6996
7054
|
}, {
|
|
6997
7055
|
key: "animate",
|
|
6998
7056
|
value: function animate(endShow) {
|
|
6999
|
-
var
|
|
7057
|
+
var _this4 = this;
|
|
7000
7058
|
this._animateId = addAnimate("pauseplay", 400, {
|
|
7001
7059
|
start: function start() {
|
|
7002
|
-
util.addClass(
|
|
7003
|
-
|
|
7004
|
-
|
|
7060
|
+
util.addClass(_this4.root, "interact");
|
|
7061
|
+
_this4.show();
|
|
7062
|
+
_this4.switchStatus(true);
|
|
7005
7063
|
},
|
|
7006
7064
|
end: function end() {
|
|
7007
|
-
util.removeClass(
|
|
7008
|
-
!endShow &&
|
|
7009
|
-
|
|
7065
|
+
util.removeClass(_this4.root, "interact");
|
|
7066
|
+
!endShow && _this4.hide();
|
|
7067
|
+
_this4._animateId = null;
|
|
7010
7068
|
}
|
|
7011
7069
|
});
|
|
7012
7070
|
}
|
|
@@ -7036,6 +7094,11 @@ var Start = /* @__PURE__ */ function(_Plugin) {
|
|
|
7036
7094
|
}, {
|
|
7037
7095
|
key: "onPlayPause",
|
|
7038
7096
|
value: function onPlayPause(status) {
|
|
7097
|
+
this.toggleTo(status);
|
|
7098
|
+
}
|
|
7099
|
+
}, {
|
|
7100
|
+
key: "toggleTo",
|
|
7101
|
+
value: function toggleTo(status) {
|
|
7039
7102
|
var config = this.config, player = this.player;
|
|
7040
7103
|
if (!player || player.state < STATES.RUNNING || !this.autoPlayStart) {
|
|
7041
7104
|
return;
|
|
@@ -9366,29 +9429,56 @@ var Play$1 = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
9366
9429
|
_inherits(Play2, _IconPlugin);
|
|
9367
9430
|
var _super = _createSuper(Play2);
|
|
9368
9431
|
function Play2() {
|
|
9432
|
+
var _this;
|
|
9369
9433
|
_classCallCheck(this, Play2);
|
|
9370
|
-
|
|
9434
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
9435
|
+
args[_key] = arguments[_key];
|
|
9436
|
+
}
|
|
9437
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
9438
|
+
_defineProperty(_assertThisInitialized(_this), "btnClick", function(e) {
|
|
9439
|
+
e.preventDefault();
|
|
9440
|
+
e.stopPropagation();
|
|
9441
|
+
var _assertThisInitialize = _assertThisInitialized(_this), player = _assertThisInitialize.player;
|
|
9442
|
+
_this.emitUserAction(e, "switch_play_pause", {
|
|
9443
|
+
prop: "paused",
|
|
9444
|
+
from: player.paused,
|
|
9445
|
+
to: !player.paused
|
|
9446
|
+
});
|
|
9447
|
+
if (player.ended) {
|
|
9448
|
+
player.replay();
|
|
9449
|
+
} else if (player.paused) {
|
|
9450
|
+
player.play();
|
|
9451
|
+
_this.animate(false);
|
|
9452
|
+
} else {
|
|
9453
|
+
player.pause();
|
|
9454
|
+
_this.animate(true);
|
|
9455
|
+
}
|
|
9456
|
+
return false;
|
|
9457
|
+
});
|
|
9458
|
+
return _this;
|
|
9371
9459
|
}
|
|
9372
9460
|
_createClass(Play2, [{
|
|
9373
9461
|
key: "afterCreate",
|
|
9374
9462
|
value: function afterCreate() {
|
|
9375
|
-
var _this = this;
|
|
9376
9463
|
_get(_getPrototypeOf(Play2.prototype), "afterCreate", this).call(this);
|
|
9377
|
-
var
|
|
9464
|
+
var config = this.config;
|
|
9378
9465
|
if (config.disable) {
|
|
9379
9466
|
return;
|
|
9380
9467
|
}
|
|
9381
9468
|
this.initIcons();
|
|
9382
|
-
this.btnClick = this.btnClick.bind(this);
|
|
9383
9469
|
this.bind(["touchend", "click"], this.btnClick);
|
|
9384
|
-
this.
|
|
9385
|
-
_this.animate(player.paused);
|
|
9386
|
-
});
|
|
9387
|
-
this.on(PLAY, function() {
|
|
9388
|
-
_this.animate(player.paused);
|
|
9389
|
-
});
|
|
9470
|
+
this.listenEvents();
|
|
9390
9471
|
this.animate(true);
|
|
9391
9472
|
}
|
|
9473
|
+
}, {
|
|
9474
|
+
key: "listenEvents",
|
|
9475
|
+
value: function listenEvents() {
|
|
9476
|
+
var _this2 = this;
|
|
9477
|
+
var player = this.player;
|
|
9478
|
+
this.on([PLAY, PAUSE, ERROR, EMPTIED], function() {
|
|
9479
|
+
_this2.animate(player.paused);
|
|
9480
|
+
});
|
|
9481
|
+
}
|
|
9392
9482
|
}, {
|
|
9393
9483
|
key: "registerIcons",
|
|
9394
9484
|
value: function registerIcons() {
|
|
@@ -9403,28 +9493,6 @@ var Play$1 = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
9403
9493
|
}
|
|
9404
9494
|
};
|
|
9405
9495
|
}
|
|
9406
|
-
}, {
|
|
9407
|
-
key: "btnClick",
|
|
9408
|
-
value: function btnClick(e) {
|
|
9409
|
-
e.preventDefault();
|
|
9410
|
-
e.stopPropagation();
|
|
9411
|
-
var player = this.player;
|
|
9412
|
-
this.emitUserAction(e, "switch_play_pause", {
|
|
9413
|
-
prop: "paused",
|
|
9414
|
-
from: player.paused,
|
|
9415
|
-
to: !player.paused
|
|
9416
|
-
});
|
|
9417
|
-
if (player.ended) {
|
|
9418
|
-
player.replay();
|
|
9419
|
-
} else if (player.paused) {
|
|
9420
|
-
player.play();
|
|
9421
|
-
this.animate(false);
|
|
9422
|
-
} else {
|
|
9423
|
-
player.pause();
|
|
9424
|
-
this.animate(true);
|
|
9425
|
-
}
|
|
9426
|
-
return false;
|
|
9427
|
-
}
|
|
9428
9496
|
}, {
|
|
9429
9497
|
key: "initIcons",
|
|
9430
9498
|
value: function initIcons() {
|
|
@@ -11467,10 +11535,10 @@ class OptionsIcon extends Plugin {
|
|
|
11467
11535
|
const { controls } = this.player;
|
|
11468
11536
|
const { listType } = this.config;
|
|
11469
11537
|
if (isActive) {
|
|
11470
|
-
listType && MODAL_TYPES.includes(listType) ? controls.blur() : controls.focus();
|
|
11538
|
+
listType && MODAL_TYPES.includes(listType) ? controls == null ? void 0 : controls.blur() : controls == null ? void 0 : controls.focus();
|
|
11471
11539
|
this.optionsList && this.optionsList.show();
|
|
11472
11540
|
} else {
|
|
11473
|
-
listType && MODAL_TYPES.includes(listType) ? controls.focus() : controls.focusAwhile();
|
|
11541
|
+
listType && MODAL_TYPES.includes(listType) ? controls == null ? void 0 : controls.focus() : controls == null ? void 0 : controls.focusAwhile();
|
|
11474
11542
|
this.optionsList && this.optionsList.hide();
|
|
11475
11543
|
}
|
|
11476
11544
|
this._isActive = isActive;
|
|
@@ -12937,6 +13005,7 @@ class Autoplay extends Plugin {
|
|
|
12937
13005
|
}
|
|
12938
13006
|
// 有音量修改,取消静音
|
|
12939
13007
|
handleVolumechange() {
|
|
13008
|
+
this._state.mode = this.player.muted ? 1 : 0;
|
|
12940
13009
|
if (!this._state.showUnmuteBt)
|
|
12941
13010
|
return;
|
|
12942
13011
|
this._state.showUnmuteBt = false;
|
|
@@ -13580,7 +13649,7 @@ class VePlayerBase {
|
|
|
13580
13649
|
* @returns
|
|
13581
13650
|
*/
|
|
13582
13651
|
get playerVersion() {
|
|
13583
|
-
return "2.
|
|
13652
|
+
return "2.5.0-rc.0";
|
|
13584
13653
|
}
|
|
13585
13654
|
/** {zh}
|
|
13586
13655
|
* @brief 获取当前播放视频的清晰度唯一标识(definition)。
|