@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
|
@@ -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", "mp4v.20.8, mp4a.40.2", "mp4v.20.240, mp4a.40.2"];
|
|
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", "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"];
|
|
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.19-rc.0";
|
|
1465
1465
|
var ERROR_TYPE_MAP = {
|
|
1466
1466
|
1: "media",
|
|
1467
1467
|
2: "media",
|
|
@@ -2431,7 +2431,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2431
2431
|
}
|
|
2432
2432
|
if (this.__hooks && this.__hooks[hookName]) {
|
|
2433
2433
|
try {
|
|
2434
|
-
var
|
|
2434
|
+
var _this$__hooks$hookNam;
|
|
2435
|
+
var preRet = (_this$__hooks$hookNam = this.__hooks[hookName]).call.apply(_this$__hooks$hookNam, [this, this].concat(Array.prototype.slice.call(arguments)));
|
|
2435
2436
|
if (preRet) {
|
|
2436
2437
|
if (preRet.then) {
|
|
2437
2438
|
preRet.then(function(isContinue) {
|
|
@@ -2456,19 +2457,6 @@ var __publicField = (obj, key, value) => {
|
|
|
2456
2457
|
}
|
|
2457
2458
|
}.bind(this);
|
|
2458
2459
|
}
|
|
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
|
-
}
|
|
2472
2460
|
function useHooks(hookName, handler) {
|
|
2473
2461
|
var __hooks = this.__hooks;
|
|
2474
2462
|
if (!__hooks) {
|
|
@@ -2478,12 +2466,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2478
2466
|
console.warn("has no supported hook which name [".concat(hookName, "]"));
|
|
2479
2467
|
return false;
|
|
2480
2468
|
}
|
|
2481
|
-
|
|
2482
|
-
__hooks[hookName] = [];
|
|
2483
|
-
}
|
|
2484
|
-
if (findHookIndex.call(this, hookName, handler) === -1) {
|
|
2485
|
-
__hooks[hookName].push(handler);
|
|
2486
|
-
}
|
|
2469
|
+
__hooks && (__hooks[hookName] = handler);
|
|
2487
2470
|
return true;
|
|
2488
2471
|
}
|
|
2489
2472
|
function removeHooks(hookName, handler) {
|
|
@@ -2491,13 +2474,6 @@ var __publicField = (obj, key, value) => {
|
|
|
2491
2474
|
if (!__hooks) {
|
|
2492
2475
|
return;
|
|
2493
2476
|
}
|
|
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
|
-
}
|
|
2501
2477
|
delete __hooks[hookName];
|
|
2502
2478
|
}
|
|
2503
2479
|
function usePluginHooks(pluginName) {
|
|
@@ -2545,30 +2521,18 @@ var __publicField = (obj, key, value) => {
|
|
|
2545
2521
|
for (var _len5 = arguments.length, args = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
|
|
2546
2522
|
args[_key5 - 3] = arguments[_key5];
|
|
2547
2523
|
}
|
|
2548
|
-
if (obj.__hooks &&
|
|
2549
|
-
var
|
|
2550
|
-
var
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
}
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
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));
|
|
2524
|
+
if (obj.__hooks && obj.__hooks[hookName]) {
|
|
2525
|
+
var _obj$__hooks$hookName;
|
|
2526
|
+
var ret = (_obj$__hooks$hookName = obj.__hooks[hookName]).call.apply(_obj$__hooks$hookName, [obj, obj].concat(args));
|
|
2527
|
+
if (ret && ret.then) {
|
|
2528
|
+
ret.then(function(data) {
|
|
2529
|
+
return data === false ? null : handler.call.apply(handler, [obj, obj].concat(args));
|
|
2530
|
+
}).catch(function(e2) {
|
|
2531
|
+
console.warn("[runHooks]".concat(hookName, " reject"), e2.message);
|
|
2532
|
+
});
|
|
2533
|
+
} else if (ret !== false) {
|
|
2534
|
+
return handler.call.apply(handler, [obj, obj].concat(args));
|
|
2535
|
+
}
|
|
2572
2536
|
} else {
|
|
2573
2537
|
return handler.call.apply(handler, [obj, obj].concat(args));
|
|
2574
2538
|
}
|
|
@@ -2812,18 +2776,6 @@ var __publicField = (obj, key, value) => {
|
|
|
2812
2776
|
}
|
|
2813
2777
|
}
|
|
2814
2778
|
}
|
|
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
|
-
}
|
|
2827
2779
|
}, {
|
|
2828
2780
|
key: "defaultConfig",
|
|
2829
2781
|
get: function get() {
|
|
@@ -3469,7 +3421,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3469
3421
|
if (!this.observer) {
|
|
3470
3422
|
return;
|
|
3471
3423
|
}
|
|
3472
|
-
this.observer.observe(target);
|
|
3424
|
+
this.observer && this.observer.observe(target);
|
|
3473
3425
|
var _pid = target.getAttribute(PLATER_ID);
|
|
3474
3426
|
var __handlers = this.__handlers;
|
|
3475
3427
|
var index = -1;
|
|
@@ -3498,17 +3450,16 @@ var __publicField = (obj, key, value) => {
|
|
|
3498
3450
|
}
|
|
3499
3451
|
});
|
|
3500
3452
|
try {
|
|
3501
|
-
|
|
3502
|
-
(_this$observer = this.observer) === null || _this$observer === void 0 ? void 0 : _this$observer.unobserve(target);
|
|
3453
|
+
this.observer && this.observer.unobserve(target);
|
|
3503
3454
|
} catch (e2) {
|
|
3504
3455
|
}
|
|
3456
|
+
this.observer && this.observer.unobserve(target);
|
|
3505
3457
|
i2 > -1 && this.__handlers.splice(i2, 1);
|
|
3506
3458
|
}
|
|
3507
3459
|
}, {
|
|
3508
3460
|
key: "destroyObserver",
|
|
3509
3461
|
value: function destroyObserver() {
|
|
3510
|
-
|
|
3511
|
-
(_this$observer2 = this.observer) === null || _this$observer2 === void 0 ? void 0 : _this$observer2.disconnect();
|
|
3462
|
+
this.observer && this.observer.disconnect();
|
|
3512
3463
|
this.observer = null;
|
|
3513
3464
|
this.__handlers = null;
|
|
3514
3465
|
}
|
|
@@ -3540,8 +3491,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3540
3491
|
return resizeObserver;
|
|
3541
3492
|
}
|
|
3542
3493
|
function unObserver(target, handler) {
|
|
3543
|
-
|
|
3544
|
-
(_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 ? void 0 : _resizeObserver.unObserver(target, handler);
|
|
3494
|
+
resizeObserver.unObserver(target, handler);
|
|
3545
3495
|
}
|
|
3546
3496
|
var pluginsManager = {
|
|
3547
3497
|
pluginGroup: {},
|
|
@@ -4539,7 +4489,10 @@ var __publicField = (obj, key, value) => {
|
|
|
4539
4489
|
}
|
|
4540
4490
|
var _this$config = _this.config, autoplay2 = _this$config.autoplay, defaultPlaybackRate = _this$config.defaultPlaybackRate;
|
|
4541
4491
|
XG_DEBUG.logInfo("player", "canPlayFunc, startTime", _this.__startTime);
|
|
4542
|
-
_this.
|
|
4492
|
+
if (_this.__startTime > 0 && _this.duration > 0) {
|
|
4493
|
+
_this.currentTime = _this.__startTime > _this.duration ? _this.duration : _this.__startTime;
|
|
4494
|
+
_this.__startTime = -1;
|
|
4495
|
+
}
|
|
4543
4496
|
_this.playbackRate = defaultPlaybackRate;
|
|
4544
4497
|
(autoplay2 || _this._useAutoplay) && _this.mediaPlay();
|
|
4545
4498
|
_this.off(CANPLAY, _this.canPlayFunc);
|
|
@@ -4629,7 +4582,6 @@ var __publicField = (obj, key, value) => {
|
|
|
4629
4582
|
_this.waitTimer = null;
|
|
4630
4583
|
_this.handleSource = true;
|
|
4631
4584
|
_this._state = STATES.INITIAL;
|
|
4632
|
-
_this.isAd = false;
|
|
4633
4585
|
_this.isError = false;
|
|
4634
4586
|
_this._hasStart = false;
|
|
4635
4587
|
_this.isSeeking = false;
|
|
@@ -5014,8 +4966,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5014
4966
|
_pConfig.position && (options.position = _pConfig.position);
|
|
5015
4967
|
var position = options.position ? options.position : options.config && options.config.position || PLUFGIN.defaultConfig && PLUFGIN.defaultConfig.position;
|
|
5016
4968
|
if (!options.root && typeof position === "string" && position.indexOf("controls") > -1) {
|
|
5017
|
-
|
|
5018
|
-
return (_this$controls = this.controls) === null || _this$controls === void 0 ? void 0 : _this$controls.registerPlugin(PLUFGIN, options, PLUFGIN.pluginName);
|
|
4969
|
+
return this.controls && this.controls.registerPlugin(PLUFGIN, options, PLUFGIN.pluginName);
|
|
5019
4970
|
}
|
|
5020
4971
|
if (!options.root) {
|
|
5021
4972
|
options.root = this._getRootByPosition(position);
|
|
@@ -5163,7 +5114,10 @@ var __publicField = (obj, key, value) => {
|
|
|
5163
5114
|
reject(e2);
|
|
5164
5115
|
};
|
|
5165
5116
|
var _canplay = function _canplay2() {
|
|
5166
|
-
_this9.
|
|
5117
|
+
if (_this9.duration > 0 && _this9.__startTime > 0) {
|
|
5118
|
+
_this9.currentTime = _this9.__startTime;
|
|
5119
|
+
_this9.__startTime = -1;
|
|
5120
|
+
}
|
|
5167
5121
|
if (isPaused) {
|
|
5168
5122
|
_this9.pause();
|
|
5169
5123
|
}
|
|
@@ -5784,17 +5738,11 @@ var __publicField = (obj, key, value) => {
|
|
|
5784
5738
|
}, {
|
|
5785
5739
|
key: "onLoadeddata",
|
|
5786
5740
|
value: function onLoadeddata() {
|
|
5787
|
-
var _this22 = this;
|
|
5788
5741
|
this.isError = false;
|
|
5789
5742
|
this.isSeeking = false;
|
|
5790
|
-
if (this.__startTime > 0) {
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
} else {
|
|
5794
|
-
this.once(DURATION_CHANGE, function() {
|
|
5795
|
-
_this22._seekToStartTime();
|
|
5796
|
-
});
|
|
5797
|
-
}
|
|
5743
|
+
if (this.__startTime > 0 && this.duration > 0) {
|
|
5744
|
+
this.currentTime = this.__startTime;
|
|
5745
|
+
this.__startTime = -1;
|
|
5798
5746
|
}
|
|
5799
5747
|
}
|
|
5800
5748
|
}, {
|
|
@@ -5863,27 +5811,27 @@ var __publicField = (obj, key, value) => {
|
|
|
5863
5811
|
}, {
|
|
5864
5812
|
key: "onWaiting",
|
|
5865
5813
|
value: function onWaiting() {
|
|
5866
|
-
var
|
|
5814
|
+
var _this22 = this;
|
|
5867
5815
|
if (this.waitTimer) {
|
|
5868
5816
|
util$1.clearTimeout(this, this.waitTimer);
|
|
5869
5817
|
}
|
|
5870
5818
|
this.updateAcc("waiting");
|
|
5871
5819
|
this.waitTimer = util$1.setTimeout(this, function() {
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
util$1.clearTimeout(
|
|
5875
|
-
|
|
5820
|
+
_this22.addClass(STATE_CLASS.LOADING);
|
|
5821
|
+
_this22.emit(LOADING);
|
|
5822
|
+
util$1.clearTimeout(_this22, _this22.waitTimer);
|
|
5823
|
+
_this22.waitTimer = null;
|
|
5876
5824
|
}, this.config.minWaitDelay);
|
|
5877
5825
|
}
|
|
5878
5826
|
}, {
|
|
5879
5827
|
key: "onPlaying",
|
|
5880
5828
|
value: function onPlaying() {
|
|
5881
|
-
var
|
|
5829
|
+
var _this23 = this;
|
|
5882
5830
|
this.isError = false;
|
|
5883
5831
|
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;
|
|
5884
5832
|
var clsList = [NO_START, PAUSED, ENDED2, ERROR2, REPLAY2, LOADING2];
|
|
5885
5833
|
clsList.forEach(function(cls) {
|
|
5886
|
-
|
|
5834
|
+
_this23.removeClass(cls);
|
|
5887
5835
|
});
|
|
5888
5836
|
if (!this._accPlayed.t && !this.paused && !this.ended) {
|
|
5889
5837
|
this._accPlayed.t = (/* @__PURE__ */ new Date()).getTime();
|
|
@@ -6044,14 +5992,14 @@ var __publicField = (obj, key, value) => {
|
|
|
6044
5992
|
}, {
|
|
6045
5993
|
key: "setConfig",
|
|
6046
5994
|
value: function setConfig(config) {
|
|
6047
|
-
var
|
|
5995
|
+
var _this24 = this;
|
|
6048
5996
|
if (!config) {
|
|
6049
5997
|
return;
|
|
6050
5998
|
}
|
|
6051
5999
|
Object.keys(config).map(function(key) {
|
|
6052
6000
|
if (key !== "plugins") {
|
|
6053
|
-
|
|
6054
|
-
var plugin =
|
|
6001
|
+
_this24.config[key] = config[key];
|
|
6002
|
+
var plugin = _this24.plugins[key.toLowerCase()];
|
|
6055
6003
|
if (plugin && util$1.typeOf(plugin.setConfig) === "Function") {
|
|
6056
6004
|
plugin.setConfig(config[key]);
|
|
6057
6005
|
}
|
|
@@ -6061,20 +6009,20 @@ var __publicField = (obj, key, value) => {
|
|
|
6061
6009
|
}, {
|
|
6062
6010
|
key: "playNext",
|
|
6063
6011
|
value: function playNext(config) {
|
|
6064
|
-
var
|
|
6012
|
+
var _this25 = this;
|
|
6065
6013
|
this.resetState();
|
|
6066
6014
|
this.setConfig(config);
|
|
6067
6015
|
this._currentTime = 0;
|
|
6068
6016
|
this._duration = 0;
|
|
6069
6017
|
runHooks(this, "playnext", function() {
|
|
6070
|
-
|
|
6071
|
-
|
|
6018
|
+
_this25.start();
|
|
6019
|
+
_this25.emit(PLAYNEXT, config);
|
|
6072
6020
|
});
|
|
6073
6021
|
}
|
|
6074
6022
|
}, {
|
|
6075
6023
|
key: "resize",
|
|
6076
6024
|
value: function resize() {
|
|
6077
|
-
var
|
|
6025
|
+
var _this26 = this;
|
|
6078
6026
|
if (!this.media) {
|
|
6079
6027
|
return;
|
|
6080
6028
|
}
|
|
@@ -6114,7 +6062,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6114
6062
|
}
|
|
6115
6063
|
if (!this.fullscreen && !this.cssfullscreen) {
|
|
6116
6064
|
Object.keys(_style).forEach(function(key) {
|
|
6117
|
-
|
|
6065
|
+
_this26.root.style[key] = _style[key];
|
|
6118
6066
|
});
|
|
6119
6067
|
}
|
|
6120
6068
|
if (videoFillMode === "fillHeight" && fit < videoFit || videoFillMode === "fillWidth" && fit > videoFit) {
|
|
@@ -6156,14 +6104,6 @@ var __publicField = (obj, key, value) => {
|
|
|
6156
6104
|
url
|
|
6157
6105
|
};
|
|
6158
6106
|
}
|
|
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
|
-
}
|
|
6167
6107
|
}, {
|
|
6168
6108
|
key: "state",
|
|
6169
6109
|
get: function get() {
|
|
@@ -6214,15 +6154,15 @@ var __publicField = (obj, key, value) => {
|
|
|
6214
6154
|
return this.config.definition.list || [];
|
|
6215
6155
|
},
|
|
6216
6156
|
set: function set(list) {
|
|
6217
|
-
var
|
|
6157
|
+
var _this27 = this;
|
|
6218
6158
|
var definition = this.config.definition;
|
|
6219
6159
|
var curDef = null;
|
|
6220
6160
|
var targetDef = null;
|
|
6221
6161
|
definition.list = list;
|
|
6222
6162
|
this.emit("resourceReady", list);
|
|
6223
6163
|
list.forEach(function(item) {
|
|
6224
|
-
var
|
|
6225
|
-
if (((
|
|
6164
|
+
var _this27$curDefinition;
|
|
6165
|
+
if (((_this27$curDefinition = _this27.curDefinition) === null || _this27$curDefinition === void 0 ? void 0 : _this27$curDefinition.definition) === item.definition) {
|
|
6226
6166
|
curDef = item;
|
|
6227
6167
|
}
|
|
6228
6168
|
if (definition.defaultDefinition === item.definition) {
|
|
@@ -6734,11 +6674,11 @@ var __publicField = (obj, key, value) => {
|
|
|
6734
6674
|
} : error2;
|
|
6735
6675
|
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"));
|
|
6736
6676
|
super(message);
|
|
6737
|
-
/**
|
|
6677
|
+
/** {zh}
|
|
6738
6678
|
* @brief 错误码。
|
|
6739
6679
|
*/
|
|
6740
6680
|
/** {en}
|
|
6741
|
-
* @brief
|
|
6681
|
+
* @brief Error code.
|
|
6742
6682
|
*/
|
|
6743
6683
|
__publicField(this, "errorCode");
|
|
6744
6684
|
/** {zh}
|
|
@@ -6986,7 +6926,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6986
6926
|
var className = _this.config.mode === "auto" ? "auto-hide" : "hide";
|
|
6987
6927
|
util$1.addClass(_this.root, className);
|
|
6988
6928
|
_this.autoPlayStart = true;
|
|
6989
|
-
_this.
|
|
6929
|
+
_this.onPlayPause("play");
|
|
6990
6930
|
});
|
|
6991
6931
|
_this.autoPlayStart = false;
|
|
6992
6932
|
return _this;
|
|
@@ -6994,19 +6934,9 @@ var __publicField = (obj, key, value) => {
|
|
|
6994
6934
|
_createClass$1(Start2, [{
|
|
6995
6935
|
key: "afterCreate",
|
|
6996
6936
|
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() {
|
|
7008
6937
|
var _this2 = this;
|
|
7009
6938
|
var player = this.player, playerConfig = this.playerConfig;
|
|
6939
|
+
this.initIcons();
|
|
7010
6940
|
this.once(READY, function() {
|
|
7011
6941
|
if (playerConfig) {
|
|
7012
6942
|
if (playerConfig.lang && playerConfig.lang === "en") {
|
|
@@ -7017,6 +6947,9 @@ var __publicField = (obj, key, value) => {
|
|
|
7017
6947
|
}
|
|
7018
6948
|
});
|
|
7019
6949
|
this.on(AUTOPLAY_STARTED, this.onAutoplayStart);
|
|
6950
|
+
if (!playerConfig.autoplay) {
|
|
6951
|
+
this.show();
|
|
6952
|
+
}
|
|
7020
6953
|
this.on(AUTOPLAY_PREVENTED, function() {
|
|
7021
6954
|
var className = _this2.config.mode === "auto" ? "auto-hide" : "hide";
|
|
7022
6955
|
_this2.setAttr("data-state", "play");
|
|
@@ -7024,25 +6957,20 @@ var __publicField = (obj, key, value) => {
|
|
|
7024
6957
|
_this2.show();
|
|
7025
6958
|
});
|
|
7026
6959
|
this.on(PLAY, function() {
|
|
7027
|
-
_this2.
|
|
6960
|
+
_this2.onPlayPause("play");
|
|
7028
6961
|
});
|
|
7029
6962
|
this.on(PAUSE, function() {
|
|
7030
|
-
_this2.
|
|
6963
|
+
_this2.onPlayPause("pause");
|
|
7031
6964
|
});
|
|
7032
6965
|
this.on(RESET, function() {
|
|
7033
6966
|
_this2.onPlayerReset();
|
|
7034
6967
|
});
|
|
7035
|
-
}
|
|
7036
|
-
}, {
|
|
7037
|
-
key: "bindClickEvents",
|
|
7038
|
-
value: function bindClickEvents() {
|
|
7039
|
-
var _this3 = this;
|
|
7040
6968
|
this.clickHandler = this.hook("startClick", this.switchPausePlay, {
|
|
7041
6969
|
pre: function pre(e2) {
|
|
7042
6970
|
e2.cancelable && e2.preventDefault();
|
|
7043
6971
|
e2.stopPropagation();
|
|
7044
|
-
var paused =
|
|
7045
|
-
|
|
6972
|
+
var paused = _this2.player.paused;
|
|
6973
|
+
_this2.emitUserAction(e2, "switch_play_pause", {
|
|
7046
6974
|
props: "paused",
|
|
7047
6975
|
from: paused,
|
|
7048
6976
|
to: !paused
|
|
@@ -7104,17 +7032,17 @@ var __publicField = (obj, key, value) => {
|
|
|
7104
7032
|
}, {
|
|
7105
7033
|
key: "animate",
|
|
7106
7034
|
value: function animate(endShow) {
|
|
7107
|
-
var
|
|
7035
|
+
var _this3 = this;
|
|
7108
7036
|
this._animateId = addAnimate("pauseplay", 400, {
|
|
7109
7037
|
start: function start() {
|
|
7110
|
-
util$1.addClass(
|
|
7111
|
-
|
|
7112
|
-
|
|
7038
|
+
util$1.addClass(_this3.root, "interact");
|
|
7039
|
+
_this3.show();
|
|
7040
|
+
_this3.switchStatus(true);
|
|
7113
7041
|
},
|
|
7114
7042
|
end: function end() {
|
|
7115
|
-
util$1.removeClass(
|
|
7116
|
-
!endShow &&
|
|
7117
|
-
|
|
7043
|
+
util$1.removeClass(_this3.root, "interact");
|
|
7044
|
+
!endShow && _this3.hide();
|
|
7045
|
+
_this3._animateId = null;
|
|
7118
7046
|
}
|
|
7119
7047
|
});
|
|
7120
7048
|
}
|
|
@@ -7144,11 +7072,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7144
7072
|
}, {
|
|
7145
7073
|
key: "onPlayPause",
|
|
7146
7074
|
value: function onPlayPause(status) {
|
|
7147
|
-
this.toggleTo(status);
|
|
7148
|
-
}
|
|
7149
|
-
}, {
|
|
7150
|
-
key: "toggleTo",
|
|
7151
|
-
value: function toggleTo(status) {
|
|
7152
7075
|
var config = this.config, player = this.player;
|
|
7153
7076
|
if (!player || player.state < STATES.RUNNING || !this.autoPlayStart) {
|
|
7154
7077
|
return;
|
|
@@ -8524,7 +8447,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8524
8447
|
}
|
|
8525
8448
|
this.on(DURATION_CHANGE, function() {
|
|
8526
8449
|
var player2 = _this2.player, config2 = _this2.config;
|
|
8527
|
-
if (player2.duration
|
|
8450
|
+
if (player2.duration * 1e3 < config2.moveDuration) {
|
|
8528
8451
|
config2.moveDuration = player2.duration * 1e3;
|
|
8529
8452
|
}
|
|
8530
8453
|
});
|
|
@@ -8838,13 +8761,10 @@ var __publicField = (obj, key, value) => {
|
|
|
8838
8761
|
}, {
|
|
8839
8762
|
key: "updateBrightness",
|
|
8840
8763
|
value: function updateBrightness(percent) {
|
|
8841
|
-
var pos = this.pos, config = this.config, xgMask = this.xgMask;
|
|
8842
|
-
if (!config.darkness) {
|
|
8843
|
-
return;
|
|
8844
|
-
}
|
|
8845
8764
|
if (this.player.rotateDeg) {
|
|
8846
8765
|
percent = -percent;
|
|
8847
8766
|
}
|
|
8767
|
+
var pos = this.pos, config = this.config, xgMask = this.xgMask;
|
|
8848
8768
|
var light = pos.light + 0.8 * percent;
|
|
8849
8769
|
light = light > config.maxDarkness ? config.maxDarkness : light < 0 ? 0 : light;
|
|
8850
8770
|
if (xgMask) {
|
|
@@ -8905,12 +8825,12 @@ var __publicField = (obj, key, value) => {
|
|
|
8905
8825
|
}, {
|
|
8906
8826
|
key: "disableGesture",
|
|
8907
8827
|
value: function disableGesture() {
|
|
8908
|
-
this.config.disableGesture =
|
|
8828
|
+
this.config.disableGesture = false;
|
|
8909
8829
|
}
|
|
8910
8830
|
}, {
|
|
8911
8831
|
key: "enableGesture",
|
|
8912
8832
|
value: function enableGesture() {
|
|
8913
|
-
this.config.disableGesture =
|
|
8833
|
+
this.config.disableGesture = true;
|
|
8914
8834
|
}
|
|
8915
8835
|
}, {
|
|
8916
8836
|
key: "destroy",
|
|
@@ -9482,55 +9402,28 @@ var __publicField = (obj, key, value) => {
|
|
|
9482
9402
|
_inherits(Play2, _IconPlugin);
|
|
9483
9403
|
var _super = _createSuper(Play2);
|
|
9484
9404
|
function Play2() {
|
|
9485
|
-
var _this;
|
|
9486
9405
|
_classCallCheck(this, Play2);
|
|
9487
|
-
|
|
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;
|
|
9406
|
+
return _super.apply(this, arguments);
|
|
9512
9407
|
}
|
|
9513
9408
|
_createClass$1(Play2, [{
|
|
9514
9409
|
key: "afterCreate",
|
|
9515
9410
|
value: function afterCreate() {
|
|
9411
|
+
var _this = this;
|
|
9516
9412
|
_get(_getPrototypeOf(Play2.prototype), "afterCreate", this).call(this);
|
|
9517
|
-
var config = this.config;
|
|
9413
|
+
var player = this.player, config = this.config;
|
|
9518
9414
|
if (config.disable) {
|
|
9519
9415
|
return;
|
|
9520
9416
|
}
|
|
9521
9417
|
this.initIcons();
|
|
9418
|
+
this.btnClick = this.btnClick.bind(this);
|
|
9522
9419
|
this.bind(["touchend", "click"], this.btnClick);
|
|
9523
|
-
this.
|
|
9524
|
-
|
|
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);
|
|
9420
|
+
this.on([PAUSE, ERROR, EMPTIED], function() {
|
|
9421
|
+
_this.animate(player.paused);
|
|
9533
9422
|
});
|
|
9423
|
+
this.on(PLAY, function() {
|
|
9424
|
+
_this.animate(player.paused);
|
|
9425
|
+
});
|
|
9426
|
+
this.animate(true);
|
|
9534
9427
|
}
|
|
9535
9428
|
}, {
|
|
9536
9429
|
key: "registerIcons",
|
|
@@ -9546,6 +9439,28 @@ var __publicField = (obj, key, value) => {
|
|
|
9546
9439
|
}
|
|
9547
9440
|
};
|
|
9548
9441
|
}
|
|
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
|
+
}
|
|
9549
9464
|
}, {
|
|
9550
9465
|
key: "initIcons",
|
|
9551
9466
|
value: function initIcons() {
|
|
@@ -11664,10 +11579,10 @@ var __publicField = (obj, key, value) => {
|
|
|
11664
11579
|
const { controls } = this.player;
|
|
11665
11580
|
const { listType } = this.config;
|
|
11666
11581
|
if (isActive) {
|
|
11667
|
-
listType && MODAL_TYPES.includes(listType) ? controls
|
|
11582
|
+
listType && MODAL_TYPES.includes(listType) ? controls.blur() : controls.focus();
|
|
11668
11583
|
this.optionsList && this.optionsList.show();
|
|
11669
11584
|
} else {
|
|
11670
|
-
listType && MODAL_TYPES.includes(listType) ? controls
|
|
11585
|
+
listType && MODAL_TYPES.includes(listType) ? controls.focus() : controls.focusAwhile();
|
|
11671
11586
|
this.optionsList && this.optionsList.hide();
|
|
11672
11587
|
}
|
|
11673
11588
|
this._isActive = isActive;
|
|
@@ -13593,28 +13508,33 @@ var __publicField = (obj, key, value) => {
|
|
|
13593
13508
|
useCssFullscreen: false
|
|
13594
13509
|
}
|
|
13595
13510
|
};
|
|
13596
|
-
const transformOption = (
|
|
13597
|
-
|
|
13598
|
-
|
|
13599
|
-
|
|
13600
|
-
|
|
13601
|
-
|
|
13602
|
-
|
|
13603
|
-
|
|
13604
|
-
|
|
13605
|
-
|
|
13606
|
-
|
|
13607
|
-
|
|
13608
|
-
|
|
13609
|
-
xgOptions.videoAttributes = {
|
|
13610
|
-
...xgOptions.videoAttributes ?? {},
|
|
13611
|
-
muted: autoplay2 == null ? void 0 : autoplay2.muted
|
|
13511
|
+
const transformOption = (
|
|
13512
|
+
/** {zh}
|
|
13513
|
+
* @param options 更多配置信息。
|
|
13514
|
+
*/
|
|
13515
|
+
(options) => {
|
|
13516
|
+
const { autoplay: autoplay2, ...rest } = options;
|
|
13517
|
+
const xgOptions = rest;
|
|
13518
|
+
if (xgOptions.poster) {
|
|
13519
|
+
xgOptions.poster = escapeHtml(xgOptions.poster);
|
|
13520
|
+
}
|
|
13521
|
+
xgOptions.icons = {
|
|
13522
|
+
...DEFAULT_ICONS,
|
|
13523
|
+
...xgOptions.icons ? escapeIcons(xgOptions.icons) : {}
|
|
13612
13524
|
};
|
|
13613
|
-
xgOptions.
|
|
13525
|
+
xgOptions.autoplay = Boolean(autoplay2);
|
|
13526
|
+
if (autoplay2 && typeof autoplay2 !== "boolean") {
|
|
13527
|
+
xgOptions.autoplayMuted = autoplay2 == null ? void 0 : autoplay2.muted;
|
|
13528
|
+
xgOptions.videoAttributes = {
|
|
13529
|
+
...xgOptions.videoAttributes ?? {},
|
|
13530
|
+
muted: autoplay2 == null ? void 0 : autoplay2.muted
|
|
13531
|
+
};
|
|
13532
|
+
xgOptions.autoplayPlugin = autoplay2;
|
|
13533
|
+
}
|
|
13534
|
+
delete xgOptions.i18n;
|
|
13535
|
+
return xgOptions;
|
|
13614
13536
|
}
|
|
13615
|
-
|
|
13616
|
-
return xgOptions;
|
|
13617
|
-
};
|
|
13537
|
+
);
|
|
13618
13538
|
class VePlayerBase {
|
|
13619
13539
|
/** {zh}
|
|
13620
13540
|
* @hidden
|
|
@@ -13634,7 +13554,9 @@ var __publicField = (obj, key, value) => {
|
|
|
13634
13554
|
this._sourceManager = options.sourceManager;
|
|
13635
13555
|
this._preparePlugins = options.preparePlugins;
|
|
13636
13556
|
this._previousPrepareResult = options.prepareResult;
|
|
13637
|
-
this._i18nManager = options.i18nManager ?? new VeI18n({
|
|
13557
|
+
this._i18nManager = options.i18nManager ?? new VeI18n({
|
|
13558
|
+
i18n: options.i18n
|
|
13559
|
+
});
|
|
13638
13560
|
const xgOptions = transformOption({
|
|
13639
13561
|
...options,
|
|
13640
13562
|
...(_a = this._previousPrepareResult) == null ? void 0 : _a.options
|
|
@@ -13829,9 +13751,14 @@ var __publicField = (obj, key, value) => {
|
|
|
13829
13751
|
/** {zh}
|
|
13830
13752
|
* 获取播放器版本号
|
|
13831
13753
|
* @returns
|
|
13754
|
+
* @brief
|
|
13755
|
+
* 获取播放器 SDK 版本号。
|
|
13756
|
+
*/
|
|
13757
|
+
/** {en}
|
|
13758
|
+
* @brief Retrieve the player SDK version number.
|
|
13832
13759
|
*/
|
|
13833
13760
|
get playerVersion() {
|
|
13834
|
-
return "2.4.
|
|
13761
|
+
return "2.4.5-rc.0";
|
|
13835
13762
|
}
|
|
13836
13763
|
/** {zh}
|
|
13837
13764
|
* @brief 获取当前播放视频的清晰度唯一标识(definition)。
|
|
@@ -13979,8 +13906,8 @@ var __publicField = (obj, key, value) => {
|
|
|
13979
13906
|
}
|
|
13980
13907
|
/** {zh}
|
|
13981
13908
|
* @brief 调用此方法切换拉流地址、线路、清晰度。
|
|
13982
|
-
* @param target
|
|
13983
|
-
* @param options
|
|
13909
|
+
* @param target 目标地址,可以是播放地址,也可以是线路和清晰度。
|
|
13910
|
+
* @param options 更多配置信息。
|
|
13984
13911
|
*/
|
|
13985
13912
|
/** {en}
|
|
13986
13913
|
* @brief Switches the pull stream address, playback source, or resolution.
|
|
@@ -13991,7 +13918,9 @@ var __publicField = (obj, key, value) => {
|
|
|
13991
13918
|
var _a, _b;
|
|
13992
13919
|
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) {
|
|
13993
13920
|
this._sourceManager.updateSources(target);
|
|
13994
|
-
await this._switchUrl(target, {
|
|
13921
|
+
await this._switchUrl(target, {
|
|
13922
|
+
seamless: options == null ? void 0 : options.seamless
|
|
13923
|
+
});
|
|
13995
13924
|
return this._sourceManager.definition;
|
|
13996
13925
|
}
|
|
13997
13926
|
const targetDefinition = this._sourceManager.find(target, options);
|
|
@@ -14018,16 +13947,15 @@ var __publicField = (obj, key, value) => {
|
|
|
14018
13947
|
return this._switch(sourceManager.definition);
|
|
14019
13948
|
}
|
|
14020
13949
|
// TODO: 等西瓜播放器完善错误码后增加函数重载以提供更好的类型
|
|
14021
|
-
/**
|
|
14022
13950
|
/** {zh}
|
|
14023
13951
|
* @brief 调用此方法监听指定事件,事件处理函数只执行一次。
|
|
14024
13952
|
* @param event 表示事件的名称。
|
|
14025
13953
|
* @param callback 表示事件的回调函数。
|
|
14026
13954
|
*/
|
|
14027
13955
|
/** {en}
|
|
14028
|
-
* @brief
|
|
14029
|
-
* @param event The event
|
|
14030
|
-
* @param callback
|
|
13956
|
+
* @brief Call this method to listen for the specified event. The event handler is executed only once.
|
|
13957
|
+
* @param event The name representing the event.
|
|
13958
|
+
* @param callback Callback functions representing events.
|
|
14031
13959
|
*/
|
|
14032
13960
|
once(event, callback) {
|
|
14033
13961
|
var _a;
|
|
@@ -14178,10 +14106,14 @@ var __publicField = (obj, key, value) => {
|
|
|
14178
14106
|
return this._player.blur(data);
|
|
14179
14107
|
}
|
|
14180
14108
|
/** {zh}
|
|
14181
|
-
* @brief
|
|
14182
|
-
* @param type
|
|
14109
|
+
* @brief 判断浏览器是否支持播放格式。
|
|
14110
|
+
* @param type 播放格式。
|
|
14183
14111
|
* @returns
|
|
14184
14112
|
*/
|
|
14113
|
+
/** {en}
|
|
14114
|
+
* @brief Determine whether the browser supports the playback format.
|
|
14115
|
+
* @param type The playback format.
|
|
14116
|
+
*/
|
|
14185
14117
|
canPlayType(type) {
|
|
14186
14118
|
return this._player.canPlayType(type);
|
|
14187
14119
|
}
|
|
@@ -14253,7 +14185,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14253
14185
|
}
|
|
14254
14186
|
/** {zh}
|
|
14255
14187
|
* @brief 调用此接口显示指定插件图标。
|
|
14256
|
-
* @param pluginNames
|
|
14188
|
+
* @param pluginNames 插件名称。
|
|
14257
14189
|
*/
|
|
14258
14190
|
/** {en}
|
|
14259
14191
|
* @brief Displays the icon of a specified plugin.
|
|
@@ -14274,7 +14206,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14274
14206
|
}
|
|
14275
14207
|
/** {zh}
|
|
14276
14208
|
* @brief 调用此接口隐藏指定插件图标。
|
|
14277
|
-
* @param pluginNames
|
|
14209
|
+
* @param pluginNames 插件名称。
|
|
14278
14210
|
*/
|
|
14279
14211
|
/** {en}
|
|
14280
14212
|
* @brief Hides the icon of a specified plugin.
|
|
@@ -14346,7 +14278,14 @@ var __publicField = (obj, key, value) => {
|
|
|
14346
14278
|
this._player.once("canplay", () => {
|
|
14347
14279
|
this._sourceManager.resetFallback();
|
|
14348
14280
|
});
|
|
14349
|
-
this.emit(Events$1.FALLBACK, {
|
|
14281
|
+
this.emit(Events$1.FALLBACK, {
|
|
14282
|
+
from: {
|
|
14283
|
+
url: preUrl
|
|
14284
|
+
},
|
|
14285
|
+
to: {
|
|
14286
|
+
url
|
|
14287
|
+
}
|
|
14288
|
+
});
|
|
14350
14289
|
this._switchUrl(url);
|
|
14351
14290
|
}
|
|
14352
14291
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -22083,9 +22022,9 @@ var __publicField = (obj, key, value) => {
|
|
|
22083
22022
|
user_id: this._userId,
|
|
22084
22023
|
device_id: this._deviceId,
|
|
22085
22024
|
ext: {
|
|
22086
|
-
veplayer_version: "2.4.
|
|
22087
|
-
flv_version: "
|
|
22088
|
-
hls_version: "3.0.
|
|
22025
|
+
veplayer_version: "2.4.5-rc.0",
|
|
22026
|
+
flv_version: "3.0.19-rc.0",
|
|
22027
|
+
hls_version: "3.0.19-rc.0",
|
|
22089
22028
|
rts_version: "0.2.1-alpha.0"
|
|
22090
22029
|
}
|
|
22091
22030
|
});
|
|
@@ -22122,7 +22061,7 @@ var __publicField = (obj, key, value) => {
|
|
|
22122
22061
|
{
|
|
22123
22062
|
key: "resolution",
|
|
22124
22063
|
labelTextKey: "RESOLUTION",
|
|
22125
|
-
value: `${normalizeNumber(data.
|
|
22064
|
+
value: `${normalizeNumber(data.width)} * ${normalizeNumber(
|
|
22126
22065
|
data.height
|
|
22127
22066
|
)}`
|
|
22128
22067
|
},
|
|
@@ -22414,7 +22353,9 @@ var __publicField = (obj, key, value) => {
|
|
|
22414
22353
|
}
|
|
22415
22354
|
]);
|
|
22416
22355
|
const LIVE_DEFAULT_OPTIONS = {
|
|
22417
|
-
autoplay: {
|
|
22356
|
+
autoplay: {
|
|
22357
|
+
muted: true
|
|
22358
|
+
}
|
|
22418
22359
|
};
|
|
22419
22360
|
const LIVE_DEFAULT_PLUGINS = [...DEFAULT_PLUGINS, Refresh, Logger, InfoPanel];
|
|
22420
22361
|
var RTMCodec = /* @__PURE__ */ ((RTMCodec2) => {
|
|
@@ -22434,7 +22375,10 @@ var __publicField = (obj, key, value) => {
|
|
|
22434
22375
|
super(options);
|
|
22435
22376
|
}
|
|
22436
22377
|
/** {zh}
|
|
22437
|
-
* @brief
|
|
22378
|
+
* @brief 获取已经播放的时长,不包含暂停和等待时间,单位为秒。
|
|
22379
|
+
*/
|
|
22380
|
+
/** {en}
|
|
22381
|
+
* @brief Obtain the duration that has been played, excluding pause and waiting time, with the unit of seconds.
|
|
22438
22382
|
*/
|
|
22439
22383
|
get playTime() {
|
|
22440
22384
|
var _a, _b, _c, _d;
|
|
@@ -22493,7 +22437,10 @@ var __publicField = (obj, key, value) => {
|
|
|
22493
22437
|
(_a = this._player.plugins) == null ? void 0 : _a.infopanel.close();
|
|
22494
22438
|
}
|
|
22495
22439
|
/** {zh}
|
|
22496
|
-
* @brief
|
|
22440
|
+
* @brief 打开码率自适应(ABR)切换功能。
|
|
22441
|
+
*/
|
|
22442
|
+
/** {en}
|
|
22443
|
+
* @brief Enable the Adaptive Bitrate Streaming (ABR) switching feature.
|
|
22497
22444
|
*/
|
|
22498
22445
|
openAbr() {
|
|
22499
22446
|
var _a, _b, _c, _d;
|
|
@@ -22507,7 +22454,10 @@ var __publicField = (obj, key, value) => {
|
|
|
22507
22454
|
}
|
|
22508
22455
|
}
|
|
22509
22456
|
/** {zh}
|
|
22510
|
-
* @brief
|
|
22457
|
+
* @brief 关闭码率自适应(ABR)切换功能。
|
|
22458
|
+
*/
|
|
22459
|
+
/** {en}
|
|
22460
|
+
* @brief Disable the Adaptive Bitrate Streaming (ABR) switching feature.
|
|
22511
22461
|
*/
|
|
22512
22462
|
closeAbr() {
|
|
22513
22463
|
var _a, _b, _c, _d;
|
|
@@ -22521,18 +22471,25 @@ var __publicField = (obj, key, value) => {
|
|
|
22521
22471
|
}
|
|
22522
22472
|
}
|
|
22523
22473
|
/** {zh}
|
|
22524
|
-
* @brief 调用此方法更新 DRM
|
|
22525
|
-
|
|
22474
|
+
* @brief 调用此方法更新 DRM 配置。
|
|
22475
|
+
*/
|
|
22476
|
+
/** {en}
|
|
22477
|
+
* @brief Use this method to update DRM configuration.
|
|
22478
|
+
* @param config
|
|
22526
22479
|
*/
|
|
22527
22480
|
updateDrmConfig(config) {
|
|
22528
22481
|
var _a, _b, _c;
|
|
22529
22482
|
(_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.drm) == null ? void 0 : _c.updateDrmConfig(config);
|
|
22530
22483
|
}
|
|
22531
22484
|
/** {zh}
|
|
22532
|
-
* @brief
|
|
22533
|
-
* @param options
|
|
22485
|
+
* @brief 修改 ABR 配置,包含修改是否开启 ABR 功能,和修改其他清晰度。
|
|
22486
|
+
* @param options ABR 的配置。
|
|
22534
22487
|
* @returns
|
|
22535
22488
|
*/
|
|
22489
|
+
/** {en}
|
|
22490
|
+
* @brief Modify ABR configuration, including enabling or disabling the ABR feature and adjusting other resolutions.
|
|
22491
|
+
* @param options Configuration of ABR.
|
|
22492
|
+
*/
|
|
22536
22493
|
switchAbr(options) {
|
|
22537
22494
|
var _a, _b;
|
|
22538
22495
|
if (!((_a = this._player.plugins) == null ? void 0 : _a.abr)) {
|
|
@@ -22543,7 +22500,9 @@ var __publicField = (obj, key, value) => {
|
|
|
22543
22500
|
if (!url) {
|
|
22544
22501
|
return;
|
|
22545
22502
|
}
|
|
22546
|
-
this.switch(url, {
|
|
22503
|
+
this.switch(url, {
|
|
22504
|
+
seamless: true
|
|
22505
|
+
});
|
|
22547
22506
|
this._player.plugins.abr.bitrate = options.bitrate;
|
|
22548
22507
|
}
|
|
22549
22508
|
if (typeof (options == null ? void 0 : options.enable) !== "undefined") {
|
|
@@ -22551,25 +22510,34 @@ var __publicField = (obj, key, value) => {
|
|
|
22551
22510
|
}
|
|
22552
22511
|
}
|
|
22553
22512
|
/** {zh}
|
|
22554
|
-
* @brief 获取 RTM
|
|
22513
|
+
* @brief 获取 RTM 拉流的网络评估信息。
|
|
22555
22514
|
* @returns
|
|
22556
22515
|
*/
|
|
22516
|
+
/** {en}
|
|
22517
|
+
* @brief Obtain the network assessment information of RTM pull streaming.
|
|
22518
|
+
*/
|
|
22557
22519
|
getRTMNetWorkInfo() {
|
|
22558
22520
|
var _a, _b, _c;
|
|
22559
22521
|
return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.rts) == null ? void 0 : _c.getNetWorkInfo();
|
|
22560
22522
|
}
|
|
22561
22523
|
/** {zh}
|
|
22562
|
-
* @brief 获取 RTM
|
|
22524
|
+
* @brief 获取 RTM 拉流的播放信息。
|
|
22563
22525
|
* @returns
|
|
22564
22526
|
*/
|
|
22527
|
+
/** {en}
|
|
22528
|
+
* @brief Obtain the playback information of RTM pull stream.
|
|
22529
|
+
*/
|
|
22565
22530
|
async getRTMStats() {
|
|
22566
22531
|
var _a, _b, _c;
|
|
22567
22532
|
return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.rts) == null ? void 0 : _c.getStatsSnapshoot();
|
|
22568
22533
|
}
|
|
22569
22534
|
/** {zh}
|
|
22570
|
-
* @brief 获取 FLV
|
|
22535
|
+
* @brief 获取 FLV 拉流的播放信息。
|
|
22571
22536
|
* @returns
|
|
22572
22537
|
*/
|
|
22538
|
+
/** {en}
|
|
22539
|
+
* @brief Obtain the playback information of FLV pull streaming.
|
|
22540
|
+
*/
|
|
22573
22541
|
getFLVStats() {
|
|
22574
22542
|
var _a, _b, _c;
|
|
22575
22543
|
return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.flv) == null ? void 0 : _c.getStats();
|
|
@@ -22581,7 +22549,10 @@ var __publicField = (obj, key, value) => {
|
|
|
22581
22549
|
if (!options || !options.url && !options.playlist) {
|
|
22582
22550
|
throw create(ErrorCode.INVALID_PARAMETER, new VeI18n());
|
|
22583
22551
|
}
|
|
22584
|
-
const i18n = new VeI18n({
|
|
22552
|
+
const i18n = new VeI18n({
|
|
22553
|
+
lang: options == null ? void 0 : options.lang,
|
|
22554
|
+
i18n: options == null ? void 0 : options.i18n
|
|
22555
|
+
});
|
|
22585
22556
|
const finalOptions = {
|
|
22586
22557
|
...options,
|
|
22587
22558
|
plugins: [...LIVE_DEFAULT_PLUGINS, ...options.plugins ?? []]
|
|
@@ -22599,9 +22570,24 @@ var __publicField = (obj, key, value) => {
|
|
|
22599
22570
|
},
|
|
22600
22571
|
async preparePlugins(url) {
|
|
22601
22572
|
const [typeStrategy, drmStrategy, abrStrategy] = await Promise.all([
|
|
22602
|
-
getTypeStrategy(
|
|
22603
|
-
|
|
22604
|
-
|
|
22573
|
+
getTypeStrategy(
|
|
22574
|
+
{
|
|
22575
|
+
...finalOptions,
|
|
22576
|
+
url
|
|
22577
|
+
},
|
|
22578
|
+
player
|
|
22579
|
+
),
|
|
22580
|
+
getDrmStrategy(
|
|
22581
|
+
{
|
|
22582
|
+
...finalOptions,
|
|
22583
|
+
url
|
|
22584
|
+
},
|
|
22585
|
+
player
|
|
22586
|
+
),
|
|
22587
|
+
getAbrStrategy({
|
|
22588
|
+
...finalOptions,
|
|
22589
|
+
url
|
|
22590
|
+
})
|
|
22605
22591
|
]);
|
|
22606
22592
|
const { options: options2, plugins } = typeStrategy ?? {};
|
|
22607
22593
|
const { options: drmOptions, plugins: drmPlugins } = drmStrategy ?? {};
|