@volcengine/veplayer 2.2.0-rc.0 → 2.2.0-rc.2
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 +2 -6
- package/esm/veplayer.biz.live.development.js +28 -53
- package/esm/veplayer.biz.live.production.js +1 -1
- package/esm/veplayer.d.ts +16 -10
- package/esm/veplayer.development.css +1 -1
- package/esm/veplayer.development.js +147 -81
- package/esm/veplayer.live.d.ts +16 -10
- package/esm/veplayer.live.development.css +1 -1
- package/esm/veplayer.live.development.js +147 -81
- package/esm/veplayer.live.production.css +1 -1
- package/esm/veplayer.live.production.js +3 -3
- package/esm/veplayer.production.css +1 -1
- package/esm/veplayer.production.js +3 -3
- package/esm/veplayer.vod.d.ts +2 -6
- package/esm/veplayer.vod.development.css +1 -1
- package/esm/veplayer.vod.development.js +94 -19
- package/esm/veplayer.vod.production.css +1 -1
- package/esm/veplayer.vod.production.js +2 -2
- package/package.json +2 -1
- package/umd/index.d.ts +2 -6
- package/umd/veplayer.biz.live.development.js +28 -53
- package/umd/veplayer.biz.live.production.js +1 -1
- package/umd/veplayer.d.ts +16 -10
- package/umd/veplayer.development.css +1 -1
- package/umd/veplayer.development.js +147 -81
- package/umd/veplayer.live.d.ts +16 -10
- package/umd/veplayer.live.development.css +1 -1
- package/umd/veplayer.live.development.js +147 -81
- package/umd/veplayer.live.production.css +1 -1
- package/umd/veplayer.live.production.js +1 -1
- package/umd/veplayer.production.css +1 -1
- package/umd/veplayer.production.js +1 -1
- package/umd/veplayer.vod.d.ts +2 -6
- package/umd/veplayer.vod.development.css +1 -1
- package/umd/veplayer.vod.development.js +94 -19
- package/umd/veplayer.vod.production.css +1 -1
- package/umd/veplayer.vod.production.js +1 -1
- package/veplayer.d.ts +6772 -0
- package/veplayer.live.d.ts +6774 -0
- package/veplayer.vod.d.ts +3171 -0
|
@@ -1016,7 +1016,7 @@ util$1.isMSE = function(video) {
|
|
|
1016
1016
|
return /^blob/.test(video.currentSrc) || /^blob/.test(video.src);
|
|
1017
1017
|
};
|
|
1018
1018
|
util$1.isBlob = function(url) {
|
|
1019
|
-
return /^blob/.test(url);
|
|
1019
|
+
return typeof url === "string" && /^blob/.test(url);
|
|
1020
1020
|
};
|
|
1021
1021
|
util$1.generateSessionId = function() {
|
|
1022
1022
|
var did = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
@@ -1070,7 +1070,24 @@ util$1.getTransformStyle = function() {
|
|
|
1070
1070
|
scale: 1,
|
|
1071
1071
|
rotate: 0
|
|
1072
1072
|
};
|
|
1073
|
-
|
|
1073
|
+
var transformValue = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
1074
|
+
var styles = {
|
|
1075
|
+
scale: "".concat(pos.scale || 1),
|
|
1076
|
+
translate: "".concat(pos.x || 0, "%, ").concat(pos.y || 0, "%"),
|
|
1077
|
+
rotate: "".concat(pos.rotate || 0, "deg")
|
|
1078
|
+
};
|
|
1079
|
+
var stylesKeys = Object.keys(styles);
|
|
1080
|
+
stylesKeys.forEach(function(key) {
|
|
1081
|
+
var reg = new RegExp("".concat(key, "\\([^\\(]+\\)"), "g");
|
|
1082
|
+
var fn = "".concat(key, "(").concat(styles[key], ")");
|
|
1083
|
+
if (reg.test(transformValue)) {
|
|
1084
|
+
reg.lastIndex = -1;
|
|
1085
|
+
transformValue = transformValue.replace(reg, fn);
|
|
1086
|
+
} else {
|
|
1087
|
+
transformValue += "".concat(fn, " ");
|
|
1088
|
+
}
|
|
1089
|
+
});
|
|
1090
|
+
return transformValue;
|
|
1074
1091
|
};
|
|
1075
1092
|
util$1.convertDeg = function(val) {
|
|
1076
1093
|
if (Math.abs(val) <= 1) {
|
|
@@ -1323,10 +1340,10 @@ var sniffer$1 = {
|
|
|
1323
1340
|
var isSymbian = /(?:SymbianOS)/.test(ua2) || isWindowsPhone;
|
|
1324
1341
|
var isAndroid2 = /(?:Android)/.test(ua2);
|
|
1325
1342
|
var isFireFox = /(?:Firefox)/.test(ua2);
|
|
1326
|
-
var
|
|
1343
|
+
var isIpad = /(?:iPad|PlayBook)/.test(ua2) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
1344
|
+
var isTablet = isIpad || isAndroid2 && !/(?:Mobile)/.test(ua2) || isFireFox && /(?:Tablet)/.test(ua2);
|
|
1327
1345
|
var isPhone = /(?:iPhone)/.test(ua2) && !isTablet;
|
|
1328
1346
|
var isPc = !isPhone && !isAndroid2 && !isSymbian && !isTablet;
|
|
1329
|
-
var isIpad = /(?:iPad|PlayBook)/.test(ua2);
|
|
1330
1347
|
return {
|
|
1331
1348
|
isTablet,
|
|
1332
1349
|
isPhone,
|
|
@@ -1437,7 +1454,7 @@ var sniffer$1 = {
|
|
|
1437
1454
|
}
|
|
1438
1455
|
}
|
|
1439
1456
|
};
|
|
1440
|
-
var version = "3.0.
|
|
1457
|
+
var version = "3.0.11-alpha.2";
|
|
1441
1458
|
var ERROR_TYPE_MAP = {
|
|
1442
1459
|
1: "media",
|
|
1443
1460
|
2: "media",
|
|
@@ -5662,6 +5679,9 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5662
5679
|
clsList.forEach(function(cls) {
|
|
5663
5680
|
_this23.removeClass(cls);
|
|
5664
5681
|
});
|
|
5682
|
+
if (!this._accPlayed.t && !this.paused && !this.ended) {
|
|
5683
|
+
this._accPlayed.t = (/* @__PURE__ */ new Date()).getTime();
|
|
5684
|
+
}
|
|
5665
5685
|
}
|
|
5666
5686
|
}, {
|
|
5667
5687
|
key: "onTimeupdate",
|
|
@@ -5785,7 +5805,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5785
5805
|
this.media.style.width = "".concat(rWidth, "px");
|
|
5786
5806
|
this.media.style.height = "".concat(rHeight, "px");
|
|
5787
5807
|
}
|
|
5788
|
-
var formStyle = util$1.getTransformStyle(_pos);
|
|
5808
|
+
var formStyle = util$1.getTransformStyle(_pos, this.media.style.transform || this.media.style.webkitTransform);
|
|
5789
5809
|
this.media.style.transform = formStyle;
|
|
5790
5810
|
this.media.style.webkitTransform = formStyle;
|
|
5791
5811
|
}
|
|
@@ -6596,11 +6616,31 @@ var Poster = /* @__PURE__ */ function(_Plugin) {
|
|
|
6596
6616
|
this.config.poster = poster;
|
|
6597
6617
|
this.root.style.backgroundImage = "url(".concat(poster, ")");
|
|
6598
6618
|
}
|
|
6619
|
+
}, {
|
|
6620
|
+
key: "getBgSize",
|
|
6621
|
+
value: function getBgSize(mode) {
|
|
6622
|
+
var _bg = "";
|
|
6623
|
+
switch (mode) {
|
|
6624
|
+
case "cover":
|
|
6625
|
+
_bg = "cover";
|
|
6626
|
+
break;
|
|
6627
|
+
case "container":
|
|
6628
|
+
_bg = "container";
|
|
6629
|
+
break;
|
|
6630
|
+
case "fixHeight":
|
|
6631
|
+
_bg = "auto 100%";
|
|
6632
|
+
break;
|
|
6633
|
+
default:
|
|
6634
|
+
_bg = "";
|
|
6635
|
+
}
|
|
6636
|
+
return _bg ? "background-size: ".concat(_bg, ";") : "";
|
|
6637
|
+
}
|
|
6599
6638
|
}, {
|
|
6600
6639
|
key: "render",
|
|
6601
6640
|
value: function render() {
|
|
6602
|
-
var _this$config = this.config, poster = _this$config.poster, hideCanplay = _this$config.hideCanplay;
|
|
6603
|
-
var
|
|
6641
|
+
var _this$config = this.config, poster = _this$config.poster, hideCanplay = _this$config.hideCanplay, fillMode = _this$config.fillMode;
|
|
6642
|
+
var _bg = this.getBgSize(fillMode);
|
|
6643
|
+
var style = poster ? "background-image:url(".concat(poster, ");").concat(_bg) : _bg;
|
|
6604
6644
|
return '<xg-poster class="xgplayer-poster '.concat(hideCanplay ? "xg-showplay" : "", '" style="').concat(style, '">\n </xg-poster>');
|
|
6605
6645
|
}
|
|
6606
6646
|
}], [{
|
|
@@ -6614,7 +6654,8 @@ var Poster = /* @__PURE__ */ function(_Plugin) {
|
|
|
6614
6654
|
return {
|
|
6615
6655
|
isEndedShow: true,
|
|
6616
6656
|
hideCanplay: false,
|
|
6617
|
-
poster: ""
|
|
6657
|
+
poster: "",
|
|
6658
|
+
fillMode: "fixWidth"
|
|
6618
6659
|
};
|
|
6619
6660
|
}
|
|
6620
6661
|
}]);
|
|
@@ -8646,7 +8687,7 @@ var Keyboard = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
8646
8687
|
var keyCode = e3.keyCode;
|
|
8647
8688
|
var _assertThisInitialize = _assertThisInitialized(_this), _keyState = _assertThisInitialize._keyState, player = _assertThisInitialize.player;
|
|
8648
8689
|
var _this$config = _this.config, disable = _this$config.disable, disableBodyTrigger = _this$config.disableBodyTrigger, isIgnoreUserActive = _this$config.isIgnoreUserActive;
|
|
8649
|
-
if (disable || disableBodyTrigger || !player.isUserActive
|
|
8690
|
+
if (disable || disableBodyTrigger || !(player.isUserActive || isIgnoreUserActive) || isDisableTag(e3.target) || !_this.checkIsVisible() || e3.metaKey || e3.altKey || e3.ctrlKey) {
|
|
8650
8691
|
_keyState.isBodyKeyDown = false;
|
|
8651
8692
|
return;
|
|
8652
8693
|
}
|
|
@@ -8675,9 +8716,6 @@ var Keyboard = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
8675
8716
|
if (_this.config.disable || _this.config.disableRootTrigger || e3.metaKey || e3.altKey || e3.ctrlKey) {
|
|
8676
8717
|
return;
|
|
8677
8718
|
}
|
|
8678
|
-
if (!_this.player.isUserActive && !_this.config.isIgnoreUserActive) {
|
|
8679
|
-
return;
|
|
8680
|
-
}
|
|
8681
8719
|
if (e3 && (e3.keyCode === 37 || _this.checkCode(e3.keyCode)) && (e3.target === _this.player.root || e3.target === _this.player.video || e3.target === _this.player.controls.el)) {
|
|
8682
8720
|
_keyState.isKeyDown = true;
|
|
8683
8721
|
}
|
|
@@ -8950,7 +8988,6 @@ var Keyboard = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
8950
8988
|
}
|
|
8951
8989
|
_keyState.tt = _t;
|
|
8952
8990
|
}
|
|
8953
|
-
preventDefault(e3);
|
|
8954
8991
|
this.handleKeyCode(e3.keyCode, e3, _keyState.isPress);
|
|
8955
8992
|
}
|
|
8956
8993
|
}, {
|
|
@@ -8987,6 +9024,7 @@ var Keyboard = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
8987
9024
|
isPress
|
|
8988
9025
|
}, this.keyCodeMap[arr[i2]]));
|
|
8989
9026
|
}
|
|
9027
|
+
preventDefault(event);
|
|
8990
9028
|
break;
|
|
8991
9029
|
}
|
|
8992
9030
|
}
|
|
@@ -9022,11 +9060,11 @@ var Keyboard = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
9022
9060
|
checkVisible: false,
|
|
9023
9061
|
disableBodyTrigger: false,
|
|
9024
9062
|
disableRootTrigger: false,
|
|
9025
|
-
isGlobalTrigger:
|
|
9063
|
+
isGlobalTrigger: true,
|
|
9026
9064
|
keyCodeMap: {},
|
|
9027
9065
|
disable: false,
|
|
9028
9066
|
playbackRate: 2,
|
|
9029
|
-
isIgnoreUserActive:
|
|
9067
|
+
isIgnoreUserActive: true
|
|
9030
9068
|
};
|
|
9031
9069
|
}
|
|
9032
9070
|
}]);
|
|
@@ -12335,6 +12373,41 @@ async function load(name, src2) {
|
|
|
12335
12373
|
});
|
|
12336
12374
|
}
|
|
12337
12375
|
}
|
|
12376
|
+
const appendSearchParams = (url, searchParams) => {
|
|
12377
|
+
var _a, _b;
|
|
12378
|
+
const urlObject = getUrlObject(url);
|
|
12379
|
+
if (!url || !urlObject) {
|
|
12380
|
+
return url ?? "";
|
|
12381
|
+
}
|
|
12382
|
+
const withoutProtocol = url.startsWith("//");
|
|
12383
|
+
for (const key in searchParams) {
|
|
12384
|
+
const value = searchParams[key];
|
|
12385
|
+
if (urlObject == null ? void 0 : urlObject.searchParams.has(key)) {
|
|
12386
|
+
(_a = urlObject == null ? void 0 : urlObject.searchParams) == null ? void 0 : _a.set(key, value);
|
|
12387
|
+
} else {
|
|
12388
|
+
(_b = urlObject == null ? void 0 : urlObject.searchParams) == null ? void 0 : _b.append(key, value);
|
|
12389
|
+
}
|
|
12390
|
+
}
|
|
12391
|
+
url = urlObject.toString();
|
|
12392
|
+
if (withoutProtocol) {
|
|
12393
|
+
return url == null ? void 0 : url.replace(location.protocol, "");
|
|
12394
|
+
}
|
|
12395
|
+
return url;
|
|
12396
|
+
};
|
|
12397
|
+
const getUrlObject = (url) => {
|
|
12398
|
+
if (!url) {
|
|
12399
|
+
return;
|
|
12400
|
+
}
|
|
12401
|
+
const withoutProtocol = url.startsWith("//");
|
|
12402
|
+
if (withoutProtocol) {
|
|
12403
|
+
url = location.protocol + url;
|
|
12404
|
+
}
|
|
12405
|
+
try {
|
|
12406
|
+
return new URL(url);
|
|
12407
|
+
} catch (error2) {
|
|
12408
|
+
return;
|
|
12409
|
+
}
|
|
12410
|
+
};
|
|
12338
12411
|
function isType(suffix) {
|
|
12339
12412
|
return function(url) {
|
|
12340
12413
|
return url == null ? void 0 : url.split("?")[0].toLowerCase().includes(suffix);
|
|
@@ -12370,14 +12443,16 @@ function isMseSupported(codec = Codec.H264) {
|
|
|
12370
12443
|
return sniffer$1.isMSESupport();
|
|
12371
12444
|
}
|
|
12372
12445
|
async function isSoftDecodeSupported() {
|
|
12373
|
-
const
|
|
12374
|
-
return
|
|
12446
|
+
const { XGVideoPlugin } = await load(DynamicModule.PluginXgvideo);
|
|
12447
|
+
return XGVideoPlugin == null ? void 0 : XGVideoPlugin.isSupported();
|
|
12375
12448
|
}
|
|
12376
12449
|
const util = {
|
|
12377
12450
|
...util$1,
|
|
12378
12451
|
getStreamType,
|
|
12379
12452
|
isMseSupported,
|
|
12380
|
-
isSoftDecodeSupported
|
|
12453
|
+
isSoftDecodeSupported,
|
|
12454
|
+
appendSearchParams,
|
|
12455
|
+
getUrlObject
|
|
12381
12456
|
};
|
|
12382
12457
|
var autoplay = "";
|
|
12383
12458
|
const { isWeixin, os, device } = sniffer$1;
|
|
@@ -18187,9 +18262,11 @@ class Lite {
|
|
|
18187
18262
|
}
|
|
18188
18263
|
}
|
|
18189
18264
|
const getFlvStrategy = async (options) => {
|
|
18190
|
-
var _a;
|
|
18265
|
+
var _a, _b, _c;
|
|
18191
18266
|
let mseStrategy;
|
|
18192
18267
|
let softStrategy;
|
|
18268
|
+
const enableLowLatency = ((_a = options == null ? void 0 : options.flv) == null ? void 0 : _a.enableLowLatency) && sniffer$1.device === "pc";
|
|
18269
|
+
const abrPts = ((_b = options == null ? void 0 : options.flv) == null ? void 0 : _b.abrPts) ?? "-800";
|
|
18193
18270
|
const codec = await getCodec(options);
|
|
18194
18271
|
const isSoftDecode$1 = await isSoftDecode(options, codec);
|
|
18195
18272
|
if (isSoftDecode$1) {
|
|
@@ -18206,11 +18283,21 @@ const getFlvStrategy = async (options) => {
|
|
|
18206
18283
|
(mseStrategy == null ? void 0 : mseStrategy.module) && load(mseStrategy.module).catch(() => void 0),
|
|
18207
18284
|
(softStrategy == null ? void 0 : softStrategy.module) && load(softStrategy.module).catch(() => void 0)
|
|
18208
18285
|
]);
|
|
18209
|
-
softModule && ((
|
|
18286
|
+
(softModule == null ? void 0 : softModule.XGVideoPlugin) && ((_c = softStrategy == null ? void 0 : softStrategy.afterLoad) == null ? void 0 : _c.call(softStrategy, softModule == null ? void 0 : softModule.XGVideoPlugin));
|
|
18210
18287
|
const combineOptions$1 = combineOptions([mseStrategy, softStrategy]);
|
|
18288
|
+
const plugins = [];
|
|
18289
|
+
if (enableLowLatency) {
|
|
18290
|
+
combineOptions$1.url = appendSearchParams(options.url, { abr_pt: abrPts });
|
|
18291
|
+
}
|
|
18292
|
+
if (mseModule) {
|
|
18293
|
+
plugins.push(mseModule.FlvPlugin);
|
|
18294
|
+
if (enableLowLatency) {
|
|
18295
|
+
plugins.push(mseModule.Adaptive);
|
|
18296
|
+
}
|
|
18297
|
+
}
|
|
18211
18298
|
return {
|
|
18212
18299
|
options: combineOptions$1,
|
|
18213
|
-
plugins
|
|
18300
|
+
plugins
|
|
18214
18301
|
};
|
|
18215
18302
|
};
|
|
18216
18303
|
const getHlsStrategy = async (options) => {
|
|
@@ -18233,26 +18320,31 @@ const getHlsStrategy = async (options) => {
|
|
|
18233
18320
|
(mseStrategy == null ? void 0 : mseStrategy.module) && load(mseStrategy.module).catch(() => void 0),
|
|
18234
18321
|
(softStrategy == null ? void 0 : softStrategy.module) && load(softStrategy.module).catch(() => void 0)
|
|
18235
18322
|
]);
|
|
18236
|
-
softModule && ((_b = softStrategy == null ? void 0 : softStrategy.afterLoad) == null ? void 0 : _b.call(softStrategy, softModule));
|
|
18323
|
+
(softModule == null ? void 0 : softModule.XGVideoPlugin) && ((_b = softStrategy == null ? void 0 : softStrategy.afterLoad) == null ? void 0 : _b.call(softStrategy, softModule == null ? void 0 : softModule.XGVideoPlugin));
|
|
18237
18324
|
const combineOptions$1 = combineOptions([mseStrategy, softStrategy]);
|
|
18238
18325
|
return {
|
|
18239
18326
|
options: combineOptions$1,
|
|
18240
|
-
plugins: mseModule ? [mseModule] : []
|
|
18327
|
+
plugins: (mseModule == null ? void 0 : mseModule.HlsPlugin) ? [mseModule.HlsPlugin] : []
|
|
18328
|
+
};
|
|
18329
|
+
};
|
|
18330
|
+
const createFlvMseStrategy = (options) => {
|
|
18331
|
+
var _a;
|
|
18332
|
+
return {
|
|
18333
|
+
options: {
|
|
18334
|
+
flv: {
|
|
18335
|
+
retryCount: 0,
|
|
18336
|
+
disconnectRetryCount: ((_a = options == null ? void 0 : options.flv) == null ? void 0 : _a.retryCount) ?? void 0,
|
|
18337
|
+
...(options == null ? void 0 : options.flv) ?? {}
|
|
18338
|
+
}
|
|
18339
|
+
},
|
|
18340
|
+
module: DynamicModule.PluginFlv
|
|
18241
18341
|
};
|
|
18242
18342
|
};
|
|
18243
|
-
const createFlvMseStrategy = (options) => ({
|
|
18244
|
-
options: {
|
|
18245
|
-
flv: {
|
|
18246
|
-
retryCount: 0,
|
|
18247
|
-
...(options == null ? void 0 : options.flv) ?? {}
|
|
18248
|
-
}
|
|
18249
|
-
},
|
|
18250
|
-
module: DynamicModule.PluginFlv
|
|
18251
|
-
});
|
|
18252
18343
|
const createHlsMseStrategy = (options) => ({
|
|
18253
18344
|
options: {
|
|
18254
18345
|
hls: {
|
|
18255
18346
|
retryCount: 0,
|
|
18347
|
+
pollRetryCount: 0,
|
|
18256
18348
|
...(options == null ? void 0 : options.hls) ?? {}
|
|
18257
18349
|
}
|
|
18258
18350
|
},
|
|
@@ -18371,50 +18463,15 @@ function create(errorCode, i18n) {
|
|
|
18371
18463
|
return new VeError2(ERRORS[errorCode], i18n);
|
|
18372
18464
|
}
|
|
18373
18465
|
async function isRTMSupported() {
|
|
18374
|
-
const
|
|
18375
|
-
return
|
|
18466
|
+
const { RtmPlugin } = await load(DynamicModule.PluginRtm);
|
|
18467
|
+
return RtmPlugin.isSupported();
|
|
18376
18468
|
}
|
|
18377
18469
|
async function isRTMSupportCodec(codec = RTMCodec.H264) {
|
|
18378
|
-
const
|
|
18470
|
+
const { RtmPlugin } = await load(DynamicModule.PluginRtm);
|
|
18379
18471
|
if (codec === RTMCodec.H264)
|
|
18380
|
-
return
|
|
18472
|
+
return RtmPlugin.isSupportedH264();
|
|
18381
18473
|
return false;
|
|
18382
18474
|
}
|
|
18383
|
-
const appendSearchParams = (url, searchParams) => {
|
|
18384
|
-
var _a, _b;
|
|
18385
|
-
const urlObject = getUrlObject(url);
|
|
18386
|
-
if (!url || !urlObject) {
|
|
18387
|
-
return url ?? "";
|
|
18388
|
-
}
|
|
18389
|
-
const withoutProtocol = url.startsWith("//");
|
|
18390
|
-
for (const key in searchParams) {
|
|
18391
|
-
const value = searchParams[key];
|
|
18392
|
-
if (urlObject == null ? void 0 : urlObject.searchParams.has(key)) {
|
|
18393
|
-
(_a = urlObject == null ? void 0 : urlObject.searchParams) == null ? void 0 : _a.set(key, value);
|
|
18394
|
-
} else {
|
|
18395
|
-
(_b = urlObject == null ? void 0 : urlObject.searchParams) == null ? void 0 : _b.append(key, value);
|
|
18396
|
-
}
|
|
18397
|
-
}
|
|
18398
|
-
url = urlObject.toString();
|
|
18399
|
-
if (withoutProtocol) {
|
|
18400
|
-
return url == null ? void 0 : url.replace(location.protocol, "");
|
|
18401
|
-
}
|
|
18402
|
-
return url;
|
|
18403
|
-
};
|
|
18404
|
-
const getUrlObject = (url) => {
|
|
18405
|
-
if (!url) {
|
|
18406
|
-
return;
|
|
18407
|
-
}
|
|
18408
|
-
const withoutProtocol = url.startsWith("//");
|
|
18409
|
-
if (withoutProtocol) {
|
|
18410
|
-
url = location.protocol + url;
|
|
18411
|
-
}
|
|
18412
|
-
try {
|
|
18413
|
-
return new URL(url);
|
|
18414
|
-
} catch (error2) {
|
|
18415
|
-
return;
|
|
18416
|
-
}
|
|
18417
|
-
};
|
|
18418
18475
|
const rtmStrategy = {
|
|
18419
18476
|
options: {},
|
|
18420
18477
|
module: DynamicModule.PluginRtm
|
|
@@ -18444,8 +18501,16 @@ const getRtmStrategy = async (options, player) => {
|
|
|
18444
18501
|
backupStrategy = createHlsMseStrategy(options);
|
|
18445
18502
|
}
|
|
18446
18503
|
const [rtmCdn, backupCdn] = await Promise.all([
|
|
18447
|
-
load(rtmStrategy.module).
|
|
18448
|
-
|
|
18504
|
+
load(rtmStrategy.module).then((module) => {
|
|
18505
|
+
return module.RtmPlugin;
|
|
18506
|
+
}).catch(() => void 0),
|
|
18507
|
+
backupStrategy && load(backupStrategy.module).then((module) => {
|
|
18508
|
+
if ((backupStrategy == null ? void 0 : backupStrategy.module) === DynamicModule.PluginFlv) {
|
|
18509
|
+
return module.FlvPlugin;
|
|
18510
|
+
} else if ((backupStrategy == null ? void 0 : backupStrategy.module) === DynamicModule.PluginHls) {
|
|
18511
|
+
return module.HlsPlugin;
|
|
18512
|
+
}
|
|
18513
|
+
}).catch(() => void 0)
|
|
18449
18514
|
]);
|
|
18450
18515
|
const [RTMSupported, RTMSupportCodec] = await Promise.all([
|
|
18451
18516
|
isRTMSupported(),
|
|
@@ -18478,7 +18543,7 @@ const getRtmStrategy = async (options, player) => {
|
|
|
18478
18543
|
return {
|
|
18479
18544
|
options: {
|
|
18480
18545
|
...(backupStrategy == null ? void 0 : backupStrategy.options) || {},
|
|
18481
|
-
url: enableRTMAutoTranscode ? appendSearchParams(url, { enableRTMAutoTranscode: "true" }) : void 0,
|
|
18546
|
+
url: enableRTMAutoTranscode ? util.appendSearchParams(url, { enableRTMAutoTranscode: "true" }) : void 0,
|
|
18482
18547
|
_RTMdegrade: void 0,
|
|
18483
18548
|
rts: {
|
|
18484
18549
|
retryCount: 0,
|
|
@@ -18688,7 +18753,7 @@ class Refresh extends Plugin {
|
|
|
18688
18753
|
`;
|
|
18689
18754
|
}
|
|
18690
18755
|
_handleRefresh(e3) {
|
|
18691
|
-
var _a, _b, _c;
|
|
18756
|
+
var _a, _b, _c, _d, _e, _f;
|
|
18692
18757
|
const { player } = this;
|
|
18693
18758
|
if (!player)
|
|
18694
18759
|
return;
|
|
@@ -18699,6 +18764,7 @@ class Refresh extends Plugin {
|
|
|
18699
18764
|
if (player) {
|
|
18700
18765
|
player.emit(Events.REFRESH_CLICK);
|
|
18701
18766
|
(_c = (_b = (_a = this.player) == null ? void 0 : _a.config) == null ? void 0 : _b.veplayer) == null ? void 0 : _c.retry();
|
|
18767
|
+
(_f = (_e = (_d = this.player) == null ? void 0 : _d.plugins) == null ? void 0 : _e.error) == null ? void 0 : _f.hideError();
|
|
18702
18768
|
}
|
|
18703
18769
|
player.once(CANPLAY, () => {
|
|
18704
18770
|
player.removeClass("xgplayer-is-enter");
|
|
@@ -21149,12 +21215,12 @@ const getUserId2 = () => {
|
|
|
21149
21215
|
return userId;
|
|
21150
21216
|
};
|
|
21151
21217
|
const generateUrlWithSessionId = (url) => {
|
|
21152
|
-
const urlObject = getUrlObject(url);
|
|
21218
|
+
const urlObject = util.getUrlObject(url);
|
|
21153
21219
|
if (!urlObject) {
|
|
21154
21220
|
return url ?? "";
|
|
21155
21221
|
}
|
|
21156
21222
|
if (!(urlObject == null ? void 0 : urlObject.searchParams.get("_session_id"))) {
|
|
21157
|
-
return appendSearchParams(url, { _session_id: generateSessionId() });
|
|
21223
|
+
return util.appendSearchParams(url, { _session_id: generateSessionId() });
|
|
21158
21224
|
}
|
|
21159
21225
|
return url;
|
|
21160
21226
|
};
|
|
@@ -21255,9 +21321,9 @@ class Logger extends Plugin {
|
|
|
21255
21321
|
user_id: this._userId,
|
|
21256
21322
|
device_id: this._deviceId,
|
|
21257
21323
|
ext: {
|
|
21258
|
-
veplayer_version: "2.2.0-rc.
|
|
21259
|
-
flv_version: "3.0.
|
|
21260
|
-
hls_version: "3.0.
|
|
21324
|
+
veplayer_version: "2.2.0-rc.2",
|
|
21325
|
+
flv_version: "3.0.11-alpha.2",
|
|
21326
|
+
hls_version: "3.0.11-alpha.2",
|
|
21261
21327
|
rts_version: "0.2.0-alpha.5"
|
|
21262
21328
|
}
|
|
21263
21329
|
});
|
package/esm/veplayer.live.d.ts
CHANGED
|
@@ -2829,18 +2829,14 @@ declare namespace strategy {
|
|
|
2829
2829
|
plugins?: undefined;
|
|
2830
2830
|
} | {
|
|
2831
2831
|
options: Partial<VePlayerBaseOptions>;
|
|
2832
|
-
plugins:
|
|
2833
|
-
[x: string]: any;
|
|
2834
|
-
}[];
|
|
2832
|
+
plugins: any[];
|
|
2835
2833
|
}>;
|
|
2836
2834
|
const getHlsStrategy: (options: VePlayerBaseOptions) => Promise<{
|
|
2837
2835
|
options?: undefined;
|
|
2838
2836
|
plugins?: undefined;
|
|
2839
2837
|
} | {
|
|
2840
2838
|
options: Partial<VePlayerBaseOptions>;
|
|
2841
|
-
plugins:
|
|
2842
|
-
[x: string]: any;
|
|
2843
|
-
}[];
|
|
2839
|
+
plugins: any[];
|
|
2844
2840
|
}>;
|
|
2845
2841
|
}
|
|
2846
2842
|
declare function getStreamType(url: string): "unknown" | "hls" | "flv" | "rtm" | "mp4" | "dash";
|
|
@@ -2863,10 +2859,14 @@ declare const util: {
|
|
|
2863
2859
|
getStreamType: typeof getStreamType;
|
|
2864
2860
|
isMseSupported: typeof isMseSupported;
|
|
2865
2861
|
isSoftDecodeSupported: typeof isSoftDecodeSupported;
|
|
2862
|
+
appendSearchParams: (url?: string | undefined, searchParams?: Record<string, string> | undefined) => string;
|
|
2863
|
+
getUrlObject: (url?: string | undefined) => URL | undefined;
|
|
2866
2864
|
createDom(el?: string | undefined, tpl?: string | undefined, attrs?: {
|
|
2867
2865
|
[propName: string]: any;
|
|
2868
2866
|
} | undefined, cname?: string | undefined): HTMLElement;
|
|
2869
|
-
createDomFromHtml(html: string, attrs?:
|
|
2867
|
+
createDomFromHtml(html: string, attrs?: {
|
|
2868
|
+
[propName: string]: any;
|
|
2869
|
+
} | undefined, classname?: string | undefined): HTMLElement;
|
|
2870
2870
|
hasClass(el: HTMLElement, className: string): boolean;
|
|
2871
2871
|
addClass(el: HTMLElement, className: string): void;
|
|
2872
2872
|
removeClass(el: HTMLElement, className: string): void;
|
|
@@ -2933,7 +2933,7 @@ declare const util: {
|
|
|
2933
2933
|
y: number;
|
|
2934
2934
|
scale: number;
|
|
2935
2935
|
rotate: number;
|
|
2936
|
-
} | undefined): string;
|
|
2936
|
+
} | undefined, transformValue?: string | undefined): string;
|
|
2937
2937
|
convertDeg(val: number): number;
|
|
2938
2938
|
getIndexByTime(time: any, segments: any): number;
|
|
2939
2939
|
getOffsetCurrentTime(currentTime: any, segments: any, index?: number | undefined): any;
|
|
@@ -3728,6 +3728,7 @@ interface Flv {
|
|
|
3728
3728
|
* @default 10000
|
|
3729
3729
|
*/
|
|
3730
3730
|
loadTimeout?: number;
|
|
3731
|
+
enableLowLatency?: boolean;
|
|
3731
3732
|
}
|
|
3732
3733
|
/**
|
|
3733
3734
|
* @list option
|
|
@@ -6014,10 +6015,14 @@ declare namespace live {
|
|
|
6014
6015
|
getStreamType: typeof getStreamType;
|
|
6015
6016
|
isMseSupported: typeof isMseSupported;
|
|
6016
6017
|
isSoftDecodeSupported: typeof isSoftDecodeSupported;
|
|
6018
|
+
appendSearchParams: (url?: string | undefined, searchParams?: Record<string, string> | undefined) => string;
|
|
6019
|
+
getUrlObject: (url?: string | undefined) => URL | undefined;
|
|
6017
6020
|
createDom(el?: string | undefined, tpl?: string | undefined, attrs?: {
|
|
6018
6021
|
[propName: string]: any;
|
|
6019
6022
|
} | undefined, cname?: string | undefined): HTMLElement;
|
|
6020
|
-
createDomFromHtml(html: string, attrs?:
|
|
6023
|
+
createDomFromHtml(html: string, attrs?: {
|
|
6024
|
+
[propName: string]: any;
|
|
6025
|
+
} | undefined, classname?: string | undefined): HTMLElement;
|
|
6021
6026
|
hasClass(el: HTMLElement, className: string): boolean;
|
|
6022
6027
|
addClass(el: HTMLElement, className: string): void;
|
|
6023
6028
|
removeClass(el: HTMLElement, className: string): void;
|
|
@@ -6084,7 +6089,7 @@ declare namespace live {
|
|
|
6084
6089
|
y: number;
|
|
6085
6090
|
scale: number;
|
|
6086
6091
|
rotate: number;
|
|
6087
|
-
} | undefined): string;
|
|
6092
|
+
} | undefined, transformValue?: string | undefined): string;
|
|
6088
6093
|
convertDeg(val: number): number;
|
|
6089
6094
|
getIndexByTime(time: any, segments: any): number;
|
|
6090
6095
|
getOffsetCurrentTime(currentTime: any, segments: any, index?: number | undefined): any;
|
|
@@ -6684,6 +6689,7 @@ declare namespace live {
|
|
|
6684
6689
|
* @default 10000
|
|
6685
6690
|
*/
|
|
6686
6691
|
loadTimeout?: number;
|
|
6692
|
+
enableLowLatency?: boolean;
|
|
6687
6693
|
}
|
|
6688
6694
|
/**
|
|
6689
6695
|
* @list option
|