@byteplus/veplayer 2.4.1-rc.0 → 2.4.1-rc.1
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 +24 -2
- package/esm/veplayer.biz.live.production.js +5 -1
- package/esm/veplayer.d.ts +28 -0
- package/esm/veplayer.development.js +77 -42
- package/esm/veplayer.live.d.ts +28 -0
- package/esm/veplayer.live.development.js +77 -42
- package/esm/veplayer.live.production.js +7 -3
- package/esm/veplayer.production.js +7 -3
- package/esm/veplayer.vod.development.js +52 -39
- package/esm/veplayer.vod.production.js +2 -2
- package/package.json +1 -1
- package/umd/veplayer.biz.live.development.js +24 -2
- package/umd/veplayer.biz.live.production.js +1 -1
- package/umd/veplayer.d.ts +28 -0
- package/umd/veplayer.development.js +77 -42
- package/umd/veplayer.live.d.ts +28 -0
- package/umd/veplayer.live.development.js +77 -42
- package/umd/veplayer.live.production.js +1 -1
- package/umd/veplayer.production.js +1 -1
- package/umd/veplayer.vod.development.js +52 -39
- package/umd/veplayer.vod.production.js +1 -1
- package/veplayer.d.ts +28 -0
- package/veplayer.live.d.ts +28 -0
package/esm/veplayer.d.ts
CHANGED
|
@@ -5920,6 +5920,20 @@ declare class VePlayerLive extends VePlayerBase {
|
|
|
5920
5920
|
* @returns
|
|
5921
5921
|
*/
|
|
5922
5922
|
getFLVStats(): FlvStats;
|
|
5923
|
+
/** {zh}
|
|
5924
|
+
* @brief 调用此方法开始播放 。
|
|
5925
|
+
*/
|
|
5926
|
+
/** {en}
|
|
5927
|
+
* @brief Starts playback.
|
|
5928
|
+
*/
|
|
5929
|
+
play(): any;
|
|
5930
|
+
/** {zh}
|
|
5931
|
+
* @brief 调用此方法暂停播放。
|
|
5932
|
+
*/
|
|
5933
|
+
/** {en}
|
|
5934
|
+
* @brief Pauses playback.
|
|
5935
|
+
*/
|
|
5936
|
+
pause(): void;
|
|
5923
5937
|
}
|
|
5924
5938
|
/** {zh}
|
|
5925
5939
|
* @detail api
|
|
@@ -10730,6 +10744,20 @@ declare namespace live {
|
|
|
10730
10744
|
* @returns
|
|
10731
10745
|
*/
|
|
10732
10746
|
getFLVStats(): FlvStats;
|
|
10747
|
+
/** {zh}
|
|
10748
|
+
* @brief 调用此方法开始播放 。
|
|
10749
|
+
*/
|
|
10750
|
+
/** {en}
|
|
10751
|
+
* @brief Starts playback.
|
|
10752
|
+
*/
|
|
10753
|
+
play(): any;
|
|
10754
|
+
/** {zh}
|
|
10755
|
+
* @brief 调用此方法暂停播放。
|
|
10756
|
+
*/
|
|
10757
|
+
/** {en}
|
|
10758
|
+
* @brief Pauses playback.
|
|
10759
|
+
*/
|
|
10760
|
+
pause(): void;
|
|
10733
10761
|
}
|
|
10734
10762
|
/** {zh}
|
|
10735
10763
|
* @detail api
|
|
@@ -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", "
|
|
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"];
|
|
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.20-rc.3";
|
|
1461
1461
|
var ERROR_TYPE_MAP = {
|
|
1462
1462
|
1: "media",
|
|
1463
1463
|
2: "media",
|
|
@@ -3417,7 +3417,7 @@ var ResizeObserver = /* @__PURE__ */ function() {
|
|
|
3417
3417
|
if (!this.observer) {
|
|
3418
3418
|
return;
|
|
3419
3419
|
}
|
|
3420
|
-
this.observer
|
|
3420
|
+
this.observer.observe(target);
|
|
3421
3421
|
var _pid = target.getAttribute(PLATER_ID);
|
|
3422
3422
|
var __handlers = this.__handlers;
|
|
3423
3423
|
var index = -1;
|
|
@@ -3446,16 +3446,17 @@ var ResizeObserver = /* @__PURE__ */ function() {
|
|
|
3446
3446
|
}
|
|
3447
3447
|
});
|
|
3448
3448
|
try {
|
|
3449
|
-
|
|
3449
|
+
var _this$observer;
|
|
3450
|
+
(_this$observer = this.observer) === null || _this$observer === void 0 ? void 0 : _this$observer.unobserve(target);
|
|
3450
3451
|
} catch (e3) {
|
|
3451
3452
|
}
|
|
3452
|
-
this.observer && this.observer.unobserve(target);
|
|
3453
3453
|
i2 > -1 && this.__handlers.splice(i2, 1);
|
|
3454
3454
|
}
|
|
3455
3455
|
}, {
|
|
3456
3456
|
key: "destroyObserver",
|
|
3457
3457
|
value: function destroyObserver() {
|
|
3458
|
-
|
|
3458
|
+
var _this$observer2;
|
|
3459
|
+
(_this$observer2 = this.observer) === null || _this$observer2 === void 0 ? void 0 : _this$observer2.disconnect();
|
|
3459
3460
|
this.observer = null;
|
|
3460
3461
|
this.__handlers = null;
|
|
3461
3462
|
}
|
|
@@ -3487,7 +3488,8 @@ function addObserver(target, handler) {
|
|
|
3487
3488
|
return resizeObserver;
|
|
3488
3489
|
}
|
|
3489
3490
|
function unObserver(target, handler) {
|
|
3490
|
-
|
|
3491
|
+
var _resizeObserver;
|
|
3492
|
+
(_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 ? void 0 : _resizeObserver.unObserver(target, handler);
|
|
3491
3493
|
}
|
|
3492
3494
|
var pluginsManager = {
|
|
3493
3495
|
pluginGroup: {},
|
|
@@ -4485,10 +4487,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4485
4487
|
}
|
|
4486
4488
|
var _this$config = _this.config, autoplay2 = _this$config.autoplay, defaultPlaybackRate = _this$config.defaultPlaybackRate;
|
|
4487
4489
|
XG_DEBUG.logInfo("player", "canPlayFunc, startTime", _this.__startTime);
|
|
4488
|
-
|
|
4489
|
-
_this.currentTime = _this.__startTime > _this.duration ? _this.duration : _this.__startTime;
|
|
4490
|
-
_this.__startTime = -1;
|
|
4491
|
-
}
|
|
4490
|
+
_this._seekToStartTime();
|
|
4492
4491
|
_this.playbackRate = defaultPlaybackRate;
|
|
4493
4492
|
(autoplay2 || _this._useAutoplay) && _this.mediaPlay();
|
|
4494
4493
|
_this.off(CANPLAY, _this.canPlayFunc);
|
|
@@ -5110,10 +5109,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5110
5109
|
reject(e3);
|
|
5111
5110
|
};
|
|
5112
5111
|
var _canplay = function _canplay2() {
|
|
5113
|
-
|
|
5114
|
-
_this9.currentTime = _this9.__startTime;
|
|
5115
|
-
_this9.__startTime = -1;
|
|
5116
|
-
}
|
|
5112
|
+
_this9._seekToStartTime();
|
|
5117
5113
|
if (isPaused) {
|
|
5118
5114
|
_this9.pause();
|
|
5119
5115
|
}
|
|
@@ -5734,11 +5730,17 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5734
5730
|
}, {
|
|
5735
5731
|
key: "onLoadeddata",
|
|
5736
5732
|
value: function onLoadeddata() {
|
|
5733
|
+
var _this22 = this;
|
|
5737
5734
|
this.isError = false;
|
|
5738
5735
|
this.isSeeking = false;
|
|
5739
|
-
if (this.__startTime > 0
|
|
5740
|
-
this.
|
|
5741
|
-
|
|
5736
|
+
if (this.__startTime > 0) {
|
|
5737
|
+
if (this.duration > 0) {
|
|
5738
|
+
this._seekToStartTime();
|
|
5739
|
+
} else {
|
|
5740
|
+
this.once(DURATION_CHANGE, function() {
|
|
5741
|
+
_this22._seekToStartTime();
|
|
5742
|
+
});
|
|
5743
|
+
}
|
|
5742
5744
|
}
|
|
5743
5745
|
}
|
|
5744
5746
|
}, {
|
|
@@ -5807,27 +5809,27 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5807
5809
|
}, {
|
|
5808
5810
|
key: "onWaiting",
|
|
5809
5811
|
value: function onWaiting() {
|
|
5810
|
-
var
|
|
5812
|
+
var _this23 = this;
|
|
5811
5813
|
if (this.waitTimer) {
|
|
5812
5814
|
util$1.clearTimeout(this, this.waitTimer);
|
|
5813
5815
|
}
|
|
5814
5816
|
this.updateAcc("waiting");
|
|
5815
5817
|
this.waitTimer = util$1.setTimeout(this, function() {
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
util$1.clearTimeout(
|
|
5819
|
-
|
|
5818
|
+
_this23.addClass(STATE_CLASS.LOADING);
|
|
5819
|
+
_this23.emit(LOADING);
|
|
5820
|
+
util$1.clearTimeout(_this23, _this23.waitTimer);
|
|
5821
|
+
_this23.waitTimer = null;
|
|
5820
5822
|
}, this.config.minWaitDelay);
|
|
5821
5823
|
}
|
|
5822
5824
|
}, {
|
|
5823
5825
|
key: "onPlaying",
|
|
5824
5826
|
value: function onPlaying() {
|
|
5825
|
-
var
|
|
5827
|
+
var _this24 = this;
|
|
5826
5828
|
this.isError = false;
|
|
5827
5829
|
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;
|
|
5828
5830
|
var clsList = [NO_START, PAUSED, ENDED2, ERROR2, REPLAY2, LOADING2];
|
|
5829
5831
|
clsList.forEach(function(cls) {
|
|
5830
|
-
|
|
5832
|
+
_this24.removeClass(cls);
|
|
5831
5833
|
});
|
|
5832
5834
|
if (!this._accPlayed.t && !this.paused && !this.ended) {
|
|
5833
5835
|
this._accPlayed.t = (/* @__PURE__ */ new Date()).getTime();
|
|
@@ -5988,14 +5990,14 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5988
5990
|
}, {
|
|
5989
5991
|
key: "setConfig",
|
|
5990
5992
|
value: function setConfig(config) {
|
|
5991
|
-
var
|
|
5993
|
+
var _this25 = this;
|
|
5992
5994
|
if (!config) {
|
|
5993
5995
|
return;
|
|
5994
5996
|
}
|
|
5995
5997
|
Object.keys(config).map(function(key) {
|
|
5996
5998
|
if (key !== "plugins") {
|
|
5997
|
-
|
|
5998
|
-
var plugin =
|
|
5999
|
+
_this25.config[key] = config[key];
|
|
6000
|
+
var plugin = _this25.plugins[key.toLowerCase()];
|
|
5999
6001
|
if (plugin && util$1.typeOf(plugin.setConfig) === "Function") {
|
|
6000
6002
|
plugin.setConfig(config[key]);
|
|
6001
6003
|
}
|
|
@@ -6005,20 +6007,20 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6005
6007
|
}, {
|
|
6006
6008
|
key: "playNext",
|
|
6007
6009
|
value: function playNext(config) {
|
|
6008
|
-
var
|
|
6010
|
+
var _this26 = this;
|
|
6009
6011
|
this.resetState();
|
|
6010
6012
|
this.setConfig(config);
|
|
6011
6013
|
this._currentTime = 0;
|
|
6012
6014
|
this._duration = 0;
|
|
6013
6015
|
runHooks(this, "playnext", function() {
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
+
_this26.start();
|
|
6017
|
+
_this26.emit(PLAYNEXT, config);
|
|
6016
6018
|
});
|
|
6017
6019
|
}
|
|
6018
6020
|
}, {
|
|
6019
6021
|
key: "resize",
|
|
6020
6022
|
value: function resize() {
|
|
6021
|
-
var
|
|
6023
|
+
var _this27 = this;
|
|
6022
6024
|
if (!this.media) {
|
|
6023
6025
|
return;
|
|
6024
6026
|
}
|
|
@@ -6058,7 +6060,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6058
6060
|
}
|
|
6059
6061
|
if (!this.fullscreen && !this.cssfullscreen) {
|
|
6060
6062
|
Object.keys(_style).forEach(function(key) {
|
|
6061
|
-
|
|
6063
|
+
_this27.root.style[key] = _style[key];
|
|
6062
6064
|
});
|
|
6063
6065
|
}
|
|
6064
6066
|
if (videoFillMode === "fillHeight" && fit < videoFit || videoFillMode === "fillWidth" && fit > videoFit) {
|
|
@@ -6100,6 +6102,14 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6100
6102
|
url
|
|
6101
6103
|
};
|
|
6102
6104
|
}
|
|
6105
|
+
}, {
|
|
6106
|
+
key: "_seekToStartTime",
|
|
6107
|
+
value: function _seekToStartTime() {
|
|
6108
|
+
if (this.__startTime > 0 && this.duration > 0) {
|
|
6109
|
+
this.currentTime = this.__startTime > this.duration ? this.duration : this.__startTime;
|
|
6110
|
+
this.__startTime = -1;
|
|
6111
|
+
}
|
|
6112
|
+
}
|
|
6103
6113
|
}, {
|
|
6104
6114
|
key: "state",
|
|
6105
6115
|
get: function get() {
|
|
@@ -6150,15 +6160,15 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6150
6160
|
return this.config.definition.list || [];
|
|
6151
6161
|
},
|
|
6152
6162
|
set: function set(list) {
|
|
6153
|
-
var
|
|
6163
|
+
var _this28 = this;
|
|
6154
6164
|
var definition = this.config.definition;
|
|
6155
6165
|
var curDef = null;
|
|
6156
6166
|
var targetDef = null;
|
|
6157
6167
|
definition.list = list;
|
|
6158
6168
|
this.emit("resourceReady", list);
|
|
6159
6169
|
list.forEach(function(item) {
|
|
6160
|
-
var
|
|
6161
|
-
if (((
|
|
6170
|
+
var _this28$curDefinition;
|
|
6171
|
+
if (((_this28$curDefinition = _this28.curDefinition) === null || _this28$curDefinition === void 0 ? void 0 : _this28$curDefinition.definition) === item.definition) {
|
|
6162
6172
|
curDef = item;
|
|
6163
6173
|
}
|
|
6164
6174
|
if (definition.defaultDefinition === item.definition) {
|
|
@@ -8443,7 +8453,7 @@ var MobilePlugin = /* @__PURE__ */ function(_Plugin) {
|
|
|
8443
8453
|
}
|
|
8444
8454
|
this.on(DURATION_CHANGE, function() {
|
|
8445
8455
|
var player2 = _this2.player, config2 = _this2.config;
|
|
8446
|
-
if (player2.duration * 1e3 < config2.moveDuration) {
|
|
8456
|
+
if (player2.duration > 0 && player2.duration * 1e3 < config2.moveDuration) {
|
|
8447
8457
|
config2.moveDuration = player2.duration * 1e3;
|
|
8448
8458
|
}
|
|
8449
8459
|
});
|
|
@@ -8757,10 +8767,13 @@ var MobilePlugin = /* @__PURE__ */ function(_Plugin) {
|
|
|
8757
8767
|
}, {
|
|
8758
8768
|
key: "updateBrightness",
|
|
8759
8769
|
value: function updateBrightness(percent) {
|
|
8770
|
+
var pos = this.pos, config = this.config, xgMask = this.xgMask;
|
|
8771
|
+
if (!config.darkness) {
|
|
8772
|
+
return;
|
|
8773
|
+
}
|
|
8760
8774
|
if (this.player.rotateDeg) {
|
|
8761
8775
|
percent = -percent;
|
|
8762
8776
|
}
|
|
8763
|
-
var pos = this.pos, config = this.config, xgMask = this.xgMask;
|
|
8764
8777
|
var light = pos.light + 0.8 * percent;
|
|
8765
8778
|
light = light > config.maxDarkness ? config.maxDarkness : light < 0 ? 0 : light;
|
|
8766
8779
|
if (xgMask) {
|
|
@@ -13742,7 +13755,7 @@ class VePlayerBase {
|
|
|
13742
13755
|
* @returns
|
|
13743
13756
|
*/
|
|
13744
13757
|
get playerVersion() {
|
|
13745
|
-
return "2.4.1-rc.
|
|
13758
|
+
return "2.4.1-rc.1";
|
|
13746
13759
|
}
|
|
13747
13760
|
/** {zh}
|
|
13748
13761
|
* @brief 获取当前播放视频的清晰度唯一标识(definition)。
|
|
@@ -22029,9 +22042,9 @@ class Logger extends Plugin {
|
|
|
22029
22042
|
user_id: this._userId,
|
|
22030
22043
|
device_id: this._deviceId,
|
|
22031
22044
|
ext: {
|
|
22032
|
-
veplayer_version: "2.4.1-rc.
|
|
22033
|
-
flv_version: "3.0.
|
|
22034
|
-
hls_version: "3.0.
|
|
22045
|
+
veplayer_version: "2.4.1-rc.1",
|
|
22046
|
+
flv_version: "3.0.20-rc.3",
|
|
22047
|
+
hls_version: "3.0.20-rc.3",
|
|
22035
22048
|
rts_version: "0.2.1-alpha.1"
|
|
22036
22049
|
}
|
|
22037
22050
|
});
|
|
@@ -22497,6 +22510,28 @@ class VePlayerLive extends VePlayerBase {
|
|
|
22497
22510
|
var _a, _b, _c;
|
|
22498
22511
|
return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.flv) == null ? void 0 : _c.getStats();
|
|
22499
22512
|
}
|
|
22513
|
+
/** {zh}
|
|
22514
|
+
* @brief 调用此方法开始播放 。
|
|
22515
|
+
*/
|
|
22516
|
+
/** {en}
|
|
22517
|
+
* @brief Starts playback.
|
|
22518
|
+
*/
|
|
22519
|
+
play() {
|
|
22520
|
+
this.openAbr();
|
|
22521
|
+
/* istanbul ignore next -- @preserve */
|
|
22522
|
+
return this._player.play();
|
|
22523
|
+
}
|
|
22524
|
+
/** {zh}
|
|
22525
|
+
* @brief 调用此方法暂停播放。
|
|
22526
|
+
*/
|
|
22527
|
+
/** {en}
|
|
22528
|
+
* @brief Pauses playback.
|
|
22529
|
+
*/
|
|
22530
|
+
pause() {
|
|
22531
|
+
this.closeAbr();
|
|
22532
|
+
/* istanbul ignore next -- @preserve */
|
|
22533
|
+
return this._player.pause();
|
|
22534
|
+
}
|
|
22500
22535
|
}
|
|
22501
22536
|
async function createLivePlayer(options) {
|
|
22502
22537
|
var _a, _b;
|
package/esm/veplayer.live.d.ts
CHANGED
|
@@ -5920,6 +5920,20 @@ declare class VePlayerLive extends VePlayerBase {
|
|
|
5920
5920
|
* @returns
|
|
5921
5921
|
*/
|
|
5922
5922
|
getFLVStats(): FlvStats;
|
|
5923
|
+
/** {zh}
|
|
5924
|
+
* @brief 调用此方法开始播放 。
|
|
5925
|
+
*/
|
|
5926
|
+
/** {en}
|
|
5927
|
+
* @brief Starts playback.
|
|
5928
|
+
*/
|
|
5929
|
+
play(): any;
|
|
5930
|
+
/** {zh}
|
|
5931
|
+
* @brief 调用此方法暂停播放。
|
|
5932
|
+
*/
|
|
5933
|
+
/** {en}
|
|
5934
|
+
* @brief Pauses playback.
|
|
5935
|
+
*/
|
|
5936
|
+
pause(): void;
|
|
5923
5937
|
}
|
|
5924
5938
|
/** {zh}
|
|
5925
5939
|
* @detail api
|
|
@@ -10730,6 +10744,20 @@ declare namespace live {
|
|
|
10730
10744
|
* @returns
|
|
10731
10745
|
*/
|
|
10732
10746
|
getFLVStats(): FlvStats;
|
|
10747
|
+
/** {zh}
|
|
10748
|
+
* @brief 调用此方法开始播放 。
|
|
10749
|
+
*/
|
|
10750
|
+
/** {en}
|
|
10751
|
+
* @brief Starts playback.
|
|
10752
|
+
*/
|
|
10753
|
+
play(): any;
|
|
10754
|
+
/** {zh}
|
|
10755
|
+
* @brief 调用此方法暂停播放。
|
|
10756
|
+
*/
|
|
10757
|
+
/** {en}
|
|
10758
|
+
* @brief Pauses playback.
|
|
10759
|
+
*/
|
|
10760
|
+
pause(): void;
|
|
10733
10761
|
}
|
|
10734
10762
|
/** {zh}
|
|
10735
10763
|
* @detail api
|
|
@@ -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", "
|
|
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"];
|
|
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.20-rc.3";
|
|
1461
1461
|
var ERROR_TYPE_MAP = {
|
|
1462
1462
|
1: "media",
|
|
1463
1463
|
2: "media",
|
|
@@ -3417,7 +3417,7 @@ var ResizeObserver = /* @__PURE__ */ function() {
|
|
|
3417
3417
|
if (!this.observer) {
|
|
3418
3418
|
return;
|
|
3419
3419
|
}
|
|
3420
|
-
this.observer
|
|
3420
|
+
this.observer.observe(target);
|
|
3421
3421
|
var _pid = target.getAttribute(PLATER_ID);
|
|
3422
3422
|
var __handlers = this.__handlers;
|
|
3423
3423
|
var index = -1;
|
|
@@ -3446,16 +3446,17 @@ var ResizeObserver = /* @__PURE__ */ function() {
|
|
|
3446
3446
|
}
|
|
3447
3447
|
});
|
|
3448
3448
|
try {
|
|
3449
|
-
|
|
3449
|
+
var _this$observer;
|
|
3450
|
+
(_this$observer = this.observer) === null || _this$observer === void 0 ? void 0 : _this$observer.unobserve(target);
|
|
3450
3451
|
} catch (e3) {
|
|
3451
3452
|
}
|
|
3452
|
-
this.observer && this.observer.unobserve(target);
|
|
3453
3453
|
i2 > -1 && this.__handlers.splice(i2, 1);
|
|
3454
3454
|
}
|
|
3455
3455
|
}, {
|
|
3456
3456
|
key: "destroyObserver",
|
|
3457
3457
|
value: function destroyObserver() {
|
|
3458
|
-
|
|
3458
|
+
var _this$observer2;
|
|
3459
|
+
(_this$observer2 = this.observer) === null || _this$observer2 === void 0 ? void 0 : _this$observer2.disconnect();
|
|
3459
3460
|
this.observer = null;
|
|
3460
3461
|
this.__handlers = null;
|
|
3461
3462
|
}
|
|
@@ -3487,7 +3488,8 @@ function addObserver(target, handler) {
|
|
|
3487
3488
|
return resizeObserver;
|
|
3488
3489
|
}
|
|
3489
3490
|
function unObserver(target, handler) {
|
|
3490
|
-
|
|
3491
|
+
var _resizeObserver;
|
|
3492
|
+
(_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 ? void 0 : _resizeObserver.unObserver(target, handler);
|
|
3491
3493
|
}
|
|
3492
3494
|
var pluginsManager = {
|
|
3493
3495
|
pluginGroup: {},
|
|
@@ -4485,10 +4487,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4485
4487
|
}
|
|
4486
4488
|
var _this$config = _this.config, autoplay2 = _this$config.autoplay, defaultPlaybackRate = _this$config.defaultPlaybackRate;
|
|
4487
4489
|
XG_DEBUG.logInfo("player", "canPlayFunc, startTime", _this.__startTime);
|
|
4488
|
-
|
|
4489
|
-
_this.currentTime = _this.__startTime > _this.duration ? _this.duration : _this.__startTime;
|
|
4490
|
-
_this.__startTime = -1;
|
|
4491
|
-
}
|
|
4490
|
+
_this._seekToStartTime();
|
|
4492
4491
|
_this.playbackRate = defaultPlaybackRate;
|
|
4493
4492
|
(autoplay2 || _this._useAutoplay) && _this.mediaPlay();
|
|
4494
4493
|
_this.off(CANPLAY, _this.canPlayFunc);
|
|
@@ -5110,10 +5109,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5110
5109
|
reject(e3);
|
|
5111
5110
|
};
|
|
5112
5111
|
var _canplay = function _canplay2() {
|
|
5113
|
-
|
|
5114
|
-
_this9.currentTime = _this9.__startTime;
|
|
5115
|
-
_this9.__startTime = -1;
|
|
5116
|
-
}
|
|
5112
|
+
_this9._seekToStartTime();
|
|
5117
5113
|
if (isPaused) {
|
|
5118
5114
|
_this9.pause();
|
|
5119
5115
|
}
|
|
@@ -5734,11 +5730,17 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5734
5730
|
}, {
|
|
5735
5731
|
key: "onLoadeddata",
|
|
5736
5732
|
value: function onLoadeddata() {
|
|
5733
|
+
var _this22 = this;
|
|
5737
5734
|
this.isError = false;
|
|
5738
5735
|
this.isSeeking = false;
|
|
5739
|
-
if (this.__startTime > 0
|
|
5740
|
-
this.
|
|
5741
|
-
|
|
5736
|
+
if (this.__startTime > 0) {
|
|
5737
|
+
if (this.duration > 0) {
|
|
5738
|
+
this._seekToStartTime();
|
|
5739
|
+
} else {
|
|
5740
|
+
this.once(DURATION_CHANGE, function() {
|
|
5741
|
+
_this22._seekToStartTime();
|
|
5742
|
+
});
|
|
5743
|
+
}
|
|
5742
5744
|
}
|
|
5743
5745
|
}
|
|
5744
5746
|
}, {
|
|
@@ -5807,27 +5809,27 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5807
5809
|
}, {
|
|
5808
5810
|
key: "onWaiting",
|
|
5809
5811
|
value: function onWaiting() {
|
|
5810
|
-
var
|
|
5812
|
+
var _this23 = this;
|
|
5811
5813
|
if (this.waitTimer) {
|
|
5812
5814
|
util$1.clearTimeout(this, this.waitTimer);
|
|
5813
5815
|
}
|
|
5814
5816
|
this.updateAcc("waiting");
|
|
5815
5817
|
this.waitTimer = util$1.setTimeout(this, function() {
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
util$1.clearTimeout(
|
|
5819
|
-
|
|
5818
|
+
_this23.addClass(STATE_CLASS.LOADING);
|
|
5819
|
+
_this23.emit(LOADING);
|
|
5820
|
+
util$1.clearTimeout(_this23, _this23.waitTimer);
|
|
5821
|
+
_this23.waitTimer = null;
|
|
5820
5822
|
}, this.config.minWaitDelay);
|
|
5821
5823
|
}
|
|
5822
5824
|
}, {
|
|
5823
5825
|
key: "onPlaying",
|
|
5824
5826
|
value: function onPlaying() {
|
|
5825
|
-
var
|
|
5827
|
+
var _this24 = this;
|
|
5826
5828
|
this.isError = false;
|
|
5827
5829
|
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;
|
|
5828
5830
|
var clsList = [NO_START, PAUSED, ENDED2, ERROR2, REPLAY2, LOADING2];
|
|
5829
5831
|
clsList.forEach(function(cls) {
|
|
5830
|
-
|
|
5832
|
+
_this24.removeClass(cls);
|
|
5831
5833
|
});
|
|
5832
5834
|
if (!this._accPlayed.t && !this.paused && !this.ended) {
|
|
5833
5835
|
this._accPlayed.t = (/* @__PURE__ */ new Date()).getTime();
|
|
@@ -5988,14 +5990,14 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5988
5990
|
}, {
|
|
5989
5991
|
key: "setConfig",
|
|
5990
5992
|
value: function setConfig(config) {
|
|
5991
|
-
var
|
|
5993
|
+
var _this25 = this;
|
|
5992
5994
|
if (!config) {
|
|
5993
5995
|
return;
|
|
5994
5996
|
}
|
|
5995
5997
|
Object.keys(config).map(function(key) {
|
|
5996
5998
|
if (key !== "plugins") {
|
|
5997
|
-
|
|
5998
|
-
var plugin =
|
|
5999
|
+
_this25.config[key] = config[key];
|
|
6000
|
+
var plugin = _this25.plugins[key.toLowerCase()];
|
|
5999
6001
|
if (plugin && util$1.typeOf(plugin.setConfig) === "Function") {
|
|
6000
6002
|
plugin.setConfig(config[key]);
|
|
6001
6003
|
}
|
|
@@ -6005,20 +6007,20 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6005
6007
|
}, {
|
|
6006
6008
|
key: "playNext",
|
|
6007
6009
|
value: function playNext(config) {
|
|
6008
|
-
var
|
|
6010
|
+
var _this26 = this;
|
|
6009
6011
|
this.resetState();
|
|
6010
6012
|
this.setConfig(config);
|
|
6011
6013
|
this._currentTime = 0;
|
|
6012
6014
|
this._duration = 0;
|
|
6013
6015
|
runHooks(this, "playnext", function() {
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
+
_this26.start();
|
|
6017
|
+
_this26.emit(PLAYNEXT, config);
|
|
6016
6018
|
});
|
|
6017
6019
|
}
|
|
6018
6020
|
}, {
|
|
6019
6021
|
key: "resize",
|
|
6020
6022
|
value: function resize() {
|
|
6021
|
-
var
|
|
6023
|
+
var _this27 = this;
|
|
6022
6024
|
if (!this.media) {
|
|
6023
6025
|
return;
|
|
6024
6026
|
}
|
|
@@ -6058,7 +6060,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6058
6060
|
}
|
|
6059
6061
|
if (!this.fullscreen && !this.cssfullscreen) {
|
|
6060
6062
|
Object.keys(_style).forEach(function(key) {
|
|
6061
|
-
|
|
6063
|
+
_this27.root.style[key] = _style[key];
|
|
6062
6064
|
});
|
|
6063
6065
|
}
|
|
6064
6066
|
if (videoFillMode === "fillHeight" && fit < videoFit || videoFillMode === "fillWidth" && fit > videoFit) {
|
|
@@ -6100,6 +6102,14 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6100
6102
|
url
|
|
6101
6103
|
};
|
|
6102
6104
|
}
|
|
6105
|
+
}, {
|
|
6106
|
+
key: "_seekToStartTime",
|
|
6107
|
+
value: function _seekToStartTime() {
|
|
6108
|
+
if (this.__startTime > 0 && this.duration > 0) {
|
|
6109
|
+
this.currentTime = this.__startTime > this.duration ? this.duration : this.__startTime;
|
|
6110
|
+
this.__startTime = -1;
|
|
6111
|
+
}
|
|
6112
|
+
}
|
|
6103
6113
|
}, {
|
|
6104
6114
|
key: "state",
|
|
6105
6115
|
get: function get() {
|
|
@@ -6150,15 +6160,15 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6150
6160
|
return this.config.definition.list || [];
|
|
6151
6161
|
},
|
|
6152
6162
|
set: function set(list) {
|
|
6153
|
-
var
|
|
6163
|
+
var _this28 = this;
|
|
6154
6164
|
var definition = this.config.definition;
|
|
6155
6165
|
var curDef = null;
|
|
6156
6166
|
var targetDef = null;
|
|
6157
6167
|
definition.list = list;
|
|
6158
6168
|
this.emit("resourceReady", list);
|
|
6159
6169
|
list.forEach(function(item) {
|
|
6160
|
-
var
|
|
6161
|
-
if (((
|
|
6170
|
+
var _this28$curDefinition;
|
|
6171
|
+
if (((_this28$curDefinition = _this28.curDefinition) === null || _this28$curDefinition === void 0 ? void 0 : _this28$curDefinition.definition) === item.definition) {
|
|
6162
6172
|
curDef = item;
|
|
6163
6173
|
}
|
|
6164
6174
|
if (definition.defaultDefinition === item.definition) {
|
|
@@ -8443,7 +8453,7 @@ var MobilePlugin = /* @__PURE__ */ function(_Plugin) {
|
|
|
8443
8453
|
}
|
|
8444
8454
|
this.on(DURATION_CHANGE, function() {
|
|
8445
8455
|
var player2 = _this2.player, config2 = _this2.config;
|
|
8446
|
-
if (player2.duration * 1e3 < config2.moveDuration) {
|
|
8456
|
+
if (player2.duration > 0 && player2.duration * 1e3 < config2.moveDuration) {
|
|
8447
8457
|
config2.moveDuration = player2.duration * 1e3;
|
|
8448
8458
|
}
|
|
8449
8459
|
});
|
|
@@ -8757,10 +8767,13 @@ var MobilePlugin = /* @__PURE__ */ function(_Plugin) {
|
|
|
8757
8767
|
}, {
|
|
8758
8768
|
key: "updateBrightness",
|
|
8759
8769
|
value: function updateBrightness(percent) {
|
|
8770
|
+
var pos = this.pos, config = this.config, xgMask = this.xgMask;
|
|
8771
|
+
if (!config.darkness) {
|
|
8772
|
+
return;
|
|
8773
|
+
}
|
|
8760
8774
|
if (this.player.rotateDeg) {
|
|
8761
8775
|
percent = -percent;
|
|
8762
8776
|
}
|
|
8763
|
-
var pos = this.pos, config = this.config, xgMask = this.xgMask;
|
|
8764
8777
|
var light = pos.light + 0.8 * percent;
|
|
8765
8778
|
light = light > config.maxDarkness ? config.maxDarkness : light < 0 ? 0 : light;
|
|
8766
8779
|
if (xgMask) {
|
|
@@ -13742,7 +13755,7 @@ class VePlayerBase {
|
|
|
13742
13755
|
* @returns
|
|
13743
13756
|
*/
|
|
13744
13757
|
get playerVersion() {
|
|
13745
|
-
return "2.4.1-rc.
|
|
13758
|
+
return "2.4.1-rc.1";
|
|
13746
13759
|
}
|
|
13747
13760
|
/** {zh}
|
|
13748
13761
|
* @brief 获取当前播放视频的清晰度唯一标识(definition)。
|
|
@@ -22029,9 +22042,9 @@ class Logger extends Plugin {
|
|
|
22029
22042
|
user_id: this._userId,
|
|
22030
22043
|
device_id: this._deviceId,
|
|
22031
22044
|
ext: {
|
|
22032
|
-
veplayer_version: "2.4.1-rc.
|
|
22033
|
-
flv_version: "3.0.
|
|
22034
|
-
hls_version: "3.0.
|
|
22045
|
+
veplayer_version: "2.4.1-rc.1",
|
|
22046
|
+
flv_version: "3.0.20-rc.3",
|
|
22047
|
+
hls_version: "3.0.20-rc.3",
|
|
22035
22048
|
rts_version: "0.2.1-alpha.1"
|
|
22036
22049
|
}
|
|
22037
22050
|
});
|
|
@@ -22497,6 +22510,28 @@ class VePlayerLive extends VePlayerBase {
|
|
|
22497
22510
|
var _a, _b, _c;
|
|
22498
22511
|
return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.flv) == null ? void 0 : _c.getStats();
|
|
22499
22512
|
}
|
|
22513
|
+
/** {zh}
|
|
22514
|
+
* @brief 调用此方法开始播放 。
|
|
22515
|
+
*/
|
|
22516
|
+
/** {en}
|
|
22517
|
+
* @brief Starts playback.
|
|
22518
|
+
*/
|
|
22519
|
+
play() {
|
|
22520
|
+
this.openAbr();
|
|
22521
|
+
/* istanbul ignore next -- @preserve */
|
|
22522
|
+
return this._player.play();
|
|
22523
|
+
}
|
|
22524
|
+
/** {zh}
|
|
22525
|
+
* @brief 调用此方法暂停播放。
|
|
22526
|
+
*/
|
|
22527
|
+
/** {en}
|
|
22528
|
+
* @brief Pauses playback.
|
|
22529
|
+
*/
|
|
22530
|
+
pause() {
|
|
22531
|
+
this.closeAbr();
|
|
22532
|
+
/* istanbul ignore next -- @preserve */
|
|
22533
|
+
return this._player.pause();
|
|
22534
|
+
}
|
|
22500
22535
|
}
|
|
22501
22536
|
async function createLivePlayer(options) {
|
|
22502
22537
|
var _a, _b;
|