@volcengine/veplayer 2.2.0-rc.0 → 2.2.0-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/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
|
@@ -1020,7 +1020,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1020
1020
|
return /^blob/.test(video.currentSrc) || /^blob/.test(video.src);
|
|
1021
1021
|
};
|
|
1022
1022
|
util$1.isBlob = function(url) {
|
|
1023
|
-
return /^blob/.test(url);
|
|
1023
|
+
return typeof url === "string" && /^blob/.test(url);
|
|
1024
1024
|
};
|
|
1025
1025
|
util$1.generateSessionId = function() {
|
|
1026
1026
|
var did = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
@@ -1074,7 +1074,24 @@ var __publicField = (obj, key, value) => {
|
|
|
1074
1074
|
scale: 1,
|
|
1075
1075
|
rotate: 0
|
|
1076
1076
|
};
|
|
1077
|
-
|
|
1077
|
+
var transformValue = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
1078
|
+
var styles = {
|
|
1079
|
+
scale: "".concat(pos.scale || 1),
|
|
1080
|
+
translate: "".concat(pos.x || 0, "%, ").concat(pos.y || 0, "%"),
|
|
1081
|
+
rotate: "".concat(pos.rotate || 0, "deg")
|
|
1082
|
+
};
|
|
1083
|
+
var stylesKeys = Object.keys(styles);
|
|
1084
|
+
stylesKeys.forEach(function(key) {
|
|
1085
|
+
var reg = new RegExp("".concat(key, "\\([^\\(]+\\)"), "g");
|
|
1086
|
+
var fn = "".concat(key, "(").concat(styles[key], ")");
|
|
1087
|
+
if (reg.test(transformValue)) {
|
|
1088
|
+
reg.lastIndex = -1;
|
|
1089
|
+
transformValue = transformValue.replace(reg, fn);
|
|
1090
|
+
} else {
|
|
1091
|
+
transformValue += "".concat(fn, " ");
|
|
1092
|
+
}
|
|
1093
|
+
});
|
|
1094
|
+
return transformValue;
|
|
1078
1095
|
};
|
|
1079
1096
|
util$1.convertDeg = function(val) {
|
|
1080
1097
|
if (Math.abs(val) <= 1) {
|
|
@@ -1327,10 +1344,10 @@ var __publicField = (obj, key, value) => {
|
|
|
1327
1344
|
var isSymbian = /(?:SymbianOS)/.test(ua2) || isWindowsPhone;
|
|
1328
1345
|
var isAndroid2 = /(?:Android)/.test(ua2);
|
|
1329
1346
|
var isFireFox = /(?:Firefox)/.test(ua2);
|
|
1330
|
-
var
|
|
1347
|
+
var isIpad = /(?:iPad|PlayBook)/.test(ua2) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
1348
|
+
var isTablet = isIpad || isAndroid2 && !/(?:Mobile)/.test(ua2) || isFireFox && /(?:Tablet)/.test(ua2);
|
|
1331
1349
|
var isPhone = /(?:iPhone)/.test(ua2) && !isTablet;
|
|
1332
1350
|
var isPc = !isPhone && !isAndroid2 && !isSymbian && !isTablet;
|
|
1333
|
-
var isIpad = /(?:iPad|PlayBook)/.test(ua2);
|
|
1334
1351
|
return {
|
|
1335
1352
|
isTablet,
|
|
1336
1353
|
isPhone,
|
|
@@ -1441,7 +1458,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1441
1458
|
}
|
|
1442
1459
|
}
|
|
1443
1460
|
};
|
|
1444
|
-
var version = "3.0.
|
|
1461
|
+
var version = "3.0.11-alpha.2";
|
|
1445
1462
|
var ERROR_TYPE_MAP = {
|
|
1446
1463
|
1: "media",
|
|
1447
1464
|
2: "media",
|
|
@@ -5666,6 +5683,9 @@ var __publicField = (obj, key, value) => {
|
|
|
5666
5683
|
clsList.forEach(function(cls) {
|
|
5667
5684
|
_this23.removeClass(cls);
|
|
5668
5685
|
});
|
|
5686
|
+
if (!this._accPlayed.t && !this.paused && !this.ended) {
|
|
5687
|
+
this._accPlayed.t = (/* @__PURE__ */ new Date()).getTime();
|
|
5688
|
+
}
|
|
5669
5689
|
}
|
|
5670
5690
|
}, {
|
|
5671
5691
|
key: "onTimeupdate",
|
|
@@ -5789,7 +5809,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5789
5809
|
this.media.style.width = "".concat(rWidth, "px");
|
|
5790
5810
|
this.media.style.height = "".concat(rHeight, "px");
|
|
5791
5811
|
}
|
|
5792
|
-
var formStyle = util$1.getTransformStyle(_pos);
|
|
5812
|
+
var formStyle = util$1.getTransformStyle(_pos, this.media.style.transform || this.media.style.webkitTransform);
|
|
5793
5813
|
this.media.style.transform = formStyle;
|
|
5794
5814
|
this.media.style.webkitTransform = formStyle;
|
|
5795
5815
|
}
|
|
@@ -6600,11 +6620,31 @@ var __publicField = (obj, key, value) => {
|
|
|
6600
6620
|
this.config.poster = poster;
|
|
6601
6621
|
this.root.style.backgroundImage = "url(".concat(poster, ")");
|
|
6602
6622
|
}
|
|
6623
|
+
}, {
|
|
6624
|
+
key: "getBgSize",
|
|
6625
|
+
value: function getBgSize(mode) {
|
|
6626
|
+
var _bg = "";
|
|
6627
|
+
switch (mode) {
|
|
6628
|
+
case "cover":
|
|
6629
|
+
_bg = "cover";
|
|
6630
|
+
break;
|
|
6631
|
+
case "container":
|
|
6632
|
+
_bg = "container";
|
|
6633
|
+
break;
|
|
6634
|
+
case "fixHeight":
|
|
6635
|
+
_bg = "auto 100%";
|
|
6636
|
+
break;
|
|
6637
|
+
default:
|
|
6638
|
+
_bg = "";
|
|
6639
|
+
}
|
|
6640
|
+
return _bg ? "background-size: ".concat(_bg, ";") : "";
|
|
6641
|
+
}
|
|
6603
6642
|
}, {
|
|
6604
6643
|
key: "render",
|
|
6605
6644
|
value: function render() {
|
|
6606
|
-
var _this$config = this.config, poster = _this$config.poster, hideCanplay = _this$config.hideCanplay;
|
|
6607
|
-
var
|
|
6645
|
+
var _this$config = this.config, poster = _this$config.poster, hideCanplay = _this$config.hideCanplay, fillMode = _this$config.fillMode;
|
|
6646
|
+
var _bg = this.getBgSize(fillMode);
|
|
6647
|
+
var style = poster ? "background-image:url(".concat(poster, ");").concat(_bg) : _bg;
|
|
6608
6648
|
return '<xg-poster class="xgplayer-poster '.concat(hideCanplay ? "xg-showplay" : "", '" style="').concat(style, '">\n </xg-poster>');
|
|
6609
6649
|
}
|
|
6610
6650
|
}], [{
|
|
@@ -6618,7 +6658,8 @@ var __publicField = (obj, key, value) => {
|
|
|
6618
6658
|
return {
|
|
6619
6659
|
isEndedShow: true,
|
|
6620
6660
|
hideCanplay: false,
|
|
6621
|
-
poster: ""
|
|
6661
|
+
poster: "",
|
|
6662
|
+
fillMode: "fixWidth"
|
|
6622
6663
|
};
|
|
6623
6664
|
}
|
|
6624
6665
|
}]);
|
|
@@ -8650,7 +8691,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8650
8691
|
var keyCode = e2.keyCode;
|
|
8651
8692
|
var _assertThisInitialize = _assertThisInitialized(_this), _keyState = _assertThisInitialize._keyState, player = _assertThisInitialize.player;
|
|
8652
8693
|
var _this$config = _this.config, disable = _this$config.disable, disableBodyTrigger = _this$config.disableBodyTrigger, isIgnoreUserActive = _this$config.isIgnoreUserActive;
|
|
8653
|
-
if (disable || disableBodyTrigger || !player.isUserActive
|
|
8694
|
+
if (disable || disableBodyTrigger || !(player.isUserActive || isIgnoreUserActive) || isDisableTag(e2.target) || !_this.checkIsVisible() || e2.metaKey || e2.altKey || e2.ctrlKey) {
|
|
8654
8695
|
_keyState.isBodyKeyDown = false;
|
|
8655
8696
|
return;
|
|
8656
8697
|
}
|
|
@@ -8679,9 +8720,6 @@ var __publicField = (obj, key, value) => {
|
|
|
8679
8720
|
if (_this.config.disable || _this.config.disableRootTrigger || e2.metaKey || e2.altKey || e2.ctrlKey) {
|
|
8680
8721
|
return;
|
|
8681
8722
|
}
|
|
8682
|
-
if (!_this.player.isUserActive && !_this.config.isIgnoreUserActive) {
|
|
8683
|
-
return;
|
|
8684
|
-
}
|
|
8685
8723
|
if (e2 && (e2.keyCode === 37 || _this.checkCode(e2.keyCode)) && (e2.target === _this.player.root || e2.target === _this.player.video || e2.target === _this.player.controls.el)) {
|
|
8686
8724
|
_keyState.isKeyDown = true;
|
|
8687
8725
|
}
|
|
@@ -8954,7 +8992,6 @@ var __publicField = (obj, key, value) => {
|
|
|
8954
8992
|
}
|
|
8955
8993
|
_keyState.tt = _t;
|
|
8956
8994
|
}
|
|
8957
|
-
preventDefault(e2);
|
|
8958
8995
|
this.handleKeyCode(e2.keyCode, e2, _keyState.isPress);
|
|
8959
8996
|
}
|
|
8960
8997
|
}, {
|
|
@@ -8991,6 +9028,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8991
9028
|
isPress
|
|
8992
9029
|
}, this.keyCodeMap[arr[i2]]));
|
|
8993
9030
|
}
|
|
9031
|
+
preventDefault(event);
|
|
8994
9032
|
break;
|
|
8995
9033
|
}
|
|
8996
9034
|
}
|
|
@@ -9026,11 +9064,11 @@ var __publicField = (obj, key, value) => {
|
|
|
9026
9064
|
checkVisible: false,
|
|
9027
9065
|
disableBodyTrigger: false,
|
|
9028
9066
|
disableRootTrigger: false,
|
|
9029
|
-
isGlobalTrigger:
|
|
9067
|
+
isGlobalTrigger: true,
|
|
9030
9068
|
keyCodeMap: {},
|
|
9031
9069
|
disable: false,
|
|
9032
9070
|
playbackRate: 2,
|
|
9033
|
-
isIgnoreUserActive:
|
|
9071
|
+
isIgnoreUserActive: true
|
|
9034
9072
|
};
|
|
9035
9073
|
}
|
|
9036
9074
|
}]);
|
|
@@ -12339,6 +12377,41 @@ var __publicField = (obj, key, value) => {
|
|
|
12339
12377
|
});
|
|
12340
12378
|
}
|
|
12341
12379
|
}
|
|
12380
|
+
const appendSearchParams = (url, searchParams) => {
|
|
12381
|
+
var _a, _b;
|
|
12382
|
+
const urlObject = getUrlObject(url);
|
|
12383
|
+
if (!url || !urlObject) {
|
|
12384
|
+
return url ?? "";
|
|
12385
|
+
}
|
|
12386
|
+
const withoutProtocol = url.startsWith("//");
|
|
12387
|
+
for (const key in searchParams) {
|
|
12388
|
+
const value = searchParams[key];
|
|
12389
|
+
if (urlObject == null ? void 0 : urlObject.searchParams.has(key)) {
|
|
12390
|
+
(_a = urlObject == null ? void 0 : urlObject.searchParams) == null ? void 0 : _a.set(key, value);
|
|
12391
|
+
} else {
|
|
12392
|
+
(_b = urlObject == null ? void 0 : urlObject.searchParams) == null ? void 0 : _b.append(key, value);
|
|
12393
|
+
}
|
|
12394
|
+
}
|
|
12395
|
+
url = urlObject.toString();
|
|
12396
|
+
if (withoutProtocol) {
|
|
12397
|
+
return url == null ? void 0 : url.replace(location.protocol, "");
|
|
12398
|
+
}
|
|
12399
|
+
return url;
|
|
12400
|
+
};
|
|
12401
|
+
const getUrlObject = (url) => {
|
|
12402
|
+
if (!url) {
|
|
12403
|
+
return;
|
|
12404
|
+
}
|
|
12405
|
+
const withoutProtocol = url.startsWith("//");
|
|
12406
|
+
if (withoutProtocol) {
|
|
12407
|
+
url = location.protocol + url;
|
|
12408
|
+
}
|
|
12409
|
+
try {
|
|
12410
|
+
return new URL(url);
|
|
12411
|
+
} catch (error2) {
|
|
12412
|
+
return;
|
|
12413
|
+
}
|
|
12414
|
+
};
|
|
12342
12415
|
function isType(suffix) {
|
|
12343
12416
|
return function(url) {
|
|
12344
12417
|
return url == null ? void 0 : url.split("?")[0].toLowerCase().includes(suffix);
|
|
@@ -12374,14 +12447,16 @@ var __publicField = (obj, key, value) => {
|
|
|
12374
12447
|
return sniffer$1.isMSESupport();
|
|
12375
12448
|
}
|
|
12376
12449
|
async function isSoftDecodeSupported() {
|
|
12377
|
-
const
|
|
12378
|
-
return
|
|
12450
|
+
const { XGVideoPlugin } = await load(DynamicModule.PluginXgvideo);
|
|
12451
|
+
return XGVideoPlugin == null ? void 0 : XGVideoPlugin.isSupported();
|
|
12379
12452
|
}
|
|
12380
12453
|
const util = {
|
|
12381
12454
|
...util$1,
|
|
12382
12455
|
getStreamType,
|
|
12383
12456
|
isMseSupported,
|
|
12384
|
-
isSoftDecodeSupported
|
|
12457
|
+
isSoftDecodeSupported,
|
|
12458
|
+
appendSearchParams,
|
|
12459
|
+
getUrlObject
|
|
12385
12460
|
};
|
|
12386
12461
|
var autoplay = "";
|
|
12387
12462
|
const { isWeixin, os, device } = sniffer$1;
|
|
@@ -18191,9 +18266,11 @@ var __publicField = (obj, key, value) => {
|
|
|
18191
18266
|
}
|
|
18192
18267
|
}
|
|
18193
18268
|
const getFlvStrategy = async (options) => {
|
|
18194
|
-
var _a;
|
|
18269
|
+
var _a, _b, _c;
|
|
18195
18270
|
let mseStrategy;
|
|
18196
18271
|
let softStrategy;
|
|
18272
|
+
const enableLowLatency = ((_a = options == null ? void 0 : options.flv) == null ? void 0 : _a.enableLowLatency) && sniffer$1.device === "pc";
|
|
18273
|
+
const abrPts = ((_b = options == null ? void 0 : options.flv) == null ? void 0 : _b.abrPts) ?? "-800";
|
|
18197
18274
|
const codec = await getCodec(options);
|
|
18198
18275
|
const isSoftDecode$1 = await isSoftDecode(options, codec);
|
|
18199
18276
|
if (isSoftDecode$1) {
|
|
@@ -18210,11 +18287,21 @@ var __publicField = (obj, key, value) => {
|
|
|
18210
18287
|
(mseStrategy == null ? void 0 : mseStrategy.module) && load(mseStrategy.module).catch(() => void 0),
|
|
18211
18288
|
(softStrategy == null ? void 0 : softStrategy.module) && load(softStrategy.module).catch(() => void 0)
|
|
18212
18289
|
]);
|
|
18213
|
-
softModule && ((
|
|
18290
|
+
(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));
|
|
18214
18291
|
const combineOptions$1 = combineOptions([mseStrategy, softStrategy]);
|
|
18292
|
+
const plugins = [];
|
|
18293
|
+
if (enableLowLatency) {
|
|
18294
|
+
combineOptions$1.url = appendSearchParams(options.url, { abr_pt: abrPts });
|
|
18295
|
+
}
|
|
18296
|
+
if (mseModule) {
|
|
18297
|
+
plugins.push(mseModule.FlvPlugin);
|
|
18298
|
+
if (enableLowLatency) {
|
|
18299
|
+
plugins.push(mseModule.Adaptive);
|
|
18300
|
+
}
|
|
18301
|
+
}
|
|
18215
18302
|
return {
|
|
18216
18303
|
options: combineOptions$1,
|
|
18217
|
-
plugins
|
|
18304
|
+
plugins
|
|
18218
18305
|
};
|
|
18219
18306
|
};
|
|
18220
18307
|
const getHlsStrategy = async (options) => {
|
|
@@ -18237,26 +18324,31 @@ var __publicField = (obj, key, value) => {
|
|
|
18237
18324
|
(mseStrategy == null ? void 0 : mseStrategy.module) && load(mseStrategy.module).catch(() => void 0),
|
|
18238
18325
|
(softStrategy == null ? void 0 : softStrategy.module) && load(softStrategy.module).catch(() => void 0)
|
|
18239
18326
|
]);
|
|
18240
|
-
softModule && ((_b = softStrategy == null ? void 0 : softStrategy.afterLoad) == null ? void 0 : _b.call(softStrategy, softModule));
|
|
18327
|
+
(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));
|
|
18241
18328
|
const combineOptions$1 = combineOptions([mseStrategy, softStrategy]);
|
|
18242
18329
|
return {
|
|
18243
18330
|
options: combineOptions$1,
|
|
18244
|
-
plugins: mseModule ? [mseModule] : []
|
|
18331
|
+
plugins: (mseModule == null ? void 0 : mseModule.HlsPlugin) ? [mseModule.HlsPlugin] : []
|
|
18332
|
+
};
|
|
18333
|
+
};
|
|
18334
|
+
const createFlvMseStrategy = (options) => {
|
|
18335
|
+
var _a;
|
|
18336
|
+
return {
|
|
18337
|
+
options: {
|
|
18338
|
+
flv: {
|
|
18339
|
+
retryCount: 0,
|
|
18340
|
+
disconnectRetryCount: ((_a = options == null ? void 0 : options.flv) == null ? void 0 : _a.retryCount) ?? void 0,
|
|
18341
|
+
...(options == null ? void 0 : options.flv) ?? {}
|
|
18342
|
+
}
|
|
18343
|
+
},
|
|
18344
|
+
module: DynamicModule.PluginFlv
|
|
18245
18345
|
};
|
|
18246
18346
|
};
|
|
18247
|
-
const createFlvMseStrategy = (options) => ({
|
|
18248
|
-
options: {
|
|
18249
|
-
flv: {
|
|
18250
|
-
retryCount: 0,
|
|
18251
|
-
...(options == null ? void 0 : options.flv) ?? {}
|
|
18252
|
-
}
|
|
18253
|
-
},
|
|
18254
|
-
module: DynamicModule.PluginFlv
|
|
18255
|
-
});
|
|
18256
18347
|
const createHlsMseStrategy = (options) => ({
|
|
18257
18348
|
options: {
|
|
18258
18349
|
hls: {
|
|
18259
18350
|
retryCount: 0,
|
|
18351
|
+
pollRetryCount: 0,
|
|
18260
18352
|
...(options == null ? void 0 : options.hls) ?? {}
|
|
18261
18353
|
}
|
|
18262
18354
|
},
|
|
@@ -18375,50 +18467,15 @@ var __publicField = (obj, key, value) => {
|
|
|
18375
18467
|
return new VeError(ERRORS[errorCode], i18n);
|
|
18376
18468
|
}
|
|
18377
18469
|
async function isRTMSupported() {
|
|
18378
|
-
const
|
|
18379
|
-
return
|
|
18470
|
+
const { RtmPlugin } = await load(DynamicModule.PluginRtm);
|
|
18471
|
+
return RtmPlugin.isSupported();
|
|
18380
18472
|
}
|
|
18381
18473
|
async function isRTMSupportCodec(codec = RTMCodec.H264) {
|
|
18382
|
-
const
|
|
18474
|
+
const { RtmPlugin } = await load(DynamicModule.PluginRtm);
|
|
18383
18475
|
if (codec === RTMCodec.H264)
|
|
18384
|
-
return
|
|
18476
|
+
return RtmPlugin.isSupportedH264();
|
|
18385
18477
|
return false;
|
|
18386
18478
|
}
|
|
18387
|
-
const appendSearchParams = (url, searchParams) => {
|
|
18388
|
-
var _a, _b;
|
|
18389
|
-
const urlObject = getUrlObject(url);
|
|
18390
|
-
if (!url || !urlObject) {
|
|
18391
|
-
return url ?? "";
|
|
18392
|
-
}
|
|
18393
|
-
const withoutProtocol = url.startsWith("//");
|
|
18394
|
-
for (const key in searchParams) {
|
|
18395
|
-
const value = searchParams[key];
|
|
18396
|
-
if (urlObject == null ? void 0 : urlObject.searchParams.has(key)) {
|
|
18397
|
-
(_a = urlObject == null ? void 0 : urlObject.searchParams) == null ? void 0 : _a.set(key, value);
|
|
18398
|
-
} else {
|
|
18399
|
-
(_b = urlObject == null ? void 0 : urlObject.searchParams) == null ? void 0 : _b.append(key, value);
|
|
18400
|
-
}
|
|
18401
|
-
}
|
|
18402
|
-
url = urlObject.toString();
|
|
18403
|
-
if (withoutProtocol) {
|
|
18404
|
-
return url == null ? void 0 : url.replace(location.protocol, "");
|
|
18405
|
-
}
|
|
18406
|
-
return url;
|
|
18407
|
-
};
|
|
18408
|
-
const getUrlObject = (url) => {
|
|
18409
|
-
if (!url) {
|
|
18410
|
-
return;
|
|
18411
|
-
}
|
|
18412
|
-
const withoutProtocol = url.startsWith("//");
|
|
18413
|
-
if (withoutProtocol) {
|
|
18414
|
-
url = location.protocol + url;
|
|
18415
|
-
}
|
|
18416
|
-
try {
|
|
18417
|
-
return new URL(url);
|
|
18418
|
-
} catch (error2) {
|
|
18419
|
-
return;
|
|
18420
|
-
}
|
|
18421
|
-
};
|
|
18422
18479
|
const rtmStrategy = {
|
|
18423
18480
|
options: {},
|
|
18424
18481
|
module: DynamicModule.PluginRtm
|
|
@@ -18448,8 +18505,16 @@ var __publicField = (obj, key, value) => {
|
|
|
18448
18505
|
backupStrategy = createHlsMseStrategy(options);
|
|
18449
18506
|
}
|
|
18450
18507
|
const [rtmCdn, backupCdn] = await Promise.all([
|
|
18451
|
-
load(rtmStrategy.module).
|
|
18452
|
-
|
|
18508
|
+
load(rtmStrategy.module).then((module2) => {
|
|
18509
|
+
return module2.RtmPlugin;
|
|
18510
|
+
}).catch(() => void 0),
|
|
18511
|
+
backupStrategy && load(backupStrategy.module).then((module2) => {
|
|
18512
|
+
if ((backupStrategy == null ? void 0 : backupStrategy.module) === DynamicModule.PluginFlv) {
|
|
18513
|
+
return module2.FlvPlugin;
|
|
18514
|
+
} else if ((backupStrategy == null ? void 0 : backupStrategy.module) === DynamicModule.PluginHls) {
|
|
18515
|
+
return module2.HlsPlugin;
|
|
18516
|
+
}
|
|
18517
|
+
}).catch(() => void 0)
|
|
18453
18518
|
]);
|
|
18454
18519
|
const [RTMSupported, RTMSupportCodec] = await Promise.all([
|
|
18455
18520
|
isRTMSupported(),
|
|
@@ -18482,7 +18547,7 @@ var __publicField = (obj, key, value) => {
|
|
|
18482
18547
|
return {
|
|
18483
18548
|
options: {
|
|
18484
18549
|
...(backupStrategy == null ? void 0 : backupStrategy.options) || {},
|
|
18485
|
-
url: enableRTMAutoTranscode ? appendSearchParams(url, { enableRTMAutoTranscode: "true" }) : void 0,
|
|
18550
|
+
url: enableRTMAutoTranscode ? util.appendSearchParams(url, { enableRTMAutoTranscode: "true" }) : void 0,
|
|
18486
18551
|
_RTMdegrade: void 0,
|
|
18487
18552
|
rts: {
|
|
18488
18553
|
retryCount: 0,
|
|
@@ -18692,7 +18757,7 @@ var __publicField = (obj, key, value) => {
|
|
|
18692
18757
|
`;
|
|
18693
18758
|
}
|
|
18694
18759
|
_handleRefresh(e2) {
|
|
18695
|
-
var _a, _b, _c;
|
|
18760
|
+
var _a, _b, _c, _d, _e, _f;
|
|
18696
18761
|
const { player } = this;
|
|
18697
18762
|
if (!player)
|
|
18698
18763
|
return;
|
|
@@ -18703,6 +18768,7 @@ var __publicField = (obj, key, value) => {
|
|
|
18703
18768
|
if (player) {
|
|
18704
18769
|
player.emit(Events.REFRESH_CLICK);
|
|
18705
18770
|
(_c = (_b = (_a = this.player) == null ? void 0 : _a.config) == null ? void 0 : _b.veplayer) == null ? void 0 : _c.retry();
|
|
18771
|
+
(_f = (_e = (_d = this.player) == null ? void 0 : _d.plugins) == null ? void 0 : _e.error) == null ? void 0 : _f.hideError();
|
|
18706
18772
|
}
|
|
18707
18773
|
player.once(CANPLAY, () => {
|
|
18708
18774
|
player.removeClass("xgplayer-is-enter");
|
|
@@ -21153,12 +21219,12 @@ var __publicField = (obj, key, value) => {
|
|
|
21153
21219
|
return userId;
|
|
21154
21220
|
};
|
|
21155
21221
|
const generateUrlWithSessionId = (url) => {
|
|
21156
|
-
const urlObject = getUrlObject(url);
|
|
21222
|
+
const urlObject = util.getUrlObject(url);
|
|
21157
21223
|
if (!urlObject) {
|
|
21158
21224
|
return url ?? "";
|
|
21159
21225
|
}
|
|
21160
21226
|
if (!(urlObject == null ? void 0 : urlObject.searchParams.get("_session_id"))) {
|
|
21161
|
-
return appendSearchParams(url, { _session_id: generateSessionId() });
|
|
21227
|
+
return util.appendSearchParams(url, { _session_id: generateSessionId() });
|
|
21162
21228
|
}
|
|
21163
21229
|
return url;
|
|
21164
21230
|
};
|
|
@@ -21259,9 +21325,9 @@ var __publicField = (obj, key, value) => {
|
|
|
21259
21325
|
user_id: this._userId,
|
|
21260
21326
|
device_id: this._deviceId,
|
|
21261
21327
|
ext: {
|
|
21262
|
-
veplayer_version: "2.2.0-rc.
|
|
21263
|
-
flv_version: "3.0.
|
|
21264
|
-
hls_version: "3.0.
|
|
21328
|
+
veplayer_version: "2.2.0-rc.1",
|
|
21329
|
+
flv_version: "3.0.11-alpha.2",
|
|
21330
|
+
hls_version: "3.0.11-alpha.2",
|
|
21265
21331
|
rts_version: "0.2.0-alpha.5"
|
|
21266
21332
|
}
|
|
21267
21333
|
});
|
package/umd/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
|