@byteplus/veplayer 2.11.0 → 2.11.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/veplayer.d.ts CHANGED
@@ -5819,6 +5819,7 @@ declare enum LicenseFeature {
5819
5819
  H265 = "h265",
5820
5820
  PRELOAD = "preload",
5821
5821
  RTM = "rtm",
5822
+ RTM_ADAPTIVE_BUFFER = "rtmAdaptiveBuffer",
5822
5823
  ABR = "abr",
5823
5824
  FLV_LOW_LATENCY = "flvLowLatency"
5824
5825
  }
@@ -6313,7 +6314,8 @@ type ErrorCode = ValueOf<typeof ErrorCode>;
6313
6314
  declare enum LiveLicenseFeature {
6314
6315
  RTM = "rtm",
6315
6316
  ABR = "abr",
6316
- FLV_LOW_LATENCY = "flvLowLatency"
6317
+ FLV_LOW_LATENCY = "flvLowLatency",
6318
+ RTM_ADAPTIVE_BUFFER = "rtmAdaptiveBuffer"
6317
6319
  }
6318
6320
  /** {zh}
6319
6321
  * @list option
@@ -6347,9 +6349,6 @@ declare class LicenseEventEmitter {
6347
6349
  start(player: any): void;
6348
6350
  }
6349
6351
  declare class LiveLicenseManager {
6350
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6351
- // @ts-ignore
6352
- enableLiveLicenseCheck: boolean;
6353
6352
  licenseSupportModuleList: LicenseFeature[];
6354
6353
  licenseStatusResult?: LicenseStatus;
6355
6354
  licenseCheckResult?: LicenseEdition;
@@ -11037,6 +11036,7 @@ declare namespace live {
11037
11036
  H265 = "h265",
11038
11037
  PRELOAD = "preload",
11039
11038
  RTM = "rtm",
11039
+ RTM_ADAPTIVE_BUFFER = "rtmAdaptiveBuffer",
11040
11040
  ABR = "abr",
11041
11041
  FLV_LOW_LATENCY = "flvLowLatency"
11042
11042
  }
@@ -11588,7 +11588,8 @@ declare namespace live {
11588
11588
  enum LiveLicenseFeature {
11589
11589
  RTM = "rtm",
11590
11590
  ABR = "abr",
11591
- FLV_LOW_LATENCY = "flvLowLatency"
11591
+ FLV_LOW_LATENCY = "flvLowLatency",
11592
+ RTM_ADAPTIVE_BUFFER = "rtmAdaptiveBuffer"
11592
11593
  }
11593
11594
  /** {zh}
11594
11595
  * @list option
@@ -11623,9 +11624,6 @@ declare namespace live {
11623
11624
  start(player: any): void;
11624
11625
  }
11625
11626
  class LiveLicenseManager {
11626
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
11627
- // @ts-ignore
11628
- enableLiveLicenseCheck: boolean;
11629
11627
  licenseSupportModuleList: LicenseFeature[];
11630
11628
  licenseStatusResult?: LicenseStatus;
11631
11629
  licenseCheckResult?: LicenseEdition;
@@ -14616,7 +14616,7 @@ class VePlayerBase {
14616
14616
  * @brief Retrieve the player SDK version number.
14617
14617
  */
14618
14618
  get playerVersion() {
14619
- return "2.11.0";
14619
+ return "2.11.2";
14620
14620
  }
14621
14621
  /** {zh}
14622
14622
  * @brief 获取当前播放视频的清晰度唯一标识(definition)。
@@ -31060,6 +31060,7 @@ var LicenseFeature = /* @__PURE__ */ ((LicenseFeature2) => {
31060
31060
  LicenseFeature2["H265"] = "h265";
31061
31061
  LicenseFeature2["PRELOAD"] = "preload";
31062
31062
  LicenseFeature2["RTM"] = "rtm";
31063
+ LicenseFeature2["RTM_ADAPTIVE_BUFFER"] = "rtmAdaptiveBuffer";
31063
31064
  LicenseFeature2["ABR"] = "abr";
31064
31065
  LicenseFeature2["FLV_LOW_LATENCY"] = "flvLowLatency";
31065
31066
  return LicenseFeature2;
@@ -56475,7 +56476,7 @@ let Logger$1 = class Logger2 extends Plugin {
56475
56476
  device_id: deviceId,
56476
56477
  error_report_stop: true,
56477
56478
  ext: {
56478
- veplayer_version: "2.11.0",
56479
+ veplayer_version: "2.11.2",
56479
56480
  flv_version: "3.0.23-rc.6",
56480
56481
  hls_version: "3.0.21-rc.21",
56481
56482
  rts_version: "0.2.1-alpha.57"
@@ -62010,6 +62011,19 @@ const LicenseWarningMap = {
62010
62011
  code: ErrorCode.LICENSE_EXPIRED_RTM
62011
62012
  }
62012
62013
  },
62014
+ [
62015
+ "rtmAdaptiveBuffer"
62016
+ /* RTM_ADAPTIVE_BUFFER */
62017
+ ]: {
62018
+ BASE_LICENSE_NOT_SUPPORT: {
62019
+ type: "BASE_LICENSE_NOT_SUPPORT",
62020
+ feature: LicenseFeature.RTM_ADAPTIVE_BUFFER
62021
+ },
62022
+ LICENSE_EXPIRED: {
62023
+ type: "LICENSE_EXPIRED",
62024
+ feature: LicenseFeature.RTM_ADAPTIVE_BUFFER
62025
+ }
62026
+ },
62013
62027
  [LicenseFeature.PRELOAD]: {
62014
62028
  BASE_LICENSE_NOT_SUPPORT: {
62015
62029
  type: "BASE_LICENSE_NOT_SUPPORT",
@@ -62041,6 +62055,16 @@ const LicenseWarningMap = {
62041
62055
  }
62042
62056
  }
62043
62057
  };
62058
+ const premiumFeatureList = (
62059
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
62060
+ // @ts-ignore
62061
+ [
62062
+ LicenseFeature.RTM,
62063
+ LicenseFeature.RTM_ADAPTIVE_BUFFER,
62064
+ LicenseFeature.ABR,
62065
+ LicenseFeature.FLV_LOW_LATENCY
62066
+ ]
62067
+ );
62044
62068
  class LicenseEventEmitter {
62045
62069
  constructor() {
62046
62070
  __publicField(this, "player");
@@ -62081,17 +62105,11 @@ class LicenseEventEmitter {
62081
62105
  }
62082
62106
  class LiveLicenseManager {
62083
62107
  constructor() {
62084
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
62085
- // @ts-ignore
62086
- __publicField(this, "enableLiveLicenseCheck", true);
62087
62108
  __publicField(this, "licenseSupportModuleList", []);
62088
62109
  __publicField(this, "licenseStatusResult");
62089
62110
  __publicField(this, "licenseCheckResult");
62090
62111
  }
62091
62112
  async create() {
62092
- if (!this.enableLiveLicenseCheck) {
62093
- return;
62094
- }
62095
62113
  const [license, featureList] = await Promise.all([
62096
62114
  licenseManager.checkLicense(),
62097
62115
  licenseManager.checkModuleList()
@@ -62105,9 +62123,6 @@ class LiveLicenseManager {
62105
62123
  }
62106
62124
  // 获取 License Fatal 报错信息,License 有问题或者 Domain 不匹配
62107
62125
  getLicenseFatalError() {
62108
- if (!this.enableLiveLicenseCheck) {
62109
- return;
62110
- }
62111
62126
  if (this.licenseStatusResult === LicenseStatus.LICENSE_STATUS_INVALID) {
62112
62127
  console.warn(`current license is invalid, please check license`);
62113
62128
  return ErrorCode.LICENSE_STATUS_INVALID;
@@ -62120,7 +62135,7 @@ class LiveLicenseManager {
62120
62135
  // 验证 License 是否支持该 feature
62121
62136
  checkLiveLicenseFeature(feature) {
62122
62137
  var _a, _b;
62123
- if (!this.enableLiveLicenseCheck) {
62138
+ if (!premiumFeatureList.includes(feature)) {
62124
62139
  return;
62125
62140
  }
62126
62141
  const result = licenseManager.licenseSupportModuleList.includes(feature);
@@ -62650,7 +62665,7 @@ class RtmProtocol extends BaseProtocol {
62650
62665
  return LiveUrlType.Rtm;
62651
62666
  }
62652
62667
  get defaultFallbackStrategy() {
62653
- return { [FallbackKind.Error]: { shouldFallback: () => true } };
62668
+ return { [FallbackKind.Error]: { excludeList: [2104, 2103, 2101, 2100] } };
62654
62669
  }
62655
62670
  static canGenerateOtherProtocol(options) {
62656
62671
  var _a;
@@ -62693,10 +62708,17 @@ class RtmProtocol extends BaseProtocol {
62693
62708
  i18n,
62694
62709
  enableSelector
62695
62710
  }) {
62711
+ var _a;
62696
62712
  const licenseRtmNotSupportedError = liveLicenseManager.checkLiveLicenseFeature(LicenseFeature.RTM);
62697
62713
  if (licenseRtmNotSupportedError == null ? void 0 : licenseRtmNotSupportedError.code) {
62698
62714
  throw create(licenseRtmNotSupportedError.code, i18n);
62699
62715
  }
62716
+ const licenseRtmAdaptiveBufferNotSupportedError = liveLicenseManager.checkLiveLicenseFeature(
62717
+ LicenseFeature.RTM_ADAPTIVE_BUFFER
62718
+ );
62719
+ if (licenseRtmAdaptiveBufferNotSupportedError && ((_a = options.rtm) == null ? void 0 : _a.enableAdaptiveJitterBuffer)) {
62720
+ options.rtm.enableAdaptiveJitterBuffer = false;
62721
+ }
62700
62722
  this.protocolStrategy = await getRtmStrategy(
62701
62723
  enableSelector ? {
62702
62724
  options,
@@ -74159,7 +74181,7 @@ async function prepare(options) {
74159
74181
  }
74160
74182
  await ((_a = liveVeStrategy.veStrategyManager) == null ? void 0 : _a.init({
74161
74183
  ...options,
74162
- playerVersion: "2.11.0",
74184
+ playerVersion: "2.11.2",
74163
74185
  type: "LIVE"
74164
74186
  }));
74165
74187
  return liveVeStrategy.veStrategyManager;
@@ -5819,6 +5819,7 @@ declare enum LicenseFeature {
5819
5819
  H265 = "h265",
5820
5820
  PRELOAD = "preload",
5821
5821
  RTM = "rtm",
5822
+ RTM_ADAPTIVE_BUFFER = "rtmAdaptiveBuffer",
5822
5823
  ABR = "abr",
5823
5824
  FLV_LOW_LATENCY = "flvLowLatency"
5824
5825
  }
@@ -6313,7 +6314,8 @@ type ErrorCode = ValueOf<typeof ErrorCode>;
6313
6314
  declare enum LiveLicenseFeature {
6314
6315
  RTM = "rtm",
6315
6316
  ABR = "abr",
6316
- FLV_LOW_LATENCY = "flvLowLatency"
6317
+ FLV_LOW_LATENCY = "flvLowLatency",
6318
+ RTM_ADAPTIVE_BUFFER = "rtmAdaptiveBuffer"
6317
6319
  }
6318
6320
  /** {zh}
6319
6321
  * @list option
@@ -6347,9 +6349,6 @@ declare class LicenseEventEmitter {
6347
6349
  start(player: any): void;
6348
6350
  }
6349
6351
  declare class LiveLicenseManager {
6350
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6351
- // @ts-ignore
6352
- enableLiveLicenseCheck: boolean;
6353
6352
  licenseSupportModuleList: LicenseFeature[];
6354
6353
  licenseStatusResult?: LicenseStatus;
6355
6354
  licenseCheckResult?: LicenseEdition;
@@ -11037,6 +11036,7 @@ declare namespace live {
11037
11036
  H265 = "h265",
11038
11037
  PRELOAD = "preload",
11039
11038
  RTM = "rtm",
11039
+ RTM_ADAPTIVE_BUFFER = "rtmAdaptiveBuffer",
11040
11040
  ABR = "abr",
11041
11041
  FLV_LOW_LATENCY = "flvLowLatency"
11042
11042
  }
@@ -11588,7 +11588,8 @@ declare namespace live {
11588
11588
  enum LiveLicenseFeature {
11589
11589
  RTM = "rtm",
11590
11590
  ABR = "abr",
11591
- FLV_LOW_LATENCY = "flvLowLatency"
11591
+ FLV_LOW_LATENCY = "flvLowLatency",
11592
+ RTM_ADAPTIVE_BUFFER = "rtmAdaptiveBuffer"
11592
11593
  }
11593
11594
  /** {zh}
11594
11595
  * @list option
@@ -11623,9 +11624,6 @@ declare namespace live {
11623
11624
  start(player: any): void;
11624
11625
  }
11625
11626
  class LiveLicenseManager {
11626
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
11627
- // @ts-ignore
11628
- enableLiveLicenseCheck: boolean;
11629
11627
  licenseSupportModuleList: LicenseFeature[];
11630
11628
  licenseStatusResult?: LicenseStatus;
11631
11629
  licenseCheckResult?: LicenseEdition;
@@ -14616,7 +14616,7 @@ class VePlayerBase {
14616
14616
  * @brief Retrieve the player SDK version number.
14617
14617
  */
14618
14618
  get playerVersion() {
14619
- return "2.11.0";
14619
+ return "2.11.2";
14620
14620
  }
14621
14621
  /** {zh}
14622
14622
  * @brief 获取当前播放视频的清晰度唯一标识(definition)。
@@ -31060,6 +31060,7 @@ var LicenseFeature = /* @__PURE__ */ ((LicenseFeature2) => {
31060
31060
  LicenseFeature2["H265"] = "h265";
31061
31061
  LicenseFeature2["PRELOAD"] = "preload";
31062
31062
  LicenseFeature2["RTM"] = "rtm";
31063
+ LicenseFeature2["RTM_ADAPTIVE_BUFFER"] = "rtmAdaptiveBuffer";
31063
31064
  LicenseFeature2["ABR"] = "abr";
31064
31065
  LicenseFeature2["FLV_LOW_LATENCY"] = "flvLowLatency";
31065
31066
  return LicenseFeature2;
@@ -56475,7 +56476,7 @@ let Logger$1 = class Logger2 extends Plugin {
56475
56476
  device_id: deviceId,
56476
56477
  error_report_stop: true,
56477
56478
  ext: {
56478
- veplayer_version: "2.11.0",
56479
+ veplayer_version: "2.11.2",
56479
56480
  flv_version: "3.0.23-rc.6",
56480
56481
  hls_version: "3.0.21-rc.21",
56481
56482
  rts_version: "0.2.1-alpha.57"
@@ -62016,6 +62017,19 @@ const LicenseWarningMap = {
62016
62017
  code: ErrorCode.LICENSE_EXPIRED_RTM
62017
62018
  }
62018
62019
  },
62020
+ [
62021
+ "rtmAdaptiveBuffer"
62022
+ /* RTM_ADAPTIVE_BUFFER */
62023
+ ]: {
62024
+ BASE_LICENSE_NOT_SUPPORT: {
62025
+ type: "BASE_LICENSE_NOT_SUPPORT",
62026
+ feature: LicenseFeature.RTM_ADAPTIVE_BUFFER
62027
+ },
62028
+ LICENSE_EXPIRED: {
62029
+ type: "LICENSE_EXPIRED",
62030
+ feature: LicenseFeature.RTM_ADAPTIVE_BUFFER
62031
+ }
62032
+ },
62019
62033
  [LicenseFeature.PRELOAD]: {
62020
62034
  BASE_LICENSE_NOT_SUPPORT: {
62021
62035
  type: "BASE_LICENSE_NOT_SUPPORT",
@@ -62047,6 +62061,16 @@ const LicenseWarningMap = {
62047
62061
  }
62048
62062
  }
62049
62063
  };
62064
+ const premiumFeatureList = (
62065
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
62066
+ // @ts-ignore
62067
+ [
62068
+ LicenseFeature.RTM,
62069
+ LicenseFeature.RTM_ADAPTIVE_BUFFER,
62070
+ LicenseFeature.ABR,
62071
+ LicenseFeature.FLV_LOW_LATENCY
62072
+ ]
62073
+ );
62050
62074
  class LicenseEventEmitter {
62051
62075
  constructor() {
62052
62076
  __publicField(this, "player");
@@ -62087,17 +62111,11 @@ class LicenseEventEmitter {
62087
62111
  }
62088
62112
  class LiveLicenseManager {
62089
62113
  constructor() {
62090
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
62091
- // @ts-ignore
62092
- __publicField(this, "enableLiveLicenseCheck", true);
62093
62114
  __publicField(this, "licenseSupportModuleList", []);
62094
62115
  __publicField(this, "licenseStatusResult");
62095
62116
  __publicField(this, "licenseCheckResult");
62096
62117
  }
62097
62118
  async create() {
62098
- if (!this.enableLiveLicenseCheck) {
62099
- return;
62100
- }
62101
62119
  const [license, featureList] = await Promise.all([
62102
62120
  licenseManager.checkLicense(),
62103
62121
  licenseManager.checkModuleList()
@@ -62111,9 +62129,6 @@ class LiveLicenseManager {
62111
62129
  }
62112
62130
  // 获取 License Fatal 报错信息,License 有问题或者 Domain 不匹配
62113
62131
  getLicenseFatalError() {
62114
- if (!this.enableLiveLicenseCheck) {
62115
- return;
62116
- }
62117
62132
  if (this.licenseStatusResult === LicenseStatus.LICENSE_STATUS_INVALID) {
62118
62133
  console.warn(`current license is invalid, please check license`);
62119
62134
  return ErrorCode.LICENSE_STATUS_INVALID;
@@ -62126,7 +62141,7 @@ class LiveLicenseManager {
62126
62141
  // 验证 License 是否支持该 feature
62127
62142
  checkLiveLicenseFeature(feature) {
62128
62143
  var _a, _b;
62129
- if (!this.enableLiveLicenseCheck) {
62144
+ if (!premiumFeatureList.includes(feature)) {
62130
62145
  return;
62131
62146
  }
62132
62147
  const result = licenseManager.licenseSupportModuleList.includes(feature);
@@ -62656,7 +62671,7 @@ class RtmProtocol extends BaseProtocol {
62656
62671
  return LiveUrlType.Rtm;
62657
62672
  }
62658
62673
  get defaultFallbackStrategy() {
62659
- return { [FallbackKind.Error]: { shouldFallback: () => true } };
62674
+ return { [FallbackKind.Error]: { excludeList: [2104, 2103, 2101, 2100] } };
62660
62675
  }
62661
62676
  static canGenerateOtherProtocol(options) {
62662
62677
  var _a;
@@ -62699,10 +62714,17 @@ class RtmProtocol extends BaseProtocol {
62699
62714
  i18n,
62700
62715
  enableSelector
62701
62716
  }) {
62717
+ var _a;
62702
62718
  const licenseRtmNotSupportedError = liveLicenseManager.checkLiveLicenseFeature(LicenseFeature.RTM);
62703
62719
  if (licenseRtmNotSupportedError == null ? void 0 : licenseRtmNotSupportedError.code) {
62704
62720
  throw create(licenseRtmNotSupportedError.code, i18n);
62705
62721
  }
62722
+ const licenseRtmAdaptiveBufferNotSupportedError = liveLicenseManager.checkLiveLicenseFeature(
62723
+ LicenseFeature.RTM_ADAPTIVE_BUFFER
62724
+ );
62725
+ if (licenseRtmAdaptiveBufferNotSupportedError && ((_a = options.rtm) == null ? void 0 : _a.enableAdaptiveJitterBuffer)) {
62726
+ options.rtm.enableAdaptiveJitterBuffer = false;
62727
+ }
62706
62728
  this.protocolStrategy = await getRtmStrategy(
62707
62729
  enableSelector ? {
62708
62730
  options,
@@ -74165,7 +74187,7 @@ async function prepare(options) {
74165
74187
  }
74166
74188
  await ((_a = liveVeStrategy.veStrategyManager) == null ? void 0 : _a.init({
74167
74189
  ...options,
74168
- playerVersion: "2.11.0",
74190
+ playerVersion: "2.11.2",
74169
74191
  type: "LIVE"
74170
74192
  }));
74171
74193
  return liveVeStrategy.veStrategyManager;