@volcengine/veplayer 2.4.0 → 2.4.1-rc.0

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.
@@ -13742,7 +13742,7 @@ class VePlayerBase {
13742
13742
  * @returns
13743
13743
  */
13744
13744
  get playerVersion() {
13745
- return "2.4.0";
13745
+ return "2.4.1-rc.0";
13746
13746
  }
13747
13747
  /** {zh}
13748
13748
  * @brief 获取当前播放视频的清晰度唯一标识(definition)。
@@ -19063,6 +19063,29 @@ async function isRTMSupportCodec(codec = RTMCodec.H264) {
19063
19063
  return RtmPlugin.isSupportedH264();
19064
19064
  return false;
19065
19065
  }
19066
+ const getAbrStrategy = async (options) => {
19067
+ var _a, _b;
19068
+ const streamType = options.url && getStreamType(options.url);
19069
+ if (streamType === "rtm") {
19070
+ return {};
19071
+ }
19072
+ const abrOptions = streamType === "flv" ? (_a = options == null ? void 0 : options.flv) == null ? void 0 : _a.abr : (_b = options == null ? void 0 : options.hls) == null ? void 0 : _b.abr;
19073
+ if (!abrOptions) {
19074
+ return {};
19075
+ }
19076
+ const abrPlugin = await load(DynamicModule.PluginAbr).catch(() => void 0);
19077
+ return {
19078
+ options: {
19079
+ [streamType === "flv" ? "abr" : "hlsabr"]: {
19080
+ ...abrOptions,
19081
+ open: abrOptions.enable ?? true
19082
+ }
19083
+ },
19084
+ plugins: [
19085
+ streamType === "flv" ? abrPlugin == null ? void 0 : abrPlugin.AbrPlugin : abrPlugin == null ? void 0 : abrPlugin.HlsAbrPlugin
19086
+ ]
19087
+ };
19088
+ };
19066
19089
  const rtmStrategy = {
19067
19090
  options: {},
19068
19091
  module: DynamicModule.PluginRtm
@@ -19077,6 +19100,8 @@ const generateFallbackUrl = (url) => {
19077
19100
  const getRtmStrategy = async (options, player) => {
19078
19101
  var _a;
19079
19102
  let backupStrategy;
19103
+ let backupOptions = {};
19104
+ let backupModule = [];
19080
19105
  const { url } = options;
19081
19106
  const {
19082
19107
  fallbackUrl,
@@ -19091,7 +19116,7 @@ const getRtmStrategy = async (options, player) => {
19091
19116
  } else if (backupType === "hls" && (sniffer$1.device !== "mobile" || ((_a = options == null ? void 0 : options.hls) == null ? void 0 : _a.enableMSE)) && util.isMseSupported(Codec.H264)) {
19092
19117
  backupStrategy = createHlsMseStrategy(options);
19093
19118
  }
19094
- const [rtmCdn, backupCdn] = await Promise.all([
19119
+ const [rtmCdn, backupCdn, backupAbr] = await Promise.all([
19095
19120
  load(rtmStrategy.module).then((module) => {
19096
19121
  return module.RtmPlugin;
19097
19122
  }).catch(() => void 0),
@@ -19101,8 +19126,18 @@ const getRtmStrategy = async (options, player) => {
19101
19126
  } else if ((backupStrategy == null ? void 0 : backupStrategy.module) === DynamicModule.PluginHls) {
19102
19127
  return module.HlsPlugin;
19103
19128
  }
19104
- }).catch(() => void 0)
19129
+ }).catch(() => void 0),
19130
+ getAbrStrategy({ ...options, url: actualFallbackUrl }).catch(
19131
+ () => void 0
19132
+ )
19105
19133
  ]);
19134
+ if (backupType) {
19135
+ backupOptions = {
19136
+ ...backupStrategy == null ? void 0 : backupStrategy.options,
19137
+ ...backupAbr == null ? void 0 : backupAbr.options
19138
+ };
19139
+ backupModule = [backupCdn, ...(backupAbr == null ? void 0 : backupAbr.plugins) ?? []];
19140
+ }
19106
19141
  const [RTMSupported, RTMSupportCodec] = await Promise.all([
19107
19142
  isRTMSupported(),
19108
19143
  isRTMSupportCodec()
@@ -19120,7 +19155,7 @@ const getRtmStrategy = async (options, player) => {
19120
19155
  }
19121
19156
  return {
19122
19157
  options: {
19123
- ...(backupStrategy == null ? void 0 : backupStrategy.options) || {},
19158
+ ...backupOptions || {},
19124
19159
  url: actualFallbackUrl,
19125
19160
  _RTMdegrade: {
19126
19161
  _originRtmUrl: url,
@@ -19128,19 +19163,19 @@ const getRtmStrategy = async (options, player) => {
19128
19163
  _isRTMSupportCodec: RTMSupportCodec
19129
19164
  }
19130
19165
  },
19131
- plugins: backupCdn ? [backupCdn] : []
19166
+ plugins: backupModule
19132
19167
  };
19133
19168
  }
19134
19169
  return {
19135
19170
  options: {
19136
- ...(backupStrategy == null ? void 0 : backupStrategy.options) || {},
19171
+ ...backupOptions || {},
19137
19172
  url: enableRTMAutoTranscode ? util.appendSearchParams(url, { enableRTMAutoTranscode: "true" }) : void 0,
19138
19173
  _RTMdegrade: void 0,
19139
19174
  rts: {
19140
19175
  retryCount: 0,
19141
19176
  ...ret,
19142
19177
  backupURL: actualFallbackUrl,
19143
- backupConstruct: backupCdn
19178
+ backupConstruct: backupModule
19144
19179
  }
19145
19180
  },
19146
19181
  plugins: rtmCdn ? [rtmCdn] : []
@@ -21994,10 +22029,10 @@ class Logger extends Plugin {
21994
22029
  user_id: this._userId,
21995
22030
  device_id: this._deviceId,
21996
22031
  ext: {
21997
- veplayer_version: "2.4.0",
21998
- flv_version: "3.0.19-rc.0",
22032
+ veplayer_version: "2.4.1-rc.0",
22033
+ flv_version: "3.0.19-rc.10",
21999
22034
  hls_version: "3.0.19-rc.0",
22000
- rts_version: "0.2.1-alpha.0"
22035
+ rts_version: "0.2.1-alpha.1"
22001
22036
  }
22002
22037
  });
22003
22038
  }
@@ -22291,29 +22326,6 @@ const getDrmStrategy = async (options, player) => {
22291
22326
  }
22292
22327
  return {};
22293
22328
  };
22294
- const getAbrStrategy = async (options) => {
22295
- var _a, _b;
22296
- const streamType = options.url && getStreamType(options.url);
22297
- if (streamType === "rtm") {
22298
- return {};
22299
- }
22300
- const abrOptions = streamType === "flv" ? (_a = options == null ? void 0 : options.flv) == null ? void 0 : _a.abr : (_b = options == null ? void 0 : options.hls) == null ? void 0 : _b.abr;
22301
- if (!abrOptions) {
22302
- return {};
22303
- }
22304
- const abrPlugin = await load(DynamicModule.PluginAbr).catch(() => void 0);
22305
- return {
22306
- options: {
22307
- [streamType === "flv" ? "abr" : "hlsabr"]: {
22308
- ...abrOptions,
22309
- open: abrOptions.enable ?? true
22310
- }
22311
- },
22312
- plugins: [
22313
- streamType === "flv" ? abrPlugin == null ? void 0 : abrPlugin.AbrPlugin : abrPlugin == null ? void 0 : abrPlugin.HlsAbrPlugin
22314
- ]
22315
- };
22316
- };
22317
22329
  VeI18n.extend([
22318
22330
  {
22319
22331
  LANG: "zh-cn",
@@ -13742,7 +13742,7 @@ class VePlayerBase {
13742
13742
  * @returns
13743
13743
  */
13744
13744
  get playerVersion() {
13745
- return "2.4.0";
13745
+ return "2.4.1-rc.0";
13746
13746
  }
13747
13747
  /** {zh}
13748
13748
  * @brief 获取当前播放视频的清晰度唯一标识(definition)。
@@ -19063,6 +19063,29 @@ async function isRTMSupportCodec(codec = RTMCodec.H264) {
19063
19063
  return RtmPlugin.isSupportedH264();
19064
19064
  return false;
19065
19065
  }
19066
+ const getAbrStrategy = async (options) => {
19067
+ var _a, _b;
19068
+ const streamType = options.url && getStreamType(options.url);
19069
+ if (streamType === "rtm") {
19070
+ return {};
19071
+ }
19072
+ const abrOptions = streamType === "flv" ? (_a = options == null ? void 0 : options.flv) == null ? void 0 : _a.abr : (_b = options == null ? void 0 : options.hls) == null ? void 0 : _b.abr;
19073
+ if (!abrOptions) {
19074
+ return {};
19075
+ }
19076
+ const abrPlugin = await load(DynamicModule.PluginAbr).catch(() => void 0);
19077
+ return {
19078
+ options: {
19079
+ [streamType === "flv" ? "abr" : "hlsabr"]: {
19080
+ ...abrOptions,
19081
+ open: abrOptions.enable ?? true
19082
+ }
19083
+ },
19084
+ plugins: [
19085
+ streamType === "flv" ? abrPlugin == null ? void 0 : abrPlugin.AbrPlugin : abrPlugin == null ? void 0 : abrPlugin.HlsAbrPlugin
19086
+ ]
19087
+ };
19088
+ };
19066
19089
  const rtmStrategy = {
19067
19090
  options: {},
19068
19091
  module: DynamicModule.PluginRtm
@@ -19077,6 +19100,8 @@ const generateFallbackUrl = (url) => {
19077
19100
  const getRtmStrategy = async (options, player) => {
19078
19101
  var _a;
19079
19102
  let backupStrategy;
19103
+ let backupOptions = {};
19104
+ let backupModule = [];
19080
19105
  const { url } = options;
19081
19106
  const {
19082
19107
  fallbackUrl,
@@ -19091,7 +19116,7 @@ const getRtmStrategy = async (options, player) => {
19091
19116
  } else if (backupType === "hls" && (sniffer$1.device !== "mobile" || ((_a = options == null ? void 0 : options.hls) == null ? void 0 : _a.enableMSE)) && util.isMseSupported(Codec.H264)) {
19092
19117
  backupStrategy = createHlsMseStrategy(options);
19093
19118
  }
19094
- const [rtmCdn, backupCdn] = await Promise.all([
19119
+ const [rtmCdn, backupCdn, backupAbr] = await Promise.all([
19095
19120
  load(rtmStrategy.module).then((module) => {
19096
19121
  return module.RtmPlugin;
19097
19122
  }).catch(() => void 0),
@@ -19101,8 +19126,18 @@ const getRtmStrategy = async (options, player) => {
19101
19126
  } else if ((backupStrategy == null ? void 0 : backupStrategy.module) === DynamicModule.PluginHls) {
19102
19127
  return module.HlsPlugin;
19103
19128
  }
19104
- }).catch(() => void 0)
19129
+ }).catch(() => void 0),
19130
+ getAbrStrategy({ ...options, url: actualFallbackUrl }).catch(
19131
+ () => void 0
19132
+ )
19105
19133
  ]);
19134
+ if (backupType) {
19135
+ backupOptions = {
19136
+ ...backupStrategy == null ? void 0 : backupStrategy.options,
19137
+ ...backupAbr == null ? void 0 : backupAbr.options
19138
+ };
19139
+ backupModule = [backupCdn, ...(backupAbr == null ? void 0 : backupAbr.plugins) ?? []];
19140
+ }
19106
19141
  const [RTMSupported, RTMSupportCodec] = await Promise.all([
19107
19142
  isRTMSupported(),
19108
19143
  isRTMSupportCodec()
@@ -19120,7 +19155,7 @@ const getRtmStrategy = async (options, player) => {
19120
19155
  }
19121
19156
  return {
19122
19157
  options: {
19123
- ...(backupStrategy == null ? void 0 : backupStrategy.options) || {},
19158
+ ...backupOptions || {},
19124
19159
  url: actualFallbackUrl,
19125
19160
  _RTMdegrade: {
19126
19161
  _originRtmUrl: url,
@@ -19128,19 +19163,19 @@ const getRtmStrategy = async (options, player) => {
19128
19163
  _isRTMSupportCodec: RTMSupportCodec
19129
19164
  }
19130
19165
  },
19131
- plugins: backupCdn ? [backupCdn] : []
19166
+ plugins: backupModule
19132
19167
  };
19133
19168
  }
19134
19169
  return {
19135
19170
  options: {
19136
- ...(backupStrategy == null ? void 0 : backupStrategy.options) || {},
19171
+ ...backupOptions || {},
19137
19172
  url: enableRTMAutoTranscode ? util.appendSearchParams(url, { enableRTMAutoTranscode: "true" }) : void 0,
19138
19173
  _RTMdegrade: void 0,
19139
19174
  rts: {
19140
19175
  retryCount: 0,
19141
19176
  ...ret,
19142
19177
  backupURL: actualFallbackUrl,
19143
- backupConstruct: backupCdn
19178
+ backupConstruct: backupModule
19144
19179
  }
19145
19180
  },
19146
19181
  plugins: rtmCdn ? [rtmCdn] : []
@@ -21994,10 +22029,10 @@ class Logger extends Plugin {
21994
22029
  user_id: this._userId,
21995
22030
  device_id: this._deviceId,
21996
22031
  ext: {
21997
- veplayer_version: "2.4.0",
21998
- flv_version: "3.0.19-rc.0",
22032
+ veplayer_version: "2.4.1-rc.0",
22033
+ flv_version: "3.0.19-rc.10",
21999
22034
  hls_version: "3.0.19-rc.0",
22000
- rts_version: "0.2.1-alpha.0"
22035
+ rts_version: "0.2.1-alpha.1"
22001
22036
  }
22002
22037
  });
22003
22038
  }
@@ -22291,29 +22326,6 @@ const getDrmStrategy = async (options, player) => {
22291
22326
  }
22292
22327
  return {};
22293
22328
  };
22294
- const getAbrStrategy = async (options) => {
22295
- var _a, _b;
22296
- const streamType = options.url && getStreamType(options.url);
22297
- if (streamType === "rtm") {
22298
- return {};
22299
- }
22300
- const abrOptions = streamType === "flv" ? (_a = options == null ? void 0 : options.flv) == null ? void 0 : _a.abr : (_b = options == null ? void 0 : options.hls) == null ? void 0 : _b.abr;
22301
- if (!abrOptions) {
22302
- return {};
22303
- }
22304
- const abrPlugin = await load(DynamicModule.PluginAbr).catch(() => void 0);
22305
- return {
22306
- options: {
22307
- [streamType === "flv" ? "abr" : "hlsabr"]: {
22308
- ...abrOptions,
22309
- open: abrOptions.enable ?? true
22310
- }
22311
- },
22312
- plugins: [
22313
- streamType === "flv" ? abrPlugin == null ? void 0 : abrPlugin.AbrPlugin : abrPlugin == null ? void 0 : abrPlugin.HlsAbrPlugin
22314
- ]
22315
- };
22316
- };
22317
22329
  VeI18n.extend([
22318
22330
  {
22319
22331
  LANG: "zh-cn",