@volcengine/veplayer 2.1.0-rc.1 → 2.1.0-rc.3

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.
@@ -13336,6 +13336,7 @@ class VePlayerBase {
13336
13336
  async switch(target, options) {
13337
13337
  var _a, _b;
13338
13338
  if (typeof target === "string" && this._sourceManager.sources.length === 1 && ((_b = (_a = this._sourceManager.sources) == null ? void 0 : _a[0].definitions) == null ? void 0 : _b.length) === 1) {
13339
+ this._sourceManager.updateSources(target);
13339
13340
  await this._switchUrl(target);
13340
13341
  return this._sourceManager.definition;
13341
13342
  }
@@ -13632,7 +13633,7 @@ class VePlayerBase {
13632
13633
  async _switchUrl(url) {
13633
13634
  const { plugins: newPlugins, options } = await this.prepare(url) || {};
13634
13635
  const newUrl = (options == null ? void 0 : options.url) ?? url;
13635
- this._sourceManager.updateSources(newUrl);
13636
+ this._sourceManager.url = newUrl;
13636
13637
  if (newPlugins == null ? void 0 : newPlugins.length) {
13637
13638
  this._callBeforePlayerInitForUrl(newPlugins, newUrl);
13638
13639
  } else {
@@ -21117,14 +21118,16 @@ const generateUrlWithSessionId = (url) => {
21117
21118
  }
21118
21119
  try {
21119
21120
  const urlObject = new URL(url);
21120
- if ((_a = urlObject == null ? void 0 : urlObject.searchParams) == null ? void 0 : _a.get("_session_id")) {
21121
- return 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());
21122
21123
  }
21123
- (_b = urlObject == null ? void 0 : urlObject.searchParams) == null ? void 0 : _b.append("_session_id", generateSessionId());
21124
- return urlObject.toString();
21124
+ url = urlObject.toString();
21125
21125
  } catch (error2) {
21126
- return url;
21127
21126
  }
21127
+ if (withoutProtocol) {
21128
+ return url == null ? void 0 : url.replace(location.protocol, "");
21129
+ }
21130
+ return url;
21128
21131
  };
21129
21132
  const hashCode = (str) => {
21130
21133
  str += "";
@@ -21223,7 +21226,7 @@ class Logger extends Plugin {
21223
21226
  user_id: this._userId,
21224
21227
  device_id: this._deviceId,
21225
21228
  ext: {
21226
- veplayer_version: "2.1.0-rc.1",
21229
+ veplayer_version: "2.1.0-rc.3",
21227
21230
  flv_version: "3.0.10-alpha.4",
21228
21231
  hls_version: "3.0.10-alpha.4",
21229
21232
  rts_version: "0.2.0-alpha.5"
@@ -13336,6 +13336,7 @@ class VePlayerBase {
13336
13336
  async switch(target, options) {
13337
13337
  var _a, _b;
13338
13338
  if (typeof target === "string" && this._sourceManager.sources.length === 1 && ((_b = (_a = this._sourceManager.sources) == null ? void 0 : _a[0].definitions) == null ? void 0 : _b.length) === 1) {
13339
+ this._sourceManager.updateSources(target);
13339
13340
  await this._switchUrl(target);
13340
13341
  return this._sourceManager.definition;
13341
13342
  }
@@ -13632,7 +13633,7 @@ class VePlayerBase {
13632
13633
  async _switchUrl(url) {
13633
13634
  const { plugins: newPlugins, options } = await this.prepare(url) || {};
13634
13635
  const newUrl = (options == null ? void 0 : options.url) ?? url;
13635
- this._sourceManager.updateSources(newUrl);
13636
+ this._sourceManager.url = newUrl;
13636
13637
  if (newPlugins == null ? void 0 : newPlugins.length) {
13637
13638
  this._callBeforePlayerInitForUrl(newPlugins, newUrl);
13638
13639
  } else {
@@ -21117,14 +21118,16 @@ const generateUrlWithSessionId = (url) => {
21117
21118
  }
21118
21119
  try {
21119
21120
  const urlObject = new URL(url);
21120
- if ((_a = urlObject == null ? void 0 : urlObject.searchParams) == null ? void 0 : _a.get("_session_id")) {
21121
- return 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());
21122
21123
  }
21123
- (_b = urlObject == null ? void 0 : urlObject.searchParams) == null ? void 0 : _b.append("_session_id", generateSessionId());
21124
- return urlObject.toString();
21124
+ url = urlObject.toString();
21125
21125
  } catch (error2) {
21126
- return url;
21127
21126
  }
21127
+ if (withoutProtocol) {
21128
+ return url == null ? void 0 : url.replace(location.protocol, "");
21129
+ }
21130
+ return url;
21128
21131
  };
21129
21132
  const hashCode = (str) => {
21130
21133
  str += "";
@@ -21223,7 +21226,7 @@ class Logger extends Plugin {
21223
21226
  user_id: this._userId,
21224
21227
  device_id: this._deviceId,
21225
21228
  ext: {
21226
- veplayer_version: "2.1.0-rc.1",
21229
+ veplayer_version: "2.1.0-rc.3",
21227
21230
  flv_version: "3.0.10-alpha.4",
21228
21231
  hls_version: "3.0.10-alpha.4",
21229
21232
  rts_version: "0.2.0-alpha.5"