@volcengine/veplayer 2.4.2-rc.2 → 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.
- package/esm/veplayer.biz.live.development.js +3 -3
- package/esm/veplayer.biz.live.production.js +1 -1
- package/esm/veplayer.d.ts +0 -10
- package/esm/veplayer.development.js +196 -111
- package/esm/veplayer.live.d.ts +0 -10
- package/esm/veplayer.live.development.js +196 -111
- package/esm/veplayer.live.production.js +3 -3
- package/esm/veplayer.production.js +3 -3
- package/esm/veplayer.vod.development.js +192 -107
- package/esm/veplayer.vod.production.js +2 -2
- package/package.json +1 -1
- package/umd/veplayer.biz.live.development.js +3 -3
- package/umd/veplayer.biz.live.production.js +1 -1
- package/umd/veplayer.d.ts +0 -10
- package/umd/veplayer.development.js +196 -111
- package/umd/veplayer.live.d.ts +0 -10
- package/umd/veplayer.live.development.js +196 -111
- package/umd/veplayer.live.production.js +1 -1
- package/umd/veplayer.production.js +1 -1
- package/umd/veplayer.vod.development.js +192 -107
- package/umd/veplayer.vod.production.js +1 -1
- package/veplayer.d.ts +0 -10
- package/veplayer.live.d.ts +0 -10
|
@@ -1316,7 +1316,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1316
1316
|
android: /(Android)\s([\d.]+)/,
|
|
1317
1317
|
ios: /(Version)\/([\d.]+)/
|
|
1318
1318
|
};
|
|
1319
|
-
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", "
|
|
1319
|
+
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"];
|
|
1320
1320
|
var sniffer$1 = {
|
|
1321
1321
|
get device() {
|
|
1322
1322
|
var r2 = sniffer$1.os;
|
|
@@ -1461,7 +1461,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1461
1461
|
}
|
|
1462
1462
|
}
|
|
1463
1463
|
};
|
|
1464
|
-
var version = "3.0.
|
|
1464
|
+
var version = "3.0.20-rc.6";
|
|
1465
1465
|
var ERROR_TYPE_MAP = {
|
|
1466
1466
|
1: "media",
|
|
1467
1467
|
2: "media",
|
|
@@ -2431,8 +2431,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2431
2431
|
}
|
|
2432
2432
|
if (this.__hooks && this.__hooks[hookName]) {
|
|
2433
2433
|
try {
|
|
2434
|
-
var
|
|
2435
|
-
var preRet = (_this$__hooks$hookNam = this.__hooks[hookName]).call.apply(_this$__hooks$hookNam, [this, this].concat(Array.prototype.slice.call(arguments)));
|
|
2434
|
+
var preRet = runHooks(this, hookName, handler);
|
|
2436
2435
|
if (preRet) {
|
|
2437
2436
|
if (preRet.then) {
|
|
2438
2437
|
preRet.then(function(isContinue) {
|
|
@@ -2457,6 +2456,19 @@ var __publicField = (obj, key, value) => {
|
|
|
2457
2456
|
}
|
|
2458
2457
|
}.bind(this);
|
|
2459
2458
|
}
|
|
2459
|
+
function findHookIndex(hookName, handler) {
|
|
2460
|
+
var __hooks = this.__hooks;
|
|
2461
|
+
if (!__hooks || !Array.isArray(__hooks[hookName])) {
|
|
2462
|
+
return -1;
|
|
2463
|
+
}
|
|
2464
|
+
var hookHandlers = __hooks[hookName];
|
|
2465
|
+
for (var i2 = 0; i2 < hookHandlers.length; i2++) {
|
|
2466
|
+
if (hookHandlers[i2] === handler) {
|
|
2467
|
+
return i2;
|
|
2468
|
+
}
|
|
2469
|
+
}
|
|
2470
|
+
return -1;
|
|
2471
|
+
}
|
|
2460
2472
|
function useHooks(hookName, handler) {
|
|
2461
2473
|
var __hooks = this.__hooks;
|
|
2462
2474
|
if (!__hooks) {
|
|
@@ -2466,7 +2478,12 @@ var __publicField = (obj, key, value) => {
|
|
|
2466
2478
|
console.warn("has no supported hook which name [".concat(hookName, "]"));
|
|
2467
2479
|
return false;
|
|
2468
2480
|
}
|
|
2469
|
-
|
|
2481
|
+
if (!Array.isArray(__hooks[hookName])) {
|
|
2482
|
+
__hooks[hookName] = [];
|
|
2483
|
+
}
|
|
2484
|
+
if (findHookIndex.call(this, hookName, handler) === -1) {
|
|
2485
|
+
__hooks[hookName].push(handler);
|
|
2486
|
+
}
|
|
2470
2487
|
return true;
|
|
2471
2488
|
}
|
|
2472
2489
|
function removeHooks(hookName, handler) {
|
|
@@ -2474,6 +2491,13 @@ var __publicField = (obj, key, value) => {
|
|
|
2474
2491
|
if (!__hooks) {
|
|
2475
2492
|
return;
|
|
2476
2493
|
}
|
|
2494
|
+
if (Array.isArray(__hooks[hookName])) {
|
|
2495
|
+
var hooks = __hooks[hookName];
|
|
2496
|
+
var index = findHookIndex.call(this, hookName, handler);
|
|
2497
|
+
if (index !== -1) {
|
|
2498
|
+
hooks.splice(index, 1);
|
|
2499
|
+
}
|
|
2500
|
+
}
|
|
2477
2501
|
delete __hooks[hookName];
|
|
2478
2502
|
}
|
|
2479
2503
|
function usePluginHooks(pluginName) {
|
|
@@ -2521,18 +2545,30 @@ var __publicField = (obj, key, value) => {
|
|
|
2521
2545
|
for (var _len5 = arguments.length, args = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
|
|
2522
2546
|
args[_key5 - 3] = arguments[_key5];
|
|
2523
2547
|
}
|
|
2524
|
-
if (obj.__hooks && obj.__hooks[hookName]) {
|
|
2525
|
-
var
|
|
2526
|
-
var
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
}
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2548
|
+
if (obj.__hooks && Array.isArray(obj.__hooks[hookName])) {
|
|
2549
|
+
var hooks = obj.__hooks[hookName];
|
|
2550
|
+
var index = -1;
|
|
2551
|
+
var runHooksRecursive = function runHooksRecursive2(obj2, hookName2, handler2) {
|
|
2552
|
+
for (var _len6 = arguments.length, args2 = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {
|
|
2553
|
+
args2[_key6 - 3] = arguments[_key6];
|
|
2554
|
+
}
|
|
2555
|
+
index++;
|
|
2556
|
+
if (hooks.length === 0 || index === hooks.length) {
|
|
2557
|
+
return handler2.call.apply(handler2, [obj2, obj2].concat(args2));
|
|
2558
|
+
}
|
|
2559
|
+
var hook2 = hooks[index];
|
|
2560
|
+
var ret = hook2.call.apply(hook2, [obj2, obj2].concat(args2));
|
|
2561
|
+
if (ret && ret.then) {
|
|
2562
|
+
return ret.then(function(data) {
|
|
2563
|
+
return data === false ? null : runHooksRecursive2.apply(void 0, [obj2, hookName2, handler2].concat(args2));
|
|
2564
|
+
}).catch(function(e2) {
|
|
2565
|
+
console.warn("[runHooks]".concat(hookName2, " reject"), e2.message);
|
|
2566
|
+
});
|
|
2567
|
+
} else if (ret !== false) {
|
|
2568
|
+
return runHooksRecursive2.apply(void 0, [obj2, hookName2, handler2].concat(args2));
|
|
2569
|
+
}
|
|
2570
|
+
};
|
|
2571
|
+
return runHooksRecursive.apply(void 0, [obj, hookName, handler].concat(args));
|
|
2536
2572
|
} else {
|
|
2537
2573
|
return handler.call.apply(handler, [obj, obj].concat(args));
|
|
2538
2574
|
}
|
|
@@ -2776,6 +2812,18 @@ var __publicField = (obj, key, value) => {
|
|
|
2776
2812
|
}
|
|
2777
2813
|
}
|
|
2778
2814
|
}
|
|
2815
|
+
}, {
|
|
2816
|
+
key: "defineMethod",
|
|
2817
|
+
value: function defineMethod(Obj, map) {
|
|
2818
|
+
for (var key in map) {
|
|
2819
|
+
if (Object.prototype.hasOwnProperty.call(map, key) && typeof map[key] === "function") {
|
|
2820
|
+
Object.defineProperty(Obj, key, {
|
|
2821
|
+
configurable: true,
|
|
2822
|
+
value: map[key]
|
|
2823
|
+
});
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
}
|
|
2779
2827
|
}, {
|
|
2780
2828
|
key: "defaultConfig",
|
|
2781
2829
|
get: function get() {
|
|
@@ -3421,7 +3469,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3421
3469
|
if (!this.observer) {
|
|
3422
3470
|
return;
|
|
3423
3471
|
}
|
|
3424
|
-
this.observer
|
|
3472
|
+
this.observer.observe(target);
|
|
3425
3473
|
var _pid = target.getAttribute(PLATER_ID);
|
|
3426
3474
|
var __handlers = this.__handlers;
|
|
3427
3475
|
var index = -1;
|
|
@@ -3450,16 +3498,17 @@ var __publicField = (obj, key, value) => {
|
|
|
3450
3498
|
}
|
|
3451
3499
|
});
|
|
3452
3500
|
try {
|
|
3453
|
-
|
|
3501
|
+
var _this$observer;
|
|
3502
|
+
(_this$observer = this.observer) === null || _this$observer === void 0 ? void 0 : _this$observer.unobserve(target);
|
|
3454
3503
|
} catch (e2) {
|
|
3455
3504
|
}
|
|
3456
|
-
this.observer && this.observer.unobserve(target);
|
|
3457
3505
|
i2 > -1 && this.__handlers.splice(i2, 1);
|
|
3458
3506
|
}
|
|
3459
3507
|
}, {
|
|
3460
3508
|
key: "destroyObserver",
|
|
3461
3509
|
value: function destroyObserver() {
|
|
3462
|
-
|
|
3510
|
+
var _this$observer2;
|
|
3511
|
+
(_this$observer2 = this.observer) === null || _this$observer2 === void 0 ? void 0 : _this$observer2.disconnect();
|
|
3463
3512
|
this.observer = null;
|
|
3464
3513
|
this.__handlers = null;
|
|
3465
3514
|
}
|
|
@@ -3491,7 +3540,8 @@ var __publicField = (obj, key, value) => {
|
|
|
3491
3540
|
return resizeObserver;
|
|
3492
3541
|
}
|
|
3493
3542
|
function unObserver(target, handler) {
|
|
3494
|
-
|
|
3543
|
+
var _resizeObserver;
|
|
3544
|
+
(_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 ? void 0 : _resizeObserver.unObserver(target, handler);
|
|
3495
3545
|
}
|
|
3496
3546
|
var pluginsManager = {
|
|
3497
3547
|
pluginGroup: {},
|
|
@@ -4489,10 +4539,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4489
4539
|
}
|
|
4490
4540
|
var _this$config = _this.config, autoplay2 = _this$config.autoplay, defaultPlaybackRate = _this$config.defaultPlaybackRate;
|
|
4491
4541
|
XG_DEBUG.logInfo("player", "canPlayFunc, startTime", _this.__startTime);
|
|
4492
|
-
|
|
4493
|
-
_this.currentTime = _this.__startTime > _this.duration ? _this.duration : _this.__startTime;
|
|
4494
|
-
_this.__startTime = -1;
|
|
4495
|
-
}
|
|
4542
|
+
_this._seekToStartTime();
|
|
4496
4543
|
_this.playbackRate = defaultPlaybackRate;
|
|
4497
4544
|
(autoplay2 || _this._useAutoplay) && _this.mediaPlay();
|
|
4498
4545
|
_this.off(CANPLAY, _this.canPlayFunc);
|
|
@@ -4582,6 +4629,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4582
4629
|
_this.waitTimer = null;
|
|
4583
4630
|
_this.handleSource = true;
|
|
4584
4631
|
_this._state = STATES.INITIAL;
|
|
4632
|
+
_this.isAd = false;
|
|
4585
4633
|
_this.isError = false;
|
|
4586
4634
|
_this._hasStart = false;
|
|
4587
4635
|
_this.isSeeking = false;
|
|
@@ -4966,7 +5014,8 @@ var __publicField = (obj, key, value) => {
|
|
|
4966
5014
|
_pConfig.position && (options.position = _pConfig.position);
|
|
4967
5015
|
var position = options.position ? options.position : options.config && options.config.position || PLUFGIN.defaultConfig && PLUFGIN.defaultConfig.position;
|
|
4968
5016
|
if (!options.root && typeof position === "string" && position.indexOf("controls") > -1) {
|
|
4969
|
-
|
|
5017
|
+
var _this$controls;
|
|
5018
|
+
return (_this$controls = this.controls) === null || _this$controls === void 0 ? void 0 : _this$controls.registerPlugin(PLUFGIN, options, PLUFGIN.pluginName);
|
|
4970
5019
|
}
|
|
4971
5020
|
if (!options.root) {
|
|
4972
5021
|
options.root = this._getRootByPosition(position);
|
|
@@ -5114,10 +5163,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5114
5163
|
reject(e2);
|
|
5115
5164
|
};
|
|
5116
5165
|
var _canplay = function _canplay2() {
|
|
5117
|
-
|
|
5118
|
-
_this9.currentTime = _this9.__startTime;
|
|
5119
|
-
_this9.__startTime = -1;
|
|
5120
|
-
}
|
|
5166
|
+
_this9._seekToStartTime();
|
|
5121
5167
|
if (isPaused) {
|
|
5122
5168
|
_this9.pause();
|
|
5123
5169
|
}
|
|
@@ -5738,11 +5784,17 @@ var __publicField = (obj, key, value) => {
|
|
|
5738
5784
|
}, {
|
|
5739
5785
|
key: "onLoadeddata",
|
|
5740
5786
|
value: function onLoadeddata() {
|
|
5787
|
+
var _this22 = this;
|
|
5741
5788
|
this.isError = false;
|
|
5742
5789
|
this.isSeeking = false;
|
|
5743
|
-
if (this.__startTime > 0
|
|
5744
|
-
this.
|
|
5745
|
-
|
|
5790
|
+
if (this.__startTime > 0) {
|
|
5791
|
+
if (this.duration > 0) {
|
|
5792
|
+
this._seekToStartTime();
|
|
5793
|
+
} else {
|
|
5794
|
+
this.once(DURATION_CHANGE, function() {
|
|
5795
|
+
_this22._seekToStartTime();
|
|
5796
|
+
});
|
|
5797
|
+
}
|
|
5746
5798
|
}
|
|
5747
5799
|
}
|
|
5748
5800
|
}, {
|
|
@@ -5811,27 +5863,27 @@ var __publicField = (obj, key, value) => {
|
|
|
5811
5863
|
}, {
|
|
5812
5864
|
key: "onWaiting",
|
|
5813
5865
|
value: function onWaiting() {
|
|
5814
|
-
var
|
|
5866
|
+
var _this23 = this;
|
|
5815
5867
|
if (this.waitTimer) {
|
|
5816
5868
|
util$1.clearTimeout(this, this.waitTimer);
|
|
5817
5869
|
}
|
|
5818
5870
|
this.updateAcc("waiting");
|
|
5819
5871
|
this.waitTimer = util$1.setTimeout(this, function() {
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
util$1.clearTimeout(
|
|
5823
|
-
|
|
5872
|
+
_this23.addClass(STATE_CLASS.LOADING);
|
|
5873
|
+
_this23.emit(LOADING);
|
|
5874
|
+
util$1.clearTimeout(_this23, _this23.waitTimer);
|
|
5875
|
+
_this23.waitTimer = null;
|
|
5824
5876
|
}, this.config.minWaitDelay);
|
|
5825
5877
|
}
|
|
5826
5878
|
}, {
|
|
5827
5879
|
key: "onPlaying",
|
|
5828
5880
|
value: function onPlaying() {
|
|
5829
|
-
var
|
|
5881
|
+
var _this24 = this;
|
|
5830
5882
|
this.isError = false;
|
|
5831
5883
|
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;
|
|
5832
5884
|
var clsList = [NO_START, PAUSED, ENDED2, ERROR2, REPLAY2, LOADING2];
|
|
5833
5885
|
clsList.forEach(function(cls) {
|
|
5834
|
-
|
|
5886
|
+
_this24.removeClass(cls);
|
|
5835
5887
|
});
|
|
5836
5888
|
if (!this._accPlayed.t && !this.paused && !this.ended) {
|
|
5837
5889
|
this._accPlayed.t = (/* @__PURE__ */ new Date()).getTime();
|
|
@@ -5992,14 +6044,14 @@ var __publicField = (obj, key, value) => {
|
|
|
5992
6044
|
}, {
|
|
5993
6045
|
key: "setConfig",
|
|
5994
6046
|
value: function setConfig(config) {
|
|
5995
|
-
var
|
|
6047
|
+
var _this25 = this;
|
|
5996
6048
|
if (!config) {
|
|
5997
6049
|
return;
|
|
5998
6050
|
}
|
|
5999
6051
|
Object.keys(config).map(function(key) {
|
|
6000
6052
|
if (key !== "plugins") {
|
|
6001
|
-
|
|
6002
|
-
var plugin =
|
|
6053
|
+
_this25.config[key] = config[key];
|
|
6054
|
+
var plugin = _this25.plugins[key.toLowerCase()];
|
|
6003
6055
|
if (plugin && util$1.typeOf(plugin.setConfig) === "Function") {
|
|
6004
6056
|
plugin.setConfig(config[key]);
|
|
6005
6057
|
}
|
|
@@ -6009,20 +6061,20 @@ var __publicField = (obj, key, value) => {
|
|
|
6009
6061
|
}, {
|
|
6010
6062
|
key: "playNext",
|
|
6011
6063
|
value: function playNext(config) {
|
|
6012
|
-
var
|
|
6064
|
+
var _this26 = this;
|
|
6013
6065
|
this.resetState();
|
|
6014
6066
|
this.setConfig(config);
|
|
6015
6067
|
this._currentTime = 0;
|
|
6016
6068
|
this._duration = 0;
|
|
6017
6069
|
runHooks(this, "playnext", function() {
|
|
6018
|
-
|
|
6019
|
-
|
|
6070
|
+
_this26.start();
|
|
6071
|
+
_this26.emit(PLAYNEXT, config);
|
|
6020
6072
|
});
|
|
6021
6073
|
}
|
|
6022
6074
|
}, {
|
|
6023
6075
|
key: "resize",
|
|
6024
6076
|
value: function resize() {
|
|
6025
|
-
var
|
|
6077
|
+
var _this27 = this;
|
|
6026
6078
|
if (!this.media) {
|
|
6027
6079
|
return;
|
|
6028
6080
|
}
|
|
@@ -6062,7 +6114,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6062
6114
|
}
|
|
6063
6115
|
if (!this.fullscreen && !this.cssfullscreen) {
|
|
6064
6116
|
Object.keys(_style).forEach(function(key) {
|
|
6065
|
-
|
|
6117
|
+
_this27.root.style[key] = _style[key];
|
|
6066
6118
|
});
|
|
6067
6119
|
}
|
|
6068
6120
|
if (videoFillMode === "fillHeight" && fit < videoFit || videoFillMode === "fillWidth" && fit > videoFit) {
|
|
@@ -6104,6 +6156,14 @@ var __publicField = (obj, key, value) => {
|
|
|
6104
6156
|
url
|
|
6105
6157
|
};
|
|
6106
6158
|
}
|
|
6159
|
+
}, {
|
|
6160
|
+
key: "_seekToStartTime",
|
|
6161
|
+
value: function _seekToStartTime() {
|
|
6162
|
+
if (this.__startTime > 0 && this.duration > 0) {
|
|
6163
|
+
this.currentTime = this.__startTime > this.duration ? this.duration : this.__startTime;
|
|
6164
|
+
this.__startTime = -1;
|
|
6165
|
+
}
|
|
6166
|
+
}
|
|
6107
6167
|
}, {
|
|
6108
6168
|
key: "state",
|
|
6109
6169
|
get: function get() {
|
|
@@ -6154,15 +6214,15 @@ var __publicField = (obj, key, value) => {
|
|
|
6154
6214
|
return this.config.definition.list || [];
|
|
6155
6215
|
},
|
|
6156
6216
|
set: function set(list) {
|
|
6157
|
-
var
|
|
6217
|
+
var _this28 = this;
|
|
6158
6218
|
var definition = this.config.definition;
|
|
6159
6219
|
var curDef = null;
|
|
6160
6220
|
var targetDef = null;
|
|
6161
6221
|
definition.list = list;
|
|
6162
6222
|
this.emit("resourceReady", list);
|
|
6163
6223
|
list.forEach(function(item) {
|
|
6164
|
-
var
|
|
6165
|
-
if (((
|
|
6224
|
+
var _this28$curDefinition;
|
|
6225
|
+
if (((_this28$curDefinition = _this28.curDefinition) === null || _this28$curDefinition === void 0 ? void 0 : _this28$curDefinition.definition) === item.definition) {
|
|
6166
6226
|
curDef = item;
|
|
6167
6227
|
}
|
|
6168
6228
|
if (definition.defaultDefinition === item.definition) {
|
|
@@ -6926,7 +6986,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6926
6986
|
var className = _this.config.mode === "auto" ? "auto-hide" : "hide";
|
|
6927
6987
|
util$1.addClass(_this.root, className);
|
|
6928
6988
|
_this.autoPlayStart = true;
|
|
6929
|
-
_this.
|
|
6989
|
+
_this.toggleTo("play");
|
|
6930
6990
|
});
|
|
6931
6991
|
_this.autoPlayStart = false;
|
|
6932
6992
|
return _this;
|
|
@@ -6934,9 +6994,19 @@ var __publicField = (obj, key, value) => {
|
|
|
6934
6994
|
_createClass$1(Start2, [{
|
|
6935
6995
|
key: "afterCreate",
|
|
6936
6996
|
value: function afterCreate() {
|
|
6997
|
+
var playerConfig = this.playerConfig;
|
|
6998
|
+
this.initIcons();
|
|
6999
|
+
this.listenEvents();
|
|
7000
|
+
this.bindClickEvents();
|
|
7001
|
+
if (!playerConfig.autoplay) {
|
|
7002
|
+
this.show();
|
|
7003
|
+
}
|
|
7004
|
+
}
|
|
7005
|
+
}, {
|
|
7006
|
+
key: "listenEvents",
|
|
7007
|
+
value: function listenEvents() {
|
|
6937
7008
|
var _this2 = this;
|
|
6938
7009
|
var player = this.player, playerConfig = this.playerConfig;
|
|
6939
|
-
this.initIcons();
|
|
6940
7010
|
this.once(READY, function() {
|
|
6941
7011
|
if (playerConfig) {
|
|
6942
7012
|
if (playerConfig.lang && playerConfig.lang === "en") {
|
|
@@ -6947,9 +7017,6 @@ var __publicField = (obj, key, value) => {
|
|
|
6947
7017
|
}
|
|
6948
7018
|
});
|
|
6949
7019
|
this.on(AUTOPLAY_STARTED, this.onAutoplayStart);
|
|
6950
|
-
if (!playerConfig.autoplay) {
|
|
6951
|
-
this.show();
|
|
6952
|
-
}
|
|
6953
7020
|
this.on(AUTOPLAY_PREVENTED, function() {
|
|
6954
7021
|
var className = _this2.config.mode === "auto" ? "auto-hide" : "hide";
|
|
6955
7022
|
_this2.setAttr("data-state", "play");
|
|
@@ -6957,20 +7024,25 @@ var __publicField = (obj, key, value) => {
|
|
|
6957
7024
|
_this2.show();
|
|
6958
7025
|
});
|
|
6959
7026
|
this.on(PLAY, function() {
|
|
6960
|
-
_this2.
|
|
7027
|
+
_this2.toggleTo("play");
|
|
6961
7028
|
});
|
|
6962
7029
|
this.on(PAUSE, function() {
|
|
6963
|
-
_this2.
|
|
7030
|
+
_this2.toggleTo("pause");
|
|
6964
7031
|
});
|
|
6965
7032
|
this.on(RESET, function() {
|
|
6966
7033
|
_this2.onPlayerReset();
|
|
6967
7034
|
});
|
|
7035
|
+
}
|
|
7036
|
+
}, {
|
|
7037
|
+
key: "bindClickEvents",
|
|
7038
|
+
value: function bindClickEvents() {
|
|
7039
|
+
var _this3 = this;
|
|
6968
7040
|
this.clickHandler = this.hook("startClick", this.switchPausePlay, {
|
|
6969
7041
|
pre: function pre(e2) {
|
|
6970
7042
|
e2.cancelable && e2.preventDefault();
|
|
6971
7043
|
e2.stopPropagation();
|
|
6972
|
-
var paused =
|
|
6973
|
-
|
|
7044
|
+
var paused = _this3.player.paused;
|
|
7045
|
+
_this3.emitUserAction(e2, "switch_play_pause", {
|
|
6974
7046
|
props: "paused",
|
|
6975
7047
|
from: paused,
|
|
6976
7048
|
to: !paused
|
|
@@ -7032,17 +7104,17 @@ var __publicField = (obj, key, value) => {
|
|
|
7032
7104
|
}, {
|
|
7033
7105
|
key: "animate",
|
|
7034
7106
|
value: function animate(endShow) {
|
|
7035
|
-
var
|
|
7107
|
+
var _this4 = this;
|
|
7036
7108
|
this._animateId = addAnimate("pauseplay", 400, {
|
|
7037
7109
|
start: function start() {
|
|
7038
|
-
util$1.addClass(
|
|
7039
|
-
|
|
7040
|
-
|
|
7110
|
+
util$1.addClass(_this4.root, "interact");
|
|
7111
|
+
_this4.show();
|
|
7112
|
+
_this4.switchStatus(true);
|
|
7041
7113
|
},
|
|
7042
7114
|
end: function end() {
|
|
7043
|
-
util$1.removeClass(
|
|
7044
|
-
!endShow &&
|
|
7045
|
-
|
|
7115
|
+
util$1.removeClass(_this4.root, "interact");
|
|
7116
|
+
!endShow && _this4.hide();
|
|
7117
|
+
_this4._animateId = null;
|
|
7046
7118
|
}
|
|
7047
7119
|
});
|
|
7048
7120
|
}
|
|
@@ -7072,6 +7144,11 @@ var __publicField = (obj, key, value) => {
|
|
|
7072
7144
|
}, {
|
|
7073
7145
|
key: "onPlayPause",
|
|
7074
7146
|
value: function onPlayPause(status) {
|
|
7147
|
+
this.toggleTo(status);
|
|
7148
|
+
}
|
|
7149
|
+
}, {
|
|
7150
|
+
key: "toggleTo",
|
|
7151
|
+
value: function toggleTo(status) {
|
|
7075
7152
|
var config = this.config, player = this.player;
|
|
7076
7153
|
if (!player || player.state < STATES.RUNNING || !this.autoPlayStart) {
|
|
7077
7154
|
return;
|
|
@@ -8447,7 +8524,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8447
8524
|
}
|
|
8448
8525
|
this.on(DURATION_CHANGE, function() {
|
|
8449
8526
|
var player2 = _this2.player, config2 = _this2.config;
|
|
8450
|
-
if (player2.duration * 1e3 < config2.moveDuration) {
|
|
8527
|
+
if (player2.duration > 0 && player2.duration * 1e3 < config2.moveDuration) {
|
|
8451
8528
|
config2.moveDuration = player2.duration * 1e3;
|
|
8452
8529
|
}
|
|
8453
8530
|
});
|
|
@@ -8761,10 +8838,13 @@ var __publicField = (obj, key, value) => {
|
|
|
8761
8838
|
}, {
|
|
8762
8839
|
key: "updateBrightness",
|
|
8763
8840
|
value: function updateBrightness(percent) {
|
|
8841
|
+
var pos = this.pos, config = this.config, xgMask = this.xgMask;
|
|
8842
|
+
if (!config.darkness) {
|
|
8843
|
+
return;
|
|
8844
|
+
}
|
|
8764
8845
|
if (this.player.rotateDeg) {
|
|
8765
8846
|
percent = -percent;
|
|
8766
8847
|
}
|
|
8767
|
-
var pos = this.pos, config = this.config, xgMask = this.xgMask;
|
|
8768
8848
|
var light = pos.light + 0.8 * percent;
|
|
8769
8849
|
light = light > config.maxDarkness ? config.maxDarkness : light < 0 ? 0 : light;
|
|
8770
8850
|
if (xgMask) {
|
|
@@ -8825,12 +8905,12 @@ var __publicField = (obj, key, value) => {
|
|
|
8825
8905
|
}, {
|
|
8826
8906
|
key: "disableGesture",
|
|
8827
8907
|
value: function disableGesture() {
|
|
8828
|
-
this.config.disableGesture =
|
|
8908
|
+
this.config.disableGesture = true;
|
|
8829
8909
|
}
|
|
8830
8910
|
}, {
|
|
8831
8911
|
key: "enableGesture",
|
|
8832
8912
|
value: function enableGesture() {
|
|
8833
|
-
this.config.disableGesture =
|
|
8913
|
+
this.config.disableGesture = false;
|
|
8834
8914
|
}
|
|
8835
8915
|
}, {
|
|
8836
8916
|
key: "destroy",
|
|
@@ -9402,29 +9482,56 @@ var __publicField = (obj, key, value) => {
|
|
|
9402
9482
|
_inherits(Play2, _IconPlugin);
|
|
9403
9483
|
var _super = _createSuper(Play2);
|
|
9404
9484
|
function Play2() {
|
|
9485
|
+
var _this;
|
|
9405
9486
|
_classCallCheck(this, Play2);
|
|
9406
|
-
|
|
9487
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
9488
|
+
args[_key] = arguments[_key];
|
|
9489
|
+
}
|
|
9490
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
9491
|
+
_defineProperty$1(_assertThisInitialized(_this), "btnClick", function(e2) {
|
|
9492
|
+
e2.preventDefault();
|
|
9493
|
+
e2.stopPropagation();
|
|
9494
|
+
var _assertThisInitialize = _assertThisInitialized(_this), player = _assertThisInitialize.player;
|
|
9495
|
+
_this.emitUserAction(e2, "switch_play_pause", {
|
|
9496
|
+
prop: "paused",
|
|
9497
|
+
from: player.paused,
|
|
9498
|
+
to: !player.paused
|
|
9499
|
+
});
|
|
9500
|
+
if (player.ended) {
|
|
9501
|
+
player.replay();
|
|
9502
|
+
} else if (player.paused) {
|
|
9503
|
+
player.play();
|
|
9504
|
+
_this.animate(false);
|
|
9505
|
+
} else {
|
|
9506
|
+
player.pause();
|
|
9507
|
+
_this.animate(true);
|
|
9508
|
+
}
|
|
9509
|
+
return false;
|
|
9510
|
+
});
|
|
9511
|
+
return _this;
|
|
9407
9512
|
}
|
|
9408
9513
|
_createClass$1(Play2, [{
|
|
9409
9514
|
key: "afterCreate",
|
|
9410
9515
|
value: function afterCreate() {
|
|
9411
|
-
var _this = this;
|
|
9412
9516
|
_get(_getPrototypeOf(Play2.prototype), "afterCreate", this).call(this);
|
|
9413
|
-
var
|
|
9517
|
+
var config = this.config;
|
|
9414
9518
|
if (config.disable) {
|
|
9415
9519
|
return;
|
|
9416
9520
|
}
|
|
9417
9521
|
this.initIcons();
|
|
9418
|
-
this.btnClick = this.btnClick.bind(this);
|
|
9419
9522
|
this.bind(["touchend", "click"], this.btnClick);
|
|
9420
|
-
this.
|
|
9421
|
-
_this.animate(player.paused);
|
|
9422
|
-
});
|
|
9423
|
-
this.on(PLAY, function() {
|
|
9424
|
-
_this.animate(player.paused);
|
|
9425
|
-
});
|
|
9523
|
+
this.listenEvents();
|
|
9426
9524
|
this.animate(true);
|
|
9427
9525
|
}
|
|
9526
|
+
}, {
|
|
9527
|
+
key: "listenEvents",
|
|
9528
|
+
value: function listenEvents() {
|
|
9529
|
+
var _this2 = this;
|
|
9530
|
+
var player = this.player;
|
|
9531
|
+
this.on([PLAY, PAUSE, ERROR, EMPTIED], function() {
|
|
9532
|
+
_this2.animate(player.paused);
|
|
9533
|
+
});
|
|
9534
|
+
}
|
|
9428
9535
|
}, {
|
|
9429
9536
|
key: "registerIcons",
|
|
9430
9537
|
value: function registerIcons() {
|
|
@@ -9439,28 +9546,6 @@ var __publicField = (obj, key, value) => {
|
|
|
9439
9546
|
}
|
|
9440
9547
|
};
|
|
9441
9548
|
}
|
|
9442
|
-
}, {
|
|
9443
|
-
key: "btnClick",
|
|
9444
|
-
value: function btnClick(e2) {
|
|
9445
|
-
e2.preventDefault();
|
|
9446
|
-
e2.stopPropagation();
|
|
9447
|
-
var player = this.player;
|
|
9448
|
-
this.emitUserAction(e2, "switch_play_pause", {
|
|
9449
|
-
prop: "paused",
|
|
9450
|
-
from: player.paused,
|
|
9451
|
-
to: !player.paused
|
|
9452
|
-
});
|
|
9453
|
-
if (player.ended) {
|
|
9454
|
-
player.replay();
|
|
9455
|
-
} else if (player.paused) {
|
|
9456
|
-
player.play();
|
|
9457
|
-
this.animate(false);
|
|
9458
|
-
} else {
|
|
9459
|
-
player.pause();
|
|
9460
|
-
this.animate(true);
|
|
9461
|
-
}
|
|
9462
|
-
return false;
|
|
9463
|
-
}
|
|
9464
9549
|
}, {
|
|
9465
9550
|
key: "initIcons",
|
|
9466
9551
|
value: function initIcons() {
|
|
@@ -11579,10 +11664,10 @@ var __publicField = (obj, key, value) => {
|
|
|
11579
11664
|
const { controls } = this.player;
|
|
11580
11665
|
const { listType } = this.config;
|
|
11581
11666
|
if (isActive) {
|
|
11582
|
-
listType && MODAL_TYPES.includes(listType) ? controls.blur() : controls.focus();
|
|
11667
|
+
listType && MODAL_TYPES.includes(listType) ? controls == null ? void 0 : controls.blur() : controls == null ? void 0 : controls.focus();
|
|
11583
11668
|
this.optionsList && this.optionsList.show();
|
|
11584
11669
|
} else {
|
|
11585
|
-
listType && MODAL_TYPES.includes(listType) ? controls.focus() : controls.focusAwhile();
|
|
11670
|
+
listType && MODAL_TYPES.includes(listType) ? controls == null ? void 0 : controls.focus() : controls == null ? void 0 : controls.focusAwhile();
|
|
11586
11671
|
this.optionsList && this.optionsList.hide();
|
|
11587
11672
|
}
|
|
11588
11673
|
this._isActive = isActive;
|
|
@@ -13746,7 +13831,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13746
13831
|
* @returns
|
|
13747
13832
|
*/
|
|
13748
13833
|
get playerVersion() {
|
|
13749
|
-
return "2.4.
|
|
13834
|
+
return "2.4.3-rc.0";
|
|
13750
13835
|
}
|
|
13751
13836
|
/** {zh}
|
|
13752
13837
|
* @brief 获取当前播放视频的清晰度唯一标识(definition)。
|
|
@@ -21998,10 +22083,10 @@ var __publicField = (obj, key, value) => {
|
|
|
21998
22083
|
user_id: this._userId,
|
|
21999
22084
|
device_id: this._deviceId,
|
|
22000
22085
|
ext: {
|
|
22001
|
-
veplayer_version: "2.4.
|
|
22002
|
-
flv_version: "
|
|
22003
|
-
hls_version: "
|
|
22004
|
-
rts_version: "0.2.1-alpha.
|
|
22086
|
+
veplayer_version: "2.4.3-rc.0",
|
|
22087
|
+
flv_version: "v3.0.20-rc.6",
|
|
22088
|
+
hls_version: "v3.0.20-rc.6",
|
|
22089
|
+
rts_version: "0.2.1-alpha.0"
|
|
22005
22090
|
}
|
|
22006
22091
|
});
|
|
22007
22092
|
}
|