@volcengine/veplayer 2.4.3-rc.1 → 2.4.5-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 +79 -83
- package/esm/veplayer.biz.live.development.js +66 -19
- package/esm/veplayer.biz.live.production.js +1 -1
- package/esm/veplayer.d.ts +1212 -322
- package/esm/veplayer.development.js +233 -247
- package/esm/veplayer.live.d.ts +1212 -322
- package/esm/veplayer.live.development.js +233 -247
- package/esm/veplayer.live.production.js +3 -3
- package/esm/veplayer.production.js +3 -3
- package/esm/veplayer.vod.d.ts +79 -83
- package/esm/veplayer.vod.development.js +166 -227
- package/esm/veplayer.vod.production.js +2 -2
- package/package.json +1 -1
- package/umd/index.d.ts +79 -83
- package/umd/veplayer.biz.live.development.js +66 -19
- package/umd/veplayer.biz.live.production.js +1 -1
- package/umd/veplayer.d.ts +1212 -322
- package/umd/veplayer.development.js +233 -247
- package/umd/veplayer.live.d.ts +1212 -322
- package/umd/veplayer.live.development.js +233 -247
- package/umd/veplayer.live.production.js +1 -1
- package/umd/veplayer.production.js +1 -1
- package/umd/veplayer.vod.d.ts +79 -83
- package/umd/veplayer.vod.development.js +166 -227
- package/umd/veplayer.vod.production.js +1 -1
- package/veplayer.d.ts +1212 -322
- package/veplayer.live.d.ts +1212 -322
- package/veplayer.vod.d.ts +79 -83
|
@@ -1312,7 +1312,7 @@ var VERSION_REG = {
|
|
|
1312
1312
|
android: /(Android)\s([\d.]+)/,
|
|
1313
1313
|
ios: /(Version)\/([\d.]+)/
|
|
1314
1314
|
};
|
|
1315
|
-
var H264_MIMETYPES = ["avc1.42E01E, mp4a.40.2", "avc1.58A01E, mp4a.40.2", "avc1.4D401E, mp4a.40.2", "avc1.64001E, mp4a.40.2", "avc1.42E01E", "mp4v.20.8", "mp4v.20.8, mp4a.40.2", "mp4v.20.240, mp4a.40.2"];
|
|
1315
|
+
var H264_MIMETYPES = ["avc1.42E01E, mp4a.40.2", "avc1.58A01E, mp4a.40.2", "avc1.4D401E, mp4a.40.2", "avc1.64001E, mp4a.40.2", "avc1.42E01E", "mp4v.20.8", "avc1.42E01E, mp4a.40.2", "avc1.58A01E, mp4a.40.2", "avc1.4D401E, mp4a.40.2", "avc1.64001E, mp4a.40.2", "mp4v.20.8, mp4a.40.2", "mp4v.20.240, mp4a.40.2"];
|
|
1316
1316
|
var sniffer$1 = {
|
|
1317
1317
|
get device() {
|
|
1318
1318
|
var r2 = sniffer$1.os;
|
|
@@ -1457,7 +1457,7 @@ var sniffer$1 = {
|
|
|
1457
1457
|
}
|
|
1458
1458
|
}
|
|
1459
1459
|
};
|
|
1460
|
-
var version = "3.0.
|
|
1460
|
+
var version = "3.0.19-rc.0";
|
|
1461
1461
|
var ERROR_TYPE_MAP = {
|
|
1462
1462
|
1: "media",
|
|
1463
1463
|
2: "media",
|
|
@@ -2427,7 +2427,8 @@ function hook(hookName, handler) {
|
|
|
2427
2427
|
}
|
|
2428
2428
|
if (this.__hooks && this.__hooks[hookName]) {
|
|
2429
2429
|
try {
|
|
2430
|
-
var
|
|
2430
|
+
var _this$__hooks$hookNam;
|
|
2431
|
+
var preRet = (_this$__hooks$hookNam = this.__hooks[hookName]).call.apply(_this$__hooks$hookNam, [this, this].concat(Array.prototype.slice.call(arguments)));
|
|
2431
2432
|
if (preRet) {
|
|
2432
2433
|
if (preRet.then) {
|
|
2433
2434
|
preRet.then(function(isContinue) {
|
|
@@ -2452,19 +2453,6 @@ function hook(hookName, handler) {
|
|
|
2452
2453
|
}
|
|
2453
2454
|
}.bind(this);
|
|
2454
2455
|
}
|
|
2455
|
-
function findHookIndex(hookName, handler) {
|
|
2456
|
-
var __hooks = this.__hooks;
|
|
2457
|
-
if (!__hooks || !Array.isArray(__hooks[hookName])) {
|
|
2458
|
-
return -1;
|
|
2459
|
-
}
|
|
2460
|
-
var hookHandlers = __hooks[hookName];
|
|
2461
|
-
for (var i2 = 0; i2 < hookHandlers.length; i2++) {
|
|
2462
|
-
if (hookHandlers[i2] === handler) {
|
|
2463
|
-
return i2;
|
|
2464
|
-
}
|
|
2465
|
-
}
|
|
2466
|
-
return -1;
|
|
2467
|
-
}
|
|
2468
2456
|
function useHooks(hookName, handler) {
|
|
2469
2457
|
var __hooks = this.__hooks;
|
|
2470
2458
|
if (!__hooks) {
|
|
@@ -2474,12 +2462,7 @@ function useHooks(hookName, handler) {
|
|
|
2474
2462
|
console.warn("has no supported hook which name [".concat(hookName, "]"));
|
|
2475
2463
|
return false;
|
|
2476
2464
|
}
|
|
2477
|
-
|
|
2478
|
-
__hooks[hookName] = [];
|
|
2479
|
-
}
|
|
2480
|
-
if (findHookIndex.call(this, hookName, handler) === -1) {
|
|
2481
|
-
__hooks[hookName].push(handler);
|
|
2482
|
-
}
|
|
2465
|
+
__hooks && (__hooks[hookName] = handler);
|
|
2483
2466
|
return true;
|
|
2484
2467
|
}
|
|
2485
2468
|
function removeHooks(hookName, handler) {
|
|
@@ -2487,13 +2470,6 @@ function removeHooks(hookName, handler) {
|
|
|
2487
2470
|
if (!__hooks) {
|
|
2488
2471
|
return;
|
|
2489
2472
|
}
|
|
2490
|
-
if (Array.isArray(__hooks[hookName])) {
|
|
2491
|
-
var hooks = __hooks[hookName];
|
|
2492
|
-
var index = findHookIndex.call(this, hookName, handler);
|
|
2493
|
-
if (index !== -1) {
|
|
2494
|
-
hooks.splice(index, 1);
|
|
2495
|
-
}
|
|
2496
|
-
}
|
|
2497
2473
|
delete __hooks[hookName];
|
|
2498
2474
|
}
|
|
2499
2475
|
function usePluginHooks(pluginName) {
|
|
@@ -2541,30 +2517,18 @@ function runHooks(obj, hookName, handler) {
|
|
|
2541
2517
|
for (var _len5 = arguments.length, args = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
|
|
2542
2518
|
args[_key5 - 3] = arguments[_key5];
|
|
2543
2519
|
}
|
|
2544
|
-
if (obj.__hooks &&
|
|
2545
|
-
var
|
|
2546
|
-
var
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
}
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
var ret = hook2.call.apply(hook2, [obj2, obj2].concat(args2));
|
|
2557
|
-
if (ret && ret.then) {
|
|
2558
|
-
return ret.then(function(data) {
|
|
2559
|
-
return data === false ? null : runHooksRecursive2.apply(void 0, [obj2, hookName2, handler2].concat(args2));
|
|
2560
|
-
}).catch(function(e3) {
|
|
2561
|
-
console.warn("[runHooks]".concat(hookName2, " reject"), e3.message);
|
|
2562
|
-
});
|
|
2563
|
-
} else if (ret !== false) {
|
|
2564
|
-
return runHooksRecursive2.apply(void 0, [obj2, hookName2, handler2].concat(args2));
|
|
2565
|
-
}
|
|
2566
|
-
};
|
|
2567
|
-
return runHooksRecursive.apply(void 0, [obj, hookName, handler].concat(args));
|
|
2520
|
+
if (obj.__hooks && obj.__hooks[hookName]) {
|
|
2521
|
+
var _obj$__hooks$hookName;
|
|
2522
|
+
var ret = (_obj$__hooks$hookName = obj.__hooks[hookName]).call.apply(_obj$__hooks$hookName, [obj, obj].concat(args));
|
|
2523
|
+
if (ret && ret.then) {
|
|
2524
|
+
ret.then(function(data) {
|
|
2525
|
+
return data === false ? null : handler.call.apply(handler, [obj, obj].concat(args));
|
|
2526
|
+
}).catch(function(e3) {
|
|
2527
|
+
console.warn("[runHooks]".concat(hookName, " reject"), e3.message);
|
|
2528
|
+
});
|
|
2529
|
+
} else if (ret !== false) {
|
|
2530
|
+
return handler.call.apply(handler, [obj, obj].concat(args));
|
|
2531
|
+
}
|
|
2568
2532
|
} else {
|
|
2569
2533
|
return handler.call.apply(handler, [obj, obj].concat(args));
|
|
2570
2534
|
}
|
|
@@ -2808,18 +2772,6 @@ var BasePlugin = /* @__PURE__ */ function() {
|
|
|
2808
2772
|
}
|
|
2809
2773
|
}
|
|
2810
2774
|
}
|
|
2811
|
-
}, {
|
|
2812
|
-
key: "defineMethod",
|
|
2813
|
-
value: function defineMethod(Obj, map) {
|
|
2814
|
-
for (var key in map) {
|
|
2815
|
-
if (Object.prototype.hasOwnProperty.call(map, key) && typeof map[key] === "function") {
|
|
2816
|
-
Object.defineProperty(Obj, key, {
|
|
2817
|
-
configurable: true,
|
|
2818
|
-
value: map[key]
|
|
2819
|
-
});
|
|
2820
|
-
}
|
|
2821
|
-
}
|
|
2822
|
-
}
|
|
2823
2775
|
}, {
|
|
2824
2776
|
key: "defaultConfig",
|
|
2825
2777
|
get: function get() {
|
|
@@ -3465,7 +3417,7 @@ var ResizeObserver = /* @__PURE__ */ function() {
|
|
|
3465
3417
|
if (!this.observer) {
|
|
3466
3418
|
return;
|
|
3467
3419
|
}
|
|
3468
|
-
this.observer.observe(target);
|
|
3420
|
+
this.observer && this.observer.observe(target);
|
|
3469
3421
|
var _pid = target.getAttribute(PLATER_ID);
|
|
3470
3422
|
var __handlers = this.__handlers;
|
|
3471
3423
|
var index = -1;
|
|
@@ -3494,17 +3446,16 @@ var ResizeObserver = /* @__PURE__ */ function() {
|
|
|
3494
3446
|
}
|
|
3495
3447
|
});
|
|
3496
3448
|
try {
|
|
3497
|
-
|
|
3498
|
-
(_this$observer = this.observer) === null || _this$observer === void 0 ? void 0 : _this$observer.unobserve(target);
|
|
3449
|
+
this.observer && this.observer.unobserve(target);
|
|
3499
3450
|
} catch (e3) {
|
|
3500
3451
|
}
|
|
3452
|
+
this.observer && this.observer.unobserve(target);
|
|
3501
3453
|
i2 > -1 && this.__handlers.splice(i2, 1);
|
|
3502
3454
|
}
|
|
3503
3455
|
}, {
|
|
3504
3456
|
key: "destroyObserver",
|
|
3505
3457
|
value: function destroyObserver() {
|
|
3506
|
-
|
|
3507
|
-
(_this$observer2 = this.observer) === null || _this$observer2 === void 0 ? void 0 : _this$observer2.disconnect();
|
|
3458
|
+
this.observer && this.observer.disconnect();
|
|
3508
3459
|
this.observer = null;
|
|
3509
3460
|
this.__handlers = null;
|
|
3510
3461
|
}
|
|
@@ -3536,8 +3487,7 @@ function addObserver(target, handler) {
|
|
|
3536
3487
|
return resizeObserver;
|
|
3537
3488
|
}
|
|
3538
3489
|
function unObserver(target, handler) {
|
|
3539
|
-
|
|
3540
|
-
(_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 ? void 0 : _resizeObserver.unObserver(target, handler);
|
|
3490
|
+
resizeObserver.unObserver(target, handler);
|
|
3541
3491
|
}
|
|
3542
3492
|
var pluginsManager = {
|
|
3543
3493
|
pluginGroup: {},
|
|
@@ -4535,7 +4485,10 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4535
4485
|
}
|
|
4536
4486
|
var _this$config = _this.config, autoplay2 = _this$config.autoplay, defaultPlaybackRate = _this$config.defaultPlaybackRate;
|
|
4537
4487
|
XG_DEBUG.logInfo("player", "canPlayFunc, startTime", _this.__startTime);
|
|
4538
|
-
_this.
|
|
4488
|
+
if (_this.__startTime > 0 && _this.duration > 0) {
|
|
4489
|
+
_this.currentTime = _this.__startTime > _this.duration ? _this.duration : _this.__startTime;
|
|
4490
|
+
_this.__startTime = -1;
|
|
4491
|
+
}
|
|
4539
4492
|
_this.playbackRate = defaultPlaybackRate;
|
|
4540
4493
|
(autoplay2 || _this._useAutoplay) && _this.mediaPlay();
|
|
4541
4494
|
_this.off(CANPLAY, _this.canPlayFunc);
|
|
@@ -4625,7 +4578,6 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4625
4578
|
_this.waitTimer = null;
|
|
4626
4579
|
_this.handleSource = true;
|
|
4627
4580
|
_this._state = STATES.INITIAL;
|
|
4628
|
-
_this.isAd = false;
|
|
4629
4581
|
_this.isError = false;
|
|
4630
4582
|
_this._hasStart = false;
|
|
4631
4583
|
_this.isSeeking = false;
|
|
@@ -5010,8 +4962,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5010
4962
|
_pConfig.position && (options.position = _pConfig.position);
|
|
5011
4963
|
var position = options.position ? options.position : options.config && options.config.position || PLUFGIN.defaultConfig && PLUFGIN.defaultConfig.position;
|
|
5012
4964
|
if (!options.root && typeof position === "string" && position.indexOf("controls") > -1) {
|
|
5013
|
-
|
|
5014
|
-
return (_this$controls = this.controls) === null || _this$controls === void 0 ? void 0 : _this$controls.registerPlugin(PLUFGIN, options, PLUFGIN.pluginName);
|
|
4965
|
+
return this.controls && this.controls.registerPlugin(PLUFGIN, options, PLUFGIN.pluginName);
|
|
5015
4966
|
}
|
|
5016
4967
|
if (!options.root) {
|
|
5017
4968
|
options.root = this._getRootByPosition(position);
|
|
@@ -5159,7 +5110,10 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5159
5110
|
reject(e3);
|
|
5160
5111
|
};
|
|
5161
5112
|
var _canplay = function _canplay2() {
|
|
5162
|
-
_this9.
|
|
5113
|
+
if (_this9.duration > 0 && _this9.__startTime > 0) {
|
|
5114
|
+
_this9.currentTime = _this9.__startTime;
|
|
5115
|
+
_this9.__startTime = -1;
|
|
5116
|
+
}
|
|
5163
5117
|
if (isPaused) {
|
|
5164
5118
|
_this9.pause();
|
|
5165
5119
|
}
|
|
@@ -5780,17 +5734,11 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5780
5734
|
}, {
|
|
5781
5735
|
key: "onLoadeddata",
|
|
5782
5736
|
value: function onLoadeddata() {
|
|
5783
|
-
var _this22 = this;
|
|
5784
5737
|
this.isError = false;
|
|
5785
5738
|
this.isSeeking = false;
|
|
5786
|
-
if (this.__startTime > 0) {
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
} else {
|
|
5790
|
-
this.once(DURATION_CHANGE, function() {
|
|
5791
|
-
_this22._seekToStartTime();
|
|
5792
|
-
});
|
|
5793
|
-
}
|
|
5739
|
+
if (this.__startTime > 0 && this.duration > 0) {
|
|
5740
|
+
this.currentTime = this.__startTime;
|
|
5741
|
+
this.__startTime = -1;
|
|
5794
5742
|
}
|
|
5795
5743
|
}
|
|
5796
5744
|
}, {
|
|
@@ -5859,27 +5807,27 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5859
5807
|
}, {
|
|
5860
5808
|
key: "onWaiting",
|
|
5861
5809
|
value: function onWaiting() {
|
|
5862
|
-
var
|
|
5810
|
+
var _this22 = this;
|
|
5863
5811
|
if (this.waitTimer) {
|
|
5864
5812
|
util$1.clearTimeout(this, this.waitTimer);
|
|
5865
5813
|
}
|
|
5866
5814
|
this.updateAcc("waiting");
|
|
5867
5815
|
this.waitTimer = util$1.setTimeout(this, function() {
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
util$1.clearTimeout(
|
|
5871
|
-
|
|
5816
|
+
_this22.addClass(STATE_CLASS.LOADING);
|
|
5817
|
+
_this22.emit(LOADING);
|
|
5818
|
+
util$1.clearTimeout(_this22, _this22.waitTimer);
|
|
5819
|
+
_this22.waitTimer = null;
|
|
5872
5820
|
}, this.config.minWaitDelay);
|
|
5873
5821
|
}
|
|
5874
5822
|
}, {
|
|
5875
5823
|
key: "onPlaying",
|
|
5876
5824
|
value: function onPlaying() {
|
|
5877
|
-
var
|
|
5825
|
+
var _this23 = this;
|
|
5878
5826
|
this.isError = false;
|
|
5879
5827
|
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;
|
|
5880
5828
|
var clsList = [NO_START, PAUSED, ENDED2, ERROR2, REPLAY2, LOADING2];
|
|
5881
5829
|
clsList.forEach(function(cls) {
|
|
5882
|
-
|
|
5830
|
+
_this23.removeClass(cls);
|
|
5883
5831
|
});
|
|
5884
5832
|
if (!this._accPlayed.t && !this.paused && !this.ended) {
|
|
5885
5833
|
this._accPlayed.t = (/* @__PURE__ */ new Date()).getTime();
|
|
@@ -6040,14 +5988,14 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6040
5988
|
}, {
|
|
6041
5989
|
key: "setConfig",
|
|
6042
5990
|
value: function setConfig(config) {
|
|
6043
|
-
var
|
|
5991
|
+
var _this24 = this;
|
|
6044
5992
|
if (!config) {
|
|
6045
5993
|
return;
|
|
6046
5994
|
}
|
|
6047
5995
|
Object.keys(config).map(function(key) {
|
|
6048
5996
|
if (key !== "plugins") {
|
|
6049
|
-
|
|
6050
|
-
var plugin =
|
|
5997
|
+
_this24.config[key] = config[key];
|
|
5998
|
+
var plugin = _this24.plugins[key.toLowerCase()];
|
|
6051
5999
|
if (plugin && util$1.typeOf(plugin.setConfig) === "Function") {
|
|
6052
6000
|
plugin.setConfig(config[key]);
|
|
6053
6001
|
}
|
|
@@ -6057,20 +6005,20 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6057
6005
|
}, {
|
|
6058
6006
|
key: "playNext",
|
|
6059
6007
|
value: function playNext(config) {
|
|
6060
|
-
var
|
|
6008
|
+
var _this25 = this;
|
|
6061
6009
|
this.resetState();
|
|
6062
6010
|
this.setConfig(config);
|
|
6063
6011
|
this._currentTime = 0;
|
|
6064
6012
|
this._duration = 0;
|
|
6065
6013
|
runHooks(this, "playnext", function() {
|
|
6066
|
-
|
|
6067
|
-
|
|
6014
|
+
_this25.start();
|
|
6015
|
+
_this25.emit(PLAYNEXT, config);
|
|
6068
6016
|
});
|
|
6069
6017
|
}
|
|
6070
6018
|
}, {
|
|
6071
6019
|
key: "resize",
|
|
6072
6020
|
value: function resize() {
|
|
6073
|
-
var
|
|
6021
|
+
var _this26 = this;
|
|
6074
6022
|
if (!this.media) {
|
|
6075
6023
|
return;
|
|
6076
6024
|
}
|
|
@@ -6110,7 +6058,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6110
6058
|
}
|
|
6111
6059
|
if (!this.fullscreen && !this.cssfullscreen) {
|
|
6112
6060
|
Object.keys(_style).forEach(function(key) {
|
|
6113
|
-
|
|
6061
|
+
_this26.root.style[key] = _style[key];
|
|
6114
6062
|
});
|
|
6115
6063
|
}
|
|
6116
6064
|
if (videoFillMode === "fillHeight" && fit < videoFit || videoFillMode === "fillWidth" && fit > videoFit) {
|
|
@@ -6152,14 +6100,6 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6152
6100
|
url
|
|
6153
6101
|
};
|
|
6154
6102
|
}
|
|
6155
|
-
}, {
|
|
6156
|
-
key: "_seekToStartTime",
|
|
6157
|
-
value: function _seekToStartTime() {
|
|
6158
|
-
if (this.__startTime > 0 && this.duration > 0) {
|
|
6159
|
-
this.currentTime = this.__startTime > this.duration ? this.duration : this.__startTime;
|
|
6160
|
-
this.__startTime = -1;
|
|
6161
|
-
}
|
|
6162
|
-
}
|
|
6163
6103
|
}, {
|
|
6164
6104
|
key: "state",
|
|
6165
6105
|
get: function get() {
|
|
@@ -6210,15 +6150,15 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6210
6150
|
return this.config.definition.list || [];
|
|
6211
6151
|
},
|
|
6212
6152
|
set: function set(list) {
|
|
6213
|
-
var
|
|
6153
|
+
var _this27 = this;
|
|
6214
6154
|
var definition = this.config.definition;
|
|
6215
6155
|
var curDef = null;
|
|
6216
6156
|
var targetDef = null;
|
|
6217
6157
|
definition.list = list;
|
|
6218
6158
|
this.emit("resourceReady", list);
|
|
6219
6159
|
list.forEach(function(item) {
|
|
6220
|
-
var
|
|
6221
|
-
if (((
|
|
6160
|
+
var _this27$curDefinition;
|
|
6161
|
+
if (((_this27$curDefinition = _this27.curDefinition) === null || _this27$curDefinition === void 0 ? void 0 : _this27$curDefinition.definition) === item.definition) {
|
|
6222
6162
|
curDef = item;
|
|
6223
6163
|
}
|
|
6224
6164
|
if (definition.defaultDefinition === item.definition) {
|
|
@@ -6730,11 +6670,11 @@ let VeError$1 = class VeError extends Error {
|
|
|
6730
6670
|
} : error2;
|
|
6731
6671
|
const message = (i18n == null ? void 0 : i18n.getText(errorInfo == null ? void 0 : errorInfo.messageTextKey)) ?? (errorInfo == null ? void 0 : errorInfo.message) ?? ((_a = errorInfo == null ? void 0 : errorInfo.error) == null ? void 0 : _a.message) ?? (i18n == null ? void 0 : i18n.getText("UNKNOWN"));
|
|
6732
6672
|
super(message);
|
|
6733
|
-
/**
|
|
6673
|
+
/** {zh}
|
|
6734
6674
|
* @brief 错误码。
|
|
6735
6675
|
*/
|
|
6736
6676
|
/** {en}
|
|
6737
|
-
* @brief
|
|
6677
|
+
* @brief Error code.
|
|
6738
6678
|
*/
|
|
6739
6679
|
__publicField(this, "errorCode");
|
|
6740
6680
|
/** {zh}
|
|
@@ -6982,7 +6922,7 @@ var Start = /* @__PURE__ */ function(_Plugin) {
|
|
|
6982
6922
|
var className = _this.config.mode === "auto" ? "auto-hide" : "hide";
|
|
6983
6923
|
util$1.addClass(_this.root, className);
|
|
6984
6924
|
_this.autoPlayStart = true;
|
|
6985
|
-
_this.
|
|
6925
|
+
_this.onPlayPause("play");
|
|
6986
6926
|
});
|
|
6987
6927
|
_this.autoPlayStart = false;
|
|
6988
6928
|
return _this;
|
|
@@ -6990,19 +6930,9 @@ var Start = /* @__PURE__ */ function(_Plugin) {
|
|
|
6990
6930
|
_createClass$1(Start2, [{
|
|
6991
6931
|
key: "afterCreate",
|
|
6992
6932
|
value: function afterCreate() {
|
|
6993
|
-
var playerConfig = this.playerConfig;
|
|
6994
|
-
this.initIcons();
|
|
6995
|
-
this.listenEvents();
|
|
6996
|
-
this.bindClickEvents();
|
|
6997
|
-
if (!playerConfig.autoplay) {
|
|
6998
|
-
this.show();
|
|
6999
|
-
}
|
|
7000
|
-
}
|
|
7001
|
-
}, {
|
|
7002
|
-
key: "listenEvents",
|
|
7003
|
-
value: function listenEvents() {
|
|
7004
6933
|
var _this2 = this;
|
|
7005
6934
|
var player = this.player, playerConfig = this.playerConfig;
|
|
6935
|
+
this.initIcons();
|
|
7006
6936
|
this.once(READY, function() {
|
|
7007
6937
|
if (playerConfig) {
|
|
7008
6938
|
if (playerConfig.lang && playerConfig.lang === "en") {
|
|
@@ -7013,6 +6943,9 @@ var Start = /* @__PURE__ */ function(_Plugin) {
|
|
|
7013
6943
|
}
|
|
7014
6944
|
});
|
|
7015
6945
|
this.on(AUTOPLAY_STARTED, this.onAutoplayStart);
|
|
6946
|
+
if (!playerConfig.autoplay) {
|
|
6947
|
+
this.show();
|
|
6948
|
+
}
|
|
7016
6949
|
this.on(AUTOPLAY_PREVENTED, function() {
|
|
7017
6950
|
var className = _this2.config.mode === "auto" ? "auto-hide" : "hide";
|
|
7018
6951
|
_this2.setAttr("data-state", "play");
|
|
@@ -7020,25 +6953,20 @@ var Start = /* @__PURE__ */ function(_Plugin) {
|
|
|
7020
6953
|
_this2.show();
|
|
7021
6954
|
});
|
|
7022
6955
|
this.on(PLAY, function() {
|
|
7023
|
-
_this2.
|
|
6956
|
+
_this2.onPlayPause("play");
|
|
7024
6957
|
});
|
|
7025
6958
|
this.on(PAUSE, function() {
|
|
7026
|
-
_this2.
|
|
6959
|
+
_this2.onPlayPause("pause");
|
|
7027
6960
|
});
|
|
7028
6961
|
this.on(RESET, function() {
|
|
7029
6962
|
_this2.onPlayerReset();
|
|
7030
6963
|
});
|
|
7031
|
-
}
|
|
7032
|
-
}, {
|
|
7033
|
-
key: "bindClickEvents",
|
|
7034
|
-
value: function bindClickEvents() {
|
|
7035
|
-
var _this3 = this;
|
|
7036
6964
|
this.clickHandler = this.hook("startClick", this.switchPausePlay, {
|
|
7037
6965
|
pre: function pre(e3) {
|
|
7038
6966
|
e3.cancelable && e3.preventDefault();
|
|
7039
6967
|
e3.stopPropagation();
|
|
7040
|
-
var paused =
|
|
7041
|
-
|
|
6968
|
+
var paused = _this2.player.paused;
|
|
6969
|
+
_this2.emitUserAction(e3, "switch_play_pause", {
|
|
7042
6970
|
props: "paused",
|
|
7043
6971
|
from: paused,
|
|
7044
6972
|
to: !paused
|
|
@@ -7100,17 +7028,17 @@ var Start = /* @__PURE__ */ function(_Plugin) {
|
|
|
7100
7028
|
}, {
|
|
7101
7029
|
key: "animate",
|
|
7102
7030
|
value: function animate(endShow) {
|
|
7103
|
-
var
|
|
7031
|
+
var _this3 = this;
|
|
7104
7032
|
this._animateId = addAnimate("pauseplay", 400, {
|
|
7105
7033
|
start: function start() {
|
|
7106
|
-
util$1.addClass(
|
|
7107
|
-
|
|
7108
|
-
|
|
7034
|
+
util$1.addClass(_this3.root, "interact");
|
|
7035
|
+
_this3.show();
|
|
7036
|
+
_this3.switchStatus(true);
|
|
7109
7037
|
},
|
|
7110
7038
|
end: function end() {
|
|
7111
|
-
util$1.removeClass(
|
|
7112
|
-
!endShow &&
|
|
7113
|
-
|
|
7039
|
+
util$1.removeClass(_this3.root, "interact");
|
|
7040
|
+
!endShow && _this3.hide();
|
|
7041
|
+
_this3._animateId = null;
|
|
7114
7042
|
}
|
|
7115
7043
|
});
|
|
7116
7044
|
}
|
|
@@ -7140,11 +7068,6 @@ var Start = /* @__PURE__ */ function(_Plugin) {
|
|
|
7140
7068
|
}, {
|
|
7141
7069
|
key: "onPlayPause",
|
|
7142
7070
|
value: function onPlayPause(status) {
|
|
7143
|
-
this.toggleTo(status);
|
|
7144
|
-
}
|
|
7145
|
-
}, {
|
|
7146
|
-
key: "toggleTo",
|
|
7147
|
-
value: function toggleTo(status) {
|
|
7148
7071
|
var config = this.config, player = this.player;
|
|
7149
7072
|
if (!player || player.state < STATES.RUNNING || !this.autoPlayStart) {
|
|
7150
7073
|
return;
|
|
@@ -8520,7 +8443,7 @@ var MobilePlugin = /* @__PURE__ */ function(_Plugin) {
|
|
|
8520
8443
|
}
|
|
8521
8444
|
this.on(DURATION_CHANGE, function() {
|
|
8522
8445
|
var player2 = _this2.player, config2 = _this2.config;
|
|
8523
|
-
if (player2.duration
|
|
8446
|
+
if (player2.duration * 1e3 < config2.moveDuration) {
|
|
8524
8447
|
config2.moveDuration = player2.duration * 1e3;
|
|
8525
8448
|
}
|
|
8526
8449
|
});
|
|
@@ -8834,13 +8757,10 @@ var MobilePlugin = /* @__PURE__ */ function(_Plugin) {
|
|
|
8834
8757
|
}, {
|
|
8835
8758
|
key: "updateBrightness",
|
|
8836
8759
|
value: function updateBrightness(percent) {
|
|
8837
|
-
var pos = this.pos, config = this.config, xgMask = this.xgMask;
|
|
8838
|
-
if (!config.darkness) {
|
|
8839
|
-
return;
|
|
8840
|
-
}
|
|
8841
8760
|
if (this.player.rotateDeg) {
|
|
8842
8761
|
percent = -percent;
|
|
8843
8762
|
}
|
|
8763
|
+
var pos = this.pos, config = this.config, xgMask = this.xgMask;
|
|
8844
8764
|
var light = pos.light + 0.8 * percent;
|
|
8845
8765
|
light = light > config.maxDarkness ? config.maxDarkness : light < 0 ? 0 : light;
|
|
8846
8766
|
if (xgMask) {
|
|
@@ -8901,12 +8821,12 @@ var MobilePlugin = /* @__PURE__ */ function(_Plugin) {
|
|
|
8901
8821
|
}, {
|
|
8902
8822
|
key: "disableGesture",
|
|
8903
8823
|
value: function disableGesture() {
|
|
8904
|
-
this.config.disableGesture =
|
|
8824
|
+
this.config.disableGesture = false;
|
|
8905
8825
|
}
|
|
8906
8826
|
}, {
|
|
8907
8827
|
key: "enableGesture",
|
|
8908
8828
|
value: function enableGesture() {
|
|
8909
|
-
this.config.disableGesture =
|
|
8829
|
+
this.config.disableGesture = true;
|
|
8910
8830
|
}
|
|
8911
8831
|
}, {
|
|
8912
8832
|
key: "destroy",
|
|
@@ -9478,55 +9398,28 @@ var Play$1 = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
9478
9398
|
_inherits(Play2, _IconPlugin);
|
|
9479
9399
|
var _super = _createSuper(Play2);
|
|
9480
9400
|
function Play2() {
|
|
9481
|
-
var _this;
|
|
9482
9401
|
_classCallCheck(this, Play2);
|
|
9483
|
-
|
|
9484
|
-
args[_key] = arguments[_key];
|
|
9485
|
-
}
|
|
9486
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
9487
|
-
_defineProperty$1(_assertThisInitialized(_this), "btnClick", function(e3) {
|
|
9488
|
-
e3.preventDefault();
|
|
9489
|
-
e3.stopPropagation();
|
|
9490
|
-
var _assertThisInitialize = _assertThisInitialized(_this), player = _assertThisInitialize.player;
|
|
9491
|
-
_this.emitUserAction(e3, "switch_play_pause", {
|
|
9492
|
-
prop: "paused",
|
|
9493
|
-
from: player.paused,
|
|
9494
|
-
to: !player.paused
|
|
9495
|
-
});
|
|
9496
|
-
if (player.ended) {
|
|
9497
|
-
player.replay();
|
|
9498
|
-
} else if (player.paused) {
|
|
9499
|
-
player.play();
|
|
9500
|
-
_this.animate(false);
|
|
9501
|
-
} else {
|
|
9502
|
-
player.pause();
|
|
9503
|
-
_this.animate(true);
|
|
9504
|
-
}
|
|
9505
|
-
return false;
|
|
9506
|
-
});
|
|
9507
|
-
return _this;
|
|
9402
|
+
return _super.apply(this, arguments);
|
|
9508
9403
|
}
|
|
9509
9404
|
_createClass$1(Play2, [{
|
|
9510
9405
|
key: "afterCreate",
|
|
9511
9406
|
value: function afterCreate() {
|
|
9407
|
+
var _this = this;
|
|
9512
9408
|
_get(_getPrototypeOf(Play2.prototype), "afterCreate", this).call(this);
|
|
9513
|
-
var config = this.config;
|
|
9409
|
+
var player = this.player, config = this.config;
|
|
9514
9410
|
if (config.disable) {
|
|
9515
9411
|
return;
|
|
9516
9412
|
}
|
|
9517
9413
|
this.initIcons();
|
|
9414
|
+
this.btnClick = this.btnClick.bind(this);
|
|
9518
9415
|
this.bind(["touchend", "click"], this.btnClick);
|
|
9519
|
-
this.
|
|
9520
|
-
|
|
9521
|
-
}
|
|
9522
|
-
}, {
|
|
9523
|
-
key: "listenEvents",
|
|
9524
|
-
value: function listenEvents() {
|
|
9525
|
-
var _this2 = this;
|
|
9526
|
-
var player = this.player;
|
|
9527
|
-
this.on([PLAY, PAUSE, ERROR, EMPTIED], function() {
|
|
9528
|
-
_this2.animate(player.paused);
|
|
9416
|
+
this.on([PAUSE, ERROR, EMPTIED], function() {
|
|
9417
|
+
_this.animate(player.paused);
|
|
9529
9418
|
});
|
|
9419
|
+
this.on(PLAY, function() {
|
|
9420
|
+
_this.animate(player.paused);
|
|
9421
|
+
});
|
|
9422
|
+
this.animate(true);
|
|
9530
9423
|
}
|
|
9531
9424
|
}, {
|
|
9532
9425
|
key: "registerIcons",
|
|
@@ -9542,6 +9435,28 @@ var Play$1 = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
9542
9435
|
}
|
|
9543
9436
|
};
|
|
9544
9437
|
}
|
|
9438
|
+
}, {
|
|
9439
|
+
key: "btnClick",
|
|
9440
|
+
value: function btnClick(e3) {
|
|
9441
|
+
e3.preventDefault();
|
|
9442
|
+
e3.stopPropagation();
|
|
9443
|
+
var player = this.player;
|
|
9444
|
+
this.emitUserAction(e3, "switch_play_pause", {
|
|
9445
|
+
prop: "paused",
|
|
9446
|
+
from: player.paused,
|
|
9447
|
+
to: !player.paused
|
|
9448
|
+
});
|
|
9449
|
+
if (player.ended) {
|
|
9450
|
+
player.replay();
|
|
9451
|
+
} else if (player.paused) {
|
|
9452
|
+
player.play();
|
|
9453
|
+
this.animate(false);
|
|
9454
|
+
} else {
|
|
9455
|
+
player.pause();
|
|
9456
|
+
this.animate(true);
|
|
9457
|
+
}
|
|
9458
|
+
return false;
|
|
9459
|
+
}
|
|
9545
9460
|
}, {
|
|
9546
9461
|
key: "initIcons",
|
|
9547
9462
|
value: function initIcons() {
|
|
@@ -11660,10 +11575,10 @@ class OptionsIcon extends Plugin {
|
|
|
11660
11575
|
const { controls } = this.player;
|
|
11661
11576
|
const { listType } = this.config;
|
|
11662
11577
|
if (isActive) {
|
|
11663
|
-
listType && MODAL_TYPES.includes(listType) ? controls
|
|
11578
|
+
listType && MODAL_TYPES.includes(listType) ? controls.blur() : controls.focus();
|
|
11664
11579
|
this.optionsList && this.optionsList.show();
|
|
11665
11580
|
} else {
|
|
11666
|
-
listType && MODAL_TYPES.includes(listType) ? controls
|
|
11581
|
+
listType && MODAL_TYPES.includes(listType) ? controls.focus() : controls.focusAwhile();
|
|
11667
11582
|
this.optionsList && this.optionsList.hide();
|
|
11668
11583
|
}
|
|
11669
11584
|
this._isActive = isActive;
|
|
@@ -13589,28 +13504,33 @@ const DEFAULT_OPTIONS = {
|
|
|
13589
13504
|
useCssFullscreen: false
|
|
13590
13505
|
}
|
|
13591
13506
|
};
|
|
13592
|
-
const transformOption = (
|
|
13593
|
-
|
|
13594
|
-
|
|
13595
|
-
|
|
13596
|
-
|
|
13597
|
-
|
|
13598
|
-
|
|
13599
|
-
|
|
13600
|
-
|
|
13601
|
-
|
|
13602
|
-
|
|
13603
|
-
|
|
13604
|
-
|
|
13605
|
-
xgOptions.videoAttributes = {
|
|
13606
|
-
...xgOptions.videoAttributes ?? {},
|
|
13607
|
-
muted: autoplay2 == null ? void 0 : autoplay2.muted
|
|
13507
|
+
const transformOption = (
|
|
13508
|
+
/** {zh}
|
|
13509
|
+
* @param options 更多配置信息。
|
|
13510
|
+
*/
|
|
13511
|
+
(options) => {
|
|
13512
|
+
const { autoplay: autoplay2, ...rest } = options;
|
|
13513
|
+
const xgOptions = rest;
|
|
13514
|
+
if (xgOptions.poster) {
|
|
13515
|
+
xgOptions.poster = escapeHtml(xgOptions.poster);
|
|
13516
|
+
}
|
|
13517
|
+
xgOptions.icons = {
|
|
13518
|
+
...DEFAULT_ICONS,
|
|
13519
|
+
...xgOptions.icons ? escapeIcons(xgOptions.icons) : {}
|
|
13608
13520
|
};
|
|
13609
|
-
xgOptions.
|
|
13521
|
+
xgOptions.autoplay = Boolean(autoplay2);
|
|
13522
|
+
if (autoplay2 && typeof autoplay2 !== "boolean") {
|
|
13523
|
+
xgOptions.autoplayMuted = autoplay2 == null ? void 0 : autoplay2.muted;
|
|
13524
|
+
xgOptions.videoAttributes = {
|
|
13525
|
+
...xgOptions.videoAttributes ?? {},
|
|
13526
|
+
muted: autoplay2 == null ? void 0 : autoplay2.muted
|
|
13527
|
+
};
|
|
13528
|
+
xgOptions.autoplayPlugin = autoplay2;
|
|
13529
|
+
}
|
|
13530
|
+
delete xgOptions.i18n;
|
|
13531
|
+
return xgOptions;
|
|
13610
13532
|
}
|
|
13611
|
-
|
|
13612
|
-
return xgOptions;
|
|
13613
|
-
};
|
|
13533
|
+
);
|
|
13614
13534
|
class VePlayerBase {
|
|
13615
13535
|
/** {zh}
|
|
13616
13536
|
* @hidden
|
|
@@ -13630,7 +13550,9 @@ class VePlayerBase {
|
|
|
13630
13550
|
this._sourceManager = options.sourceManager;
|
|
13631
13551
|
this._preparePlugins = options.preparePlugins;
|
|
13632
13552
|
this._previousPrepareResult = options.prepareResult;
|
|
13633
|
-
this._i18nManager = options.i18nManager ?? new VeI18n({
|
|
13553
|
+
this._i18nManager = options.i18nManager ?? new VeI18n({
|
|
13554
|
+
i18n: options.i18n
|
|
13555
|
+
});
|
|
13634
13556
|
const xgOptions = transformOption({
|
|
13635
13557
|
...options,
|
|
13636
13558
|
...(_a = this._previousPrepareResult) == null ? void 0 : _a.options
|
|
@@ -13825,9 +13747,14 @@ class VePlayerBase {
|
|
|
13825
13747
|
/** {zh}
|
|
13826
13748
|
* 获取播放器版本号
|
|
13827
13749
|
* @returns
|
|
13750
|
+
* @brief
|
|
13751
|
+
* 获取播放器 SDK 版本号。
|
|
13752
|
+
*/
|
|
13753
|
+
/** {en}
|
|
13754
|
+
* @brief Retrieve the player SDK version number.
|
|
13828
13755
|
*/
|
|
13829
13756
|
get playerVersion() {
|
|
13830
|
-
return "2.4.
|
|
13757
|
+
return "2.4.5-rc.0";
|
|
13831
13758
|
}
|
|
13832
13759
|
/** {zh}
|
|
13833
13760
|
* @brief 获取当前播放视频的清晰度唯一标识(definition)。
|
|
@@ -13975,8 +13902,8 @@ class VePlayerBase {
|
|
|
13975
13902
|
}
|
|
13976
13903
|
/** {zh}
|
|
13977
13904
|
* @brief 调用此方法切换拉流地址、线路、清晰度。
|
|
13978
|
-
* @param target
|
|
13979
|
-
* @param options
|
|
13905
|
+
* @param target 目标地址,可以是播放地址,也可以是线路和清晰度。
|
|
13906
|
+
* @param options 更多配置信息。
|
|
13980
13907
|
*/
|
|
13981
13908
|
/** {en}
|
|
13982
13909
|
* @brief Switches the pull stream address, playback source, or resolution.
|
|
@@ -13987,7 +13914,9 @@ class VePlayerBase {
|
|
|
13987
13914
|
var _a, _b;
|
|
13988
13915
|
if (typeof target === "string" && this._sourceManager.sources.length === 1 && ((_b = (_a = this._sourceManager.sources) == null ? void 0 : _a[0].definitions) == null ? void 0 : _b.length) === 1) {
|
|
13989
13916
|
this._sourceManager.updateSources(target);
|
|
13990
|
-
await this._switchUrl(target, {
|
|
13917
|
+
await this._switchUrl(target, {
|
|
13918
|
+
seamless: options == null ? void 0 : options.seamless
|
|
13919
|
+
});
|
|
13991
13920
|
return this._sourceManager.definition;
|
|
13992
13921
|
}
|
|
13993
13922
|
const targetDefinition = this._sourceManager.find(target, options);
|
|
@@ -14014,16 +13943,15 @@ class VePlayerBase {
|
|
|
14014
13943
|
return this._switch(sourceManager.definition);
|
|
14015
13944
|
}
|
|
14016
13945
|
// TODO: 等西瓜播放器完善错误码后增加函数重载以提供更好的类型
|
|
14017
|
-
/**
|
|
14018
13946
|
/** {zh}
|
|
14019
13947
|
* @brief 调用此方法监听指定事件,事件处理函数只执行一次。
|
|
14020
13948
|
* @param event 表示事件的名称。
|
|
14021
13949
|
* @param callback 表示事件的回调函数。
|
|
14022
13950
|
*/
|
|
14023
13951
|
/** {en}
|
|
14024
|
-
* @brief
|
|
14025
|
-
* @param event The event
|
|
14026
|
-
* @param callback
|
|
13952
|
+
* @brief Call this method to listen for the specified event. The event handler is executed only once.
|
|
13953
|
+
* @param event The name representing the event.
|
|
13954
|
+
* @param callback Callback functions representing events.
|
|
14027
13955
|
*/
|
|
14028
13956
|
once(event, callback) {
|
|
14029
13957
|
var _a;
|
|
@@ -14174,10 +14102,14 @@ class VePlayerBase {
|
|
|
14174
14102
|
return this._player.blur(data);
|
|
14175
14103
|
}
|
|
14176
14104
|
/** {zh}
|
|
14177
|
-
* @brief
|
|
14178
|
-
* @param type
|
|
14105
|
+
* @brief 判断浏览器是否支持播放格式。
|
|
14106
|
+
* @param type 播放格式。
|
|
14179
14107
|
* @returns
|
|
14180
14108
|
*/
|
|
14109
|
+
/** {en}
|
|
14110
|
+
* @brief Determine whether the browser supports the playback format.
|
|
14111
|
+
* @param type The playback format.
|
|
14112
|
+
*/
|
|
14181
14113
|
canPlayType(type) {
|
|
14182
14114
|
return this._player.canPlayType(type);
|
|
14183
14115
|
}
|
|
@@ -14249,7 +14181,7 @@ class VePlayerBase {
|
|
|
14249
14181
|
}
|
|
14250
14182
|
/** {zh}
|
|
14251
14183
|
* @brief 调用此接口显示指定插件图标。
|
|
14252
|
-
* @param pluginNames
|
|
14184
|
+
* @param pluginNames 插件名称。
|
|
14253
14185
|
*/
|
|
14254
14186
|
/** {en}
|
|
14255
14187
|
* @brief Displays the icon of a specified plugin.
|
|
@@ -14270,7 +14202,7 @@ class VePlayerBase {
|
|
|
14270
14202
|
}
|
|
14271
14203
|
/** {zh}
|
|
14272
14204
|
* @brief 调用此接口隐藏指定插件图标。
|
|
14273
|
-
* @param pluginNames
|
|
14205
|
+
* @param pluginNames 插件名称。
|
|
14274
14206
|
*/
|
|
14275
14207
|
/** {en}
|
|
14276
14208
|
* @brief Hides the icon of a specified plugin.
|
|
@@ -14342,7 +14274,14 @@ class VePlayerBase {
|
|
|
14342
14274
|
this._player.once("canplay", () => {
|
|
14343
14275
|
this._sourceManager.resetFallback();
|
|
14344
14276
|
});
|
|
14345
|
-
this.emit(Events$1.FALLBACK, {
|
|
14277
|
+
this.emit(Events$1.FALLBACK, {
|
|
14278
|
+
from: {
|
|
14279
|
+
url: preUrl
|
|
14280
|
+
},
|
|
14281
|
+
to: {
|
|
14282
|
+
url
|
|
14283
|
+
}
|
|
14284
|
+
});
|
|
14346
14285
|
this._switchUrl(url);
|
|
14347
14286
|
}
|
|
14348
14287
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -22079,9 +22018,9 @@ class Logger extends Plugin {
|
|
|
22079
22018
|
user_id: this._userId,
|
|
22080
22019
|
device_id: this._deviceId,
|
|
22081
22020
|
ext: {
|
|
22082
|
-
veplayer_version: "2.4.
|
|
22083
|
-
flv_version: "
|
|
22084
|
-
hls_version: "3.0.
|
|
22021
|
+
veplayer_version: "2.4.5-rc.0",
|
|
22022
|
+
flv_version: "3.0.19-rc.0",
|
|
22023
|
+
hls_version: "3.0.19-rc.0",
|
|
22085
22024
|
rts_version: "0.2.1-alpha.0"
|
|
22086
22025
|
}
|
|
22087
22026
|
});
|
|
@@ -22118,7 +22057,7 @@ function getDefaultRow(data) {
|
|
|
22118
22057
|
{
|
|
22119
22058
|
key: "resolution",
|
|
22120
22059
|
labelTextKey: "RESOLUTION",
|
|
22121
|
-
value: `${normalizeNumber(data.
|
|
22060
|
+
value: `${normalizeNumber(data.width)} * ${normalizeNumber(
|
|
22122
22061
|
data.height
|
|
22123
22062
|
)}`
|
|
22124
22063
|
},
|
|
@@ -22410,7 +22349,9 @@ VeI18n.extend([
|
|
|
22410
22349
|
}
|
|
22411
22350
|
]);
|
|
22412
22351
|
const LIVE_DEFAULT_OPTIONS = {
|
|
22413
|
-
autoplay: {
|
|
22352
|
+
autoplay: {
|
|
22353
|
+
muted: true
|
|
22354
|
+
}
|
|
22414
22355
|
};
|
|
22415
22356
|
const LIVE_DEFAULT_PLUGINS = [...DEFAULT_PLUGINS, Refresh, Logger, InfoPanel];
|
|
22416
22357
|
var RTMCodec = /* @__PURE__ */ ((RTMCodec2) => {
|
|
@@ -22430,7 +22371,10 @@ class VePlayerLive extends VePlayerBase {
|
|
|
22430
22371
|
super(options);
|
|
22431
22372
|
}
|
|
22432
22373
|
/** {zh}
|
|
22433
|
-
* @brief
|
|
22374
|
+
* @brief 获取已经播放的时长,不包含暂停和等待时间,单位为秒。
|
|
22375
|
+
*/
|
|
22376
|
+
/** {en}
|
|
22377
|
+
* @brief Obtain the duration that has been played, excluding pause and waiting time, with the unit of seconds.
|
|
22434
22378
|
*/
|
|
22435
22379
|
get playTime() {
|
|
22436
22380
|
var _a, _b, _c, _d;
|
|
@@ -22489,7 +22433,10 @@ class VePlayerLive extends VePlayerBase {
|
|
|
22489
22433
|
(_a = this._player.plugins) == null ? void 0 : _a.infopanel.close();
|
|
22490
22434
|
}
|
|
22491
22435
|
/** {zh}
|
|
22492
|
-
* @brief
|
|
22436
|
+
* @brief 打开码率自适应(ABR)切换功能。
|
|
22437
|
+
*/
|
|
22438
|
+
/** {en}
|
|
22439
|
+
* @brief Enable the Adaptive Bitrate Streaming (ABR) switching feature.
|
|
22493
22440
|
*/
|
|
22494
22441
|
openAbr() {
|
|
22495
22442
|
var _a, _b, _c, _d;
|
|
@@ -22503,7 +22450,10 @@ class VePlayerLive extends VePlayerBase {
|
|
|
22503
22450
|
}
|
|
22504
22451
|
}
|
|
22505
22452
|
/** {zh}
|
|
22506
|
-
* @brief
|
|
22453
|
+
* @brief 关闭码率自适应(ABR)切换功能。
|
|
22454
|
+
*/
|
|
22455
|
+
/** {en}
|
|
22456
|
+
* @brief Disable the Adaptive Bitrate Streaming (ABR) switching feature.
|
|
22507
22457
|
*/
|
|
22508
22458
|
closeAbr() {
|
|
22509
22459
|
var _a, _b, _c, _d;
|
|
@@ -22517,18 +22467,25 @@ class VePlayerLive extends VePlayerBase {
|
|
|
22517
22467
|
}
|
|
22518
22468
|
}
|
|
22519
22469
|
/** {zh}
|
|
22520
|
-
* @brief 调用此方法更新 DRM
|
|
22521
|
-
|
|
22470
|
+
* @brief 调用此方法更新 DRM 配置。
|
|
22471
|
+
*/
|
|
22472
|
+
/** {en}
|
|
22473
|
+
* @brief Use this method to update DRM configuration.
|
|
22474
|
+
* @param config
|
|
22522
22475
|
*/
|
|
22523
22476
|
updateDrmConfig(config) {
|
|
22524
22477
|
var _a, _b, _c;
|
|
22525
22478
|
(_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.drm) == null ? void 0 : _c.updateDrmConfig(config);
|
|
22526
22479
|
}
|
|
22527
22480
|
/** {zh}
|
|
22528
|
-
* @brief
|
|
22529
|
-
* @param options
|
|
22481
|
+
* @brief 修改 ABR 配置,包含修改是否开启 ABR 功能,和修改其他清晰度。
|
|
22482
|
+
* @param options ABR 的配置。
|
|
22530
22483
|
* @returns
|
|
22531
22484
|
*/
|
|
22485
|
+
/** {en}
|
|
22486
|
+
* @brief Modify ABR configuration, including enabling or disabling the ABR feature and adjusting other resolutions.
|
|
22487
|
+
* @param options Configuration of ABR.
|
|
22488
|
+
*/
|
|
22532
22489
|
switchAbr(options) {
|
|
22533
22490
|
var _a, _b;
|
|
22534
22491
|
if (!((_a = this._player.plugins) == null ? void 0 : _a.abr)) {
|
|
@@ -22539,7 +22496,9 @@ class VePlayerLive extends VePlayerBase {
|
|
|
22539
22496
|
if (!url) {
|
|
22540
22497
|
return;
|
|
22541
22498
|
}
|
|
22542
|
-
this.switch(url, {
|
|
22499
|
+
this.switch(url, {
|
|
22500
|
+
seamless: true
|
|
22501
|
+
});
|
|
22543
22502
|
this._player.plugins.abr.bitrate = options.bitrate;
|
|
22544
22503
|
}
|
|
22545
22504
|
if (typeof (options == null ? void 0 : options.enable) !== "undefined") {
|
|
@@ -22547,25 +22506,34 @@ class VePlayerLive extends VePlayerBase {
|
|
|
22547
22506
|
}
|
|
22548
22507
|
}
|
|
22549
22508
|
/** {zh}
|
|
22550
|
-
* @brief 获取 RTM
|
|
22509
|
+
* @brief 获取 RTM 拉流的网络评估信息。
|
|
22551
22510
|
* @returns
|
|
22552
22511
|
*/
|
|
22512
|
+
/** {en}
|
|
22513
|
+
* @brief Obtain the network assessment information of RTM pull streaming.
|
|
22514
|
+
*/
|
|
22553
22515
|
getRTMNetWorkInfo() {
|
|
22554
22516
|
var _a, _b, _c;
|
|
22555
22517
|
return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.rts) == null ? void 0 : _c.getNetWorkInfo();
|
|
22556
22518
|
}
|
|
22557
22519
|
/** {zh}
|
|
22558
|
-
* @brief 获取 RTM
|
|
22520
|
+
* @brief 获取 RTM 拉流的播放信息。
|
|
22559
22521
|
* @returns
|
|
22560
22522
|
*/
|
|
22523
|
+
/** {en}
|
|
22524
|
+
* @brief Obtain the playback information of RTM pull stream.
|
|
22525
|
+
*/
|
|
22561
22526
|
async getRTMStats() {
|
|
22562
22527
|
var _a, _b, _c;
|
|
22563
22528
|
return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.rts) == null ? void 0 : _c.getStatsSnapshoot();
|
|
22564
22529
|
}
|
|
22565
22530
|
/** {zh}
|
|
22566
|
-
* @brief 获取 FLV
|
|
22531
|
+
* @brief 获取 FLV 拉流的播放信息。
|
|
22567
22532
|
* @returns
|
|
22568
22533
|
*/
|
|
22534
|
+
/** {en}
|
|
22535
|
+
* @brief Obtain the playback information of FLV pull streaming.
|
|
22536
|
+
*/
|
|
22569
22537
|
getFLVStats() {
|
|
22570
22538
|
var _a, _b, _c;
|
|
22571
22539
|
return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.flv) == null ? void 0 : _c.getStats();
|
|
@@ -22577,7 +22545,10 @@ async function createLivePlayer(options) {
|
|
|
22577
22545
|
if (!options || !options.url && !options.playlist) {
|
|
22578
22546
|
throw create(ErrorCode.INVALID_PARAMETER, new VeI18n());
|
|
22579
22547
|
}
|
|
22580
|
-
const i18n = new VeI18n({
|
|
22548
|
+
const i18n = new VeI18n({
|
|
22549
|
+
lang: options == null ? void 0 : options.lang,
|
|
22550
|
+
i18n: options == null ? void 0 : options.i18n
|
|
22551
|
+
});
|
|
22581
22552
|
const finalOptions = {
|
|
22582
22553
|
...options,
|
|
22583
22554
|
plugins: [...LIVE_DEFAULT_PLUGINS, ...options.plugins ?? []]
|
|
@@ -22595,9 +22566,24 @@ async function createLivePlayer(options) {
|
|
|
22595
22566
|
},
|
|
22596
22567
|
async preparePlugins(url) {
|
|
22597
22568
|
const [typeStrategy, drmStrategy, abrStrategy] = await Promise.all([
|
|
22598
|
-
getTypeStrategy(
|
|
22599
|
-
|
|
22600
|
-
|
|
22569
|
+
getTypeStrategy(
|
|
22570
|
+
{
|
|
22571
|
+
...finalOptions,
|
|
22572
|
+
url
|
|
22573
|
+
},
|
|
22574
|
+
player
|
|
22575
|
+
),
|
|
22576
|
+
getDrmStrategy(
|
|
22577
|
+
{
|
|
22578
|
+
...finalOptions,
|
|
22579
|
+
url
|
|
22580
|
+
},
|
|
22581
|
+
player
|
|
22582
|
+
),
|
|
22583
|
+
getAbrStrategy({
|
|
22584
|
+
...finalOptions,
|
|
22585
|
+
url
|
|
22586
|
+
})
|
|
22601
22587
|
]);
|
|
22602
22588
|
const { options: options2, plugins } = typeStrategy ?? {};
|
|
22603
22589
|
const { options: drmOptions, plugins: drmPlugins } = drmStrategy ?? {};
|