@volcengine/veplayer 2.1.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.
Files changed (40) hide show
  1. package/esm/index.d.ts +2 -6
  2. package/esm/veplayer.biz.live.development.js +38 -34
  3. package/esm/veplayer.biz.live.production.js +1 -1
  4. package/esm/veplayer.d.ts +34 -10
  5. package/esm/veplayer.development.css +1 -1
  6. package/esm/veplayer.development.js +156 -61
  7. package/esm/veplayer.live.d.ts +34 -10
  8. package/esm/veplayer.live.development.css +1 -1
  9. package/esm/veplayer.live.development.js +156 -61
  10. package/esm/veplayer.live.production.css +1 -1
  11. package/esm/veplayer.live.production.js +3 -3
  12. package/esm/veplayer.production.css +1 -1
  13. package/esm/veplayer.production.js +3 -3
  14. package/esm/veplayer.vod.d.ts +2 -6
  15. package/esm/veplayer.vod.development.css +1 -1
  16. package/esm/veplayer.vod.development.js +94 -19
  17. package/esm/veplayer.vod.production.css +1 -1
  18. package/esm/veplayer.vod.production.js +2 -2
  19. package/package.json +2 -1
  20. package/umd/index.d.ts +2 -6
  21. package/umd/veplayer.biz.live.development.js +38 -34
  22. package/umd/veplayer.biz.live.production.js +1 -1
  23. package/umd/veplayer.d.ts +34 -10
  24. package/umd/veplayer.development.css +1 -1
  25. package/umd/veplayer.development.js +156 -61
  26. package/umd/veplayer.live.d.ts +34 -10
  27. package/umd/veplayer.live.development.css +1 -1
  28. package/umd/veplayer.live.development.js +156 -61
  29. package/umd/veplayer.live.production.css +1 -1
  30. package/umd/veplayer.live.production.js +1 -1
  31. package/umd/veplayer.production.css +1 -1
  32. package/umd/veplayer.production.js +1 -1
  33. package/umd/veplayer.vod.d.ts +2 -6
  34. package/umd/veplayer.vod.development.css +1 -1
  35. package/umd/veplayer.vod.development.js +94 -19
  36. package/umd/veplayer.vod.production.css +1 -1
  37. package/umd/veplayer.vod.production.js +1 -1
  38. package/veplayer.d.ts +6772 -0
  39. package/veplayer.live.d.ts +6774 -0
  40. 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
- return "scale(".concat(pos.scale || 1, ") translate(").concat(pos.x || 0, "%, ").concat(pos.y || 0, "%) rotate(").concat(pos.rotate || 0, "deg)");
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 isTablet = /(?:iPad|PlayBook)/.test(ua2) || isAndroid2 && !/(?:Mobile)/.test(ua2) || isFireFox && /(?:Tablet)/.test(ua2);
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.10-alpha.4";
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 style = poster ? "background-image:url(".concat(poster, ");") : "";
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 && !isIgnoreUserActive || isDisableTag(e3.target) || !_this.checkIsVisible() || e3.metaKey || e3.altKey || e3.ctrlKey) {
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: false,
9063
+ isGlobalTrigger: true,
9026
9064
  keyCodeMap: {},
9027
9065
  disable: false,
9028
9066
  playbackRate: 2,
9029
- isIgnoreUserActive: false
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 pluginXgvideo = await load(DynamicModule.PluginXgvideo);
12374
- return pluginXgvideo == null ? void 0 : pluginXgvideo.isSupported();
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 && ((_a = softStrategy == null ? void 0 : softStrategy.afterLoad) == null ? void 0 : _a.call(softStrategy, 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: mseModule ? [mseModule] : []
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,13 +18463,13 @@ function create(errorCode, i18n) {
18371
18463
  return new VeError2(ERRORS[errorCode], i18n);
18372
18464
  }
18373
18465
  async function isRTMSupported() {
18374
- const Rtm = await load(DynamicModule.PluginRtm);
18375
- return Rtm.isSupported();
18466
+ const { RtmPlugin } = await load(DynamicModule.PluginRtm);
18467
+ return RtmPlugin.isSupported();
18376
18468
  }
18377
18469
  async function isRTMSupportCodec(codec = RTMCodec.H264) {
18378
- const Rtm = await load(DynamicModule.PluginRtm);
18470
+ const { RtmPlugin } = await load(DynamicModule.PluginRtm);
18379
18471
  if (codec === RTMCodec.H264)
18380
- return Rtm.isSupportedH264();
18472
+ return RtmPlugin.isSupportedH264();
18381
18473
  return false;
18382
18474
  }
18383
18475
  const rtmStrategy = {
@@ -18395,7 +18487,12 @@ const getRtmStrategy = async (options, player) => {
18395
18487
  var _a;
18396
18488
  let backupStrategy;
18397
18489
  const { url } = options;
18398
- const { fallbackUrl, enableFallback = true, ...ret } = options.rtm || {};
18490
+ const {
18491
+ fallbackUrl,
18492
+ enableFallback = true,
18493
+ enableRTMAutoTranscode,
18494
+ ...ret
18495
+ } = options.rtm || {};
18399
18496
  const actualFallbackUrl = !enableFallback ? "" : !fallbackUrl && url ? generateFallbackUrl(url) : fallbackUrl;
18400
18497
  const backupType = actualFallbackUrl && util.getStreamType(actualFallbackUrl);
18401
18498
  if (backupType === "flv" && util.isMseSupported(Codec.H264)) {
@@ -18404,8 +18501,16 @@ const getRtmStrategy = async (options, player) => {
18404
18501
  backupStrategy = createHlsMseStrategy(options);
18405
18502
  }
18406
18503
  const [rtmCdn, backupCdn] = await Promise.all([
18407
- load(rtmStrategy.module).catch(() => void 0),
18408
- backupStrategy && load(backupStrategy.module).catch(() => void 0)
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)
18409
18514
  ]);
18410
18515
  const [RTMSupported, RTMSupportCodec] = await Promise.all([
18411
18516
  isRTMSupported(),
@@ -18438,6 +18543,7 @@ const getRtmStrategy = async (options, player) => {
18438
18543
  return {
18439
18544
  options: {
18440
18545
  ...(backupStrategy == null ? void 0 : backupStrategy.options) || {},
18546
+ url: enableRTMAutoTranscode ? util.appendSearchParams(url, { enableRTMAutoTranscode: "true" }) : void 0,
18441
18547
  _RTMdegrade: void 0,
18442
18548
  rts: {
18443
18549
  retryCount: 0,
@@ -18647,7 +18753,7 @@ class Refresh extends Plugin {
18647
18753
  `;
18648
18754
  }
18649
18755
  _handleRefresh(e3) {
18650
- var _a, _b, _c;
18756
+ var _a, _b, _c, _d, _e, _f;
18651
18757
  const { player } = this;
18652
18758
  if (!player)
18653
18759
  return;
@@ -18658,6 +18764,7 @@ class Refresh extends Plugin {
18658
18764
  if (player) {
18659
18765
  player.emit(Events.REFRESH_CLICK);
18660
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();
18661
18768
  }
18662
18769
  player.once(CANPLAY, () => {
18663
18770
  player.removeClass("xgplayer-is-enter");
@@ -21108,24 +21215,12 @@ const getUserId2 = () => {
21108
21215
  return userId;
21109
21216
  };
21110
21217
  const generateUrlWithSessionId = (url) => {
21111
- var _a, _b;
21112
- if (!url) {
21113
- return "";
21114
- }
21115
- const withoutProtocol = url.startsWith("//");
21116
- if (withoutProtocol) {
21117
- url = location.protocol + url;
21218
+ const urlObject = util.getUrlObject(url);
21219
+ if (!urlObject) {
21220
+ return url ?? "";
21118
21221
  }
21119
- try {
21120
- const urlObject = new URL(url);
21121
- if (!((_a = urlObject == null ? void 0 : urlObject.searchParams) == null ? void 0 : _a.get("_session_id"))) {
21122
- (_b = urlObject == null ? void 0 : urlObject.searchParams) == null ? void 0 : _b.append("_session_id", generateSessionId());
21123
- }
21124
- url = urlObject.toString();
21125
- } catch (error2) {
21126
- }
21127
- if (withoutProtocol) {
21128
- return url == null ? void 0 : url.replace(location.protocol, "");
21222
+ if (!(urlObject == null ? void 0 : urlObject.searchParams.get("_session_id"))) {
21223
+ return util.appendSearchParams(url, { _session_id: generateSessionId() });
21129
21224
  }
21130
21225
  return url;
21131
21226
  };
@@ -21226,9 +21321,9 @@ class Logger extends Plugin {
21226
21321
  user_id: this._userId,
21227
21322
  device_id: this._deviceId,
21228
21323
  ext: {
21229
- veplayer_version: "2.1.0",
21230
- flv_version: "3.0.10-alpha.4",
21231
- hls_version: "3.0.10-alpha.4",
21324
+ veplayer_version: "2.2.0-rc.1",
21325
+ flv_version: "3.0.11-alpha.2",
21326
+ hls_version: "3.0.11-alpha.2",
21232
21327
  rts_version: "0.2.0-alpha.5"
21233
21328
  }
21234
21329
  });
@@ -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?: string | undefined, classname?: string | undefined): HTMLElement;
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;
@@ -3697,7 +3697,16 @@ interface Rtm {
3697
3697
  * @default 1000
3698
3698
  */
3699
3699
  retryDelay?: number;
3700
+ /** {zh}
3701
+ * @brief 是否开启自动降级。
3702
+ * @default true
3703
+ */
3700
3704
  enableFallback?: boolean;
3705
+ /** {zh}
3706
+ * @brief 是否开启自动转码。
3707
+ * @default false
3708
+ */
3709
+ enableRTMAutoTranscode?: boolean;
3701
3710
  }
3702
3711
  /**
3703
3712
  * @list option
@@ -3719,6 +3728,7 @@ interface Flv {
3719
3728
  * @default 10000
3720
3729
  */
3721
3730
  loadTimeout?: number;
3731
+ enableLowLatency?: boolean;
3722
3732
  }
3723
3733
  /**
3724
3734
  * @list option
@@ -6005,10 +6015,14 @@ declare namespace live {
6005
6015
  getStreamType: typeof getStreamType;
6006
6016
  isMseSupported: typeof isMseSupported;
6007
6017
  isSoftDecodeSupported: typeof isSoftDecodeSupported;
6018
+ appendSearchParams: (url?: string | undefined, searchParams?: Record<string, string> | undefined) => string;
6019
+ getUrlObject: (url?: string | undefined) => URL | undefined;
6008
6020
  createDom(el?: string | undefined, tpl?: string | undefined, attrs?: {
6009
6021
  [propName: string]: any;
6010
6022
  } | undefined, cname?: string | undefined): HTMLElement;
6011
- createDomFromHtml(html: string, attrs?: string | undefined, classname?: string | undefined): HTMLElement;
6023
+ createDomFromHtml(html: string, attrs?: {
6024
+ [propName: string]: any;
6025
+ } | undefined, classname?: string | undefined): HTMLElement;
6012
6026
  hasClass(el: HTMLElement, className: string): boolean;
6013
6027
  addClass(el: HTMLElement, className: string): void;
6014
6028
  removeClass(el: HTMLElement, className: string): void;
@@ -6075,7 +6089,7 @@ declare namespace live {
6075
6089
  y: number;
6076
6090
  scale: number;
6077
6091
  rotate: number;
6078
- } | undefined): string;
6092
+ } | undefined, transformValue?: string | undefined): string;
6079
6093
  convertDeg(val: number): number;
6080
6094
  getIndexByTime(time: any, segments: any): number;
6081
6095
  getOffsetCurrentTime(currentTime: any, segments: any, index?: number | undefined): any;
@@ -6644,7 +6658,16 @@ declare namespace live {
6644
6658
  * @default 1000
6645
6659
  */
6646
6660
  retryDelay?: number;
6661
+ /** {zh}
6662
+ * @brief 是否开启自动降级。
6663
+ * @default true
6664
+ */
6647
6665
  enableFallback?: boolean;
6666
+ /** {zh}
6667
+ * @brief 是否开启自动转码。
6668
+ * @default false
6669
+ */
6670
+ enableRTMAutoTranscode?: boolean;
6648
6671
  }
6649
6672
  /**
6650
6673
  * @list option
@@ -6666,6 +6689,7 @@ declare namespace live {
6666
6689
  * @default 10000
6667
6690
  */
6668
6691
  loadTimeout?: number;
6692
+ enableLowLatency?: boolean;
6669
6693
  }
6670
6694
  /**
6671
6695
  * @list option