@volcengine/veplayer 2.6.0-rc.4 → 2.6.0-rc.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volcengine/veplayer",
3
- "version": "2.6.0-rc.4",
3
+ "version": "2.6.0-rc.5",
4
4
  "main": "./umd/veplayer.production.js",
5
5
  "module": "./esm/veplayer.production.js",
6
6
  "browser": "./umd/veplayer.production.js",
package/umd/index.d.ts CHANGED
@@ -419,7 +419,14 @@ declare enum Level {
419
419
  /** {en}
420
420
  * @brief Error.
421
421
  */
422
- Error = "Error"
422
+ Error = "Error",
423
+ /** {zh}
424
+ * @brief 提示。
425
+ */
426
+ /** {en}
427
+ * @brief Warn.
428
+ */
429
+ Warn = "Warn"
423
430
  }
424
431
  declare enum ErrorCode {
425
432
  /** {zh}
@@ -1399,13 +1406,13 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
1399
1406
  */
1400
1407
  interface Fullscreen {
1401
1408
  /** {zh}
1402
- * @brief 切换全屏时,是否旋转为横屏播放,通常在移动端使用。如果开启横屏播放,切换全屏时,将在竖屏状态下把播放器旋转 90 度,实现横屏效果。该配置优先级高于 useCssFullscreen。
1403
- * - `true`:使用旋转横屏;
1404
- * - `false`:不使用旋转横屏。
1409
+ * @brief 切换全屏时,是否旋转为横屏播放,通常在移动端使用。如果开启横屏播放,切换全屏时,将在竖屏状态下把播放器旋转 90 度,实现横屏效果。该配置优先级低于 useCssFullscreen。
1410
+ * - `true`:使用旋转横屏;
1411
+ * - `false`:不使用旋转横屏。
1405
1412
  * @default false
1406
1413
  */
1407
1414
  /** {en}
1408
- * @brief Whether to play the video in landscape mode when the video enters full-screen mode. This feature is usually used on mobile devices. Once enabled, when the video enters fullscreen mode, the player will be rotated from portrait mode by 90 degrees to landscape mode. This property has a higher priority over `useCssFullscreen`.
1415
+ * @brief Whether to play the video in landscape mode when the video enters full-screen mode. This feature is usually used on mobile devices. Once enabled, when the video enters fullscreen mode, the player will be rotated from portrait mode by 90 degrees to landscape mode. This property has a lower priority than `useCssFullscreen`.
1409
1416
  * - `true`: Enable.
1410
1417
  * - `false`: Disable.
1411
1418
  * @default false
@@ -1501,15 +1508,16 @@ type PrepareResult = {
1501
1508
  options?: Partial<VePlayerBaseOptions>;
1502
1509
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1503
1510
  plugins?: any[];
1511
+ useSrc?: boolean;
1504
1512
  };
1505
1513
  type PreparePlugins = (url: string) => Promise<PrepareResult> | undefined;
1506
1514
  /** {zh}
1507
1515
  * @detail option
1508
- * @brief 视频的实际编码格式。如果您在degradation 设置了 SoftFirst 属性(即硬解不支持降级软解),建议您传入该参数,省去探测实际编码格式的操作。
1516
+ * @brief 视频的实际编码格式。如果您在 degradation 设置了 SoftFirst 属性(即硬解不支持降级软解),建议您传入该参数,省去探测实际编码格式的操作。
1509
1517
  */
1510
1518
  /** {en}
1511
1519
  * @detail option
1512
- * @brief The actual codec of the video.
1520
+ * @brief The actual codec of the video. If you set the SoftFirst property in degradation (that is, hard solutions do not support downgrading soft solutions), it is recommended that you pass this parameter to save the operation of probing the actual encoding format.
1513
1521
  */
1514
1522
  declare enum Codec {
1515
1523
  /** {zh}
@@ -2147,16 +2155,17 @@ declare class VePlayerBase {
2147
2155
  * @hidden
2148
2156
  */
2149
2157
  prepare(url: string): Promise<{
2150
- plugins: any[];
2158
+ plugins: any[] | undefined;
2151
2159
  options: Partial<VePlayerBaseOptions> | undefined;
2160
+ isSameProtocol: boolean | "";
2161
+ useSrc: boolean | undefined;
2152
2162
  }>;
2153
2163
  private _handleFallback;
2154
2164
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2155
2165
  private _transformEvent;
2156
2166
  private _switch;
2167
+ private _switchDifferentProtocolUrl;
2157
2168
  private _switchUrl;
2158
- // 获取需要卸载和需要注册的播放插件
2159
- private _diffPlugins;
2160
2169
  private _callBeforePlayerInitForUrl;
2161
2170
  }
2162
2171
  declare const enum State {
@@ -2184,6 +2193,7 @@ declare enum DynamicModule {
2184
2193
  PluginFlv = "plugin:flv",
2185
2194
  PluginMp4 = "plugin:mp4",
2186
2195
  PluginHls = "plugin:hls",
2196
+ PluginHlsJs = "plugin:hlsjs",
2187
2197
  PluginShaka = "plugin:shaka",
2188
2198
  PluginRtm = "plugin:rtm",
2189
2199
  PluginXgvideo = "plugin:xgvideo",
@@ -2196,6 +2206,7 @@ type ModulesMap = {
2196
2206
  [DynamicModule.PluginFlv]: Exports;
2197
2207
  [DynamicModule.PluginMp4]: Exports;
2198
2208
  [DynamicModule.PluginHls]: Exports;
2209
+ [DynamicModule.PluginHlsJs]: Exports;
2199
2210
  [DynamicModule.PluginShaka]: Exports;
2200
2211
  [DynamicModule.PluginRtm]: Exports;
2201
2212
  [DynamicModule.PluginXgvideo]: Exports;
@@ -2679,7 +2690,14 @@ declare namespace strategy {
2679
2690
  /** {en}
2680
2691
  * @brief Error.
2681
2692
  */
2682
- Error = "Error"
2693
+ Error = "Error",
2694
+ /** {zh}
2695
+ * @brief 提示。
2696
+ */
2697
+ /** {en}
2698
+ * @brief Warn.
2699
+ */
2700
+ Warn = "Warn"
2683
2701
  }
2684
2702
  enum ErrorCode {
2685
2703
  /** {zh}
@@ -3722,13 +3740,13 @@ declare namespace strategy {
3722
3740
  */
3723
3741
  interface Fullscreen {
3724
3742
  /** {zh}
3725
- * @brief 切换全屏时,是否旋转为横屏播放,通常在移动端使用。如果开启横屏播放,切换全屏时,将在竖屏状态下把播放器旋转 90 度,实现横屏效果。该配置优先级高于 useCssFullscreen。
3726
- * - `true`:使用旋转横屏;
3727
- * - `false`:不使用旋转横屏。
3743
+ * @brief 切换全屏时,是否旋转为横屏播放,通常在移动端使用。如果开启横屏播放,切换全屏时,将在竖屏状态下把播放器旋转 90 度,实现横屏效果。该配置优先级低于 useCssFullscreen。
3744
+ * - `true`:使用旋转横屏;
3745
+ * - `false`:不使用旋转横屏。
3728
3746
  * @default false
3729
3747
  */
3730
3748
  /** {en}
3731
- * @brief Whether to play the video in landscape mode when the video enters full-screen mode. This feature is usually used on mobile devices. Once enabled, when the video enters fullscreen mode, the player will be rotated from portrait mode by 90 degrees to landscape mode. This property has a higher priority over `useCssFullscreen`.
3749
+ * @brief Whether to play the video in landscape mode when the video enters full-screen mode. This feature is usually used on mobile devices. Once enabled, when the video enters fullscreen mode, the player will be rotated from portrait mode by 90 degrees to landscape mode. This property has a lower priority than `useCssFullscreen`.
3732
3750
  * - `true`: Enable.
3733
3751
  * - `false`: Disable.
3734
3752
  * @default false
@@ -3824,15 +3842,16 @@ declare namespace strategy {
3824
3842
  options?: Partial<VePlayerBaseOptions>;
3825
3843
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3826
3844
  plugins?: any[];
3845
+ useSrc?: boolean;
3827
3846
  };
3828
3847
  type PreparePlugins = (url: string) => Promise<PrepareResult> | undefined;
3829
3848
  /** {zh}
3830
3849
  * @detail option
3831
- * @brief 视频的实际编码格式。如果您在degradation 设置了 SoftFirst 属性(即硬解不支持降级软解),建议您传入该参数,省去探测实际编码格式的操作。
3850
+ * @brief 视频的实际编码格式。如果您在 degradation 设置了 SoftFirst 属性(即硬解不支持降级软解),建议您传入该参数,省去探测实际编码格式的操作。
3832
3851
  */
3833
3852
  /** {en}
3834
3853
  * @detail option
3835
- * @brief The actual codec of the video.
3854
+ * @brief The actual codec of the video. If you set the SoftFirst property in degradation (that is, hard solutions do not support downgrading soft solutions), it is recommended that you pass this parameter to save the operation of probing the actual encoding format.
3836
3855
  */
3837
3856
  enum Codec {
3838
3857
  /** {zh}
@@ -3909,6 +3928,7 @@ declare namespace strategy {
3909
3928
  readonly "plugin:flv": "veplayer.plugin.flv.[env].[ext]";
3910
3929
  readonly "plugin:mp4": "veplayer.plugin.mp4.[env].[ext]";
3911
3930
  readonly "plugin:hls": "veplayer.plugin.hls.[env].[ext]";
3931
+ readonly "plugin:hlsjs": "veplayer.plugin.hlsjs.[env].[ext]";
3912
3932
  readonly "plugin:shaka": "veplayer.plugin.shaka.[env].[ext]";
3913
3933
  readonly "plugin:rtm": "veplayer.plugin.rtm.[env].[ext]";
3914
3934
  readonly "plugin:xgvideo": "veplayer.plugin.xgvideo.[env].[ext]";
@@ -3940,6 +3960,7 @@ declare namespace strategy {
3940
3960
  PluginFlv = "plugin:flv",
3941
3961
  PluginMp4 = "plugin:mp4",
3942
3962
  PluginHls = "plugin:hls",
3963
+ PluginHlsJs = "plugin:hlsjs",
3943
3964
  PluginShaka = "plugin:shaka",
3944
3965
  PluginRtm = "plugin:rtm",
3945
3966
  PluginXgvideo = "plugin:xgvideo",
@@ -3952,6 +3973,7 @@ declare namespace strategy {
3952
3973
  [DynamicModule.PluginFlv]: Exports;
3953
3974
  [DynamicModule.PluginMp4]: Exports;
3954
3975
  [DynamicModule.PluginHls]: Exports;
3976
+ [DynamicModule.PluginHlsJs]: Exports;
3955
3977
  [DynamicModule.PluginShaka]: Exports;
3956
3978
  [DynamicModule.PluginRtm]: Exports;
3957
3979
  [DynamicModule.PluginXgvideo]: Exports;
@@ -3992,22 +4014,16 @@ declare namespace strategy {
3992
4014
  module: R;
3993
4015
  afterLoad?: (module: ModulesMap[R]) => void;
3994
4016
  }
3995
- type StrategyCreator<T, R extends keyof ModulesMap = any> = (options?: T) => Strategy<T, R>;
4017
+ type StrategyCreator<T, R extends keyof ModulesMap = any> = (options?: T, ...res: any) => Strategy<T, R>;
3996
4018
  const createFlvMseStrategy: StrategyCreator<VePlayerBaseOptions, DynamicModule.PluginFlv>;
3997
- const createHlsMseStrategy: StrategyCreator<VePlayerBaseOptions, DynamicModule.PluginHls>;
4019
+ const createFlvMssStrategy: StrategyCreator<VePlayerBaseOptions, DynamicModule.PluginFlv>;
4020
+ const createHlsMseStrategy: StrategyCreator<VePlayerBaseOptions, DynamicModule.PluginHlsJs | DynamicModule.PluginHls>;
3998
4021
  const createSoftDecodeH264Strategy: StrategyCreator<VePlayerBaseOptions, DynamicModule.PluginXgvideo>;
3999
4022
  const createSoftDecodeH265Strategy: StrategyCreator<VePlayerBaseOptions, DynamicModule.PluginXgvideo>;
4000
4023
  function getCodec(options: VePlayerBaseOptions): Promise<"unknown" | Codec>;
4001
4024
  function detectCodec(url: string): Promise<"unknown" | Codec>;
4002
4025
  function isSoftDecode(options: VePlayerBaseOptions, currentCodec?: Codec | "unknown"): Promise<boolean>;
4003
4026
  function combineOptions<T = VePlayerBaseOptions>(strategyList: (Strategy<T> | undefined)[]): Partial<T>;
4004
- const getFlvStrategy: (options: VePlayerBaseOptions) => Promise<{
4005
- options?: undefined;
4006
- plugins?: undefined;
4007
- } | {
4008
- options: Partial<VePlayerBaseOptions>;
4009
- plugins: any[];
4010
- }>;
4011
4027
  const getHlsStrategy: (options: VePlayerBaseOptions) => Promise<{
4012
4028
  options?: undefined;
4013
4029
  plugins?: undefined;
@@ -4178,7 +4194,14 @@ declare namespace error {
4178
4194
  /** {en}
4179
4195
  * @brief Error.
4180
4196
  */
4181
- Error = "Error"
4197
+ Error = "Error",
4198
+ /** {zh}
4199
+ * @brief 提示。
4200
+ */
4201
+ /** {en}
4202
+ * @brief Warn.
4203
+ */
4204
+ Warn = "Warn"
4182
4205
  }
4183
4206
  enum ErrorCode {
4184
4207
  /** {zh}
@@ -4624,6 +4647,20 @@ declare namespace event {
4624
4647
  ABR_SWITCH_START: string;
4625
4648
  ABR_SWITCH_SUCCESS: string;
4626
4649
  ABR_SWITCH_FAILED: string;
4650
+ AD_FIRST_QUARTILE: string;
4651
+ AD_MIDPOINT: string;
4652
+ AD_THIRD_QUARTILE: string;
4653
+ AD_CLICK: string;
4654
+ AD_IMPRESSION: string;
4655
+ AD_RESUME: string;
4656
+ AD_START: string;
4657
+ AD_PLAY: string;
4658
+ AD_PAUSE: string;
4659
+ AD_TIME_UPDATE: string;
4660
+ AD_SKIPPED: string;
4661
+ AD_ERROR: string;
4662
+ AD_COMPLETE: string;
4663
+ AD_ALL_COMPLETED: string;
4627
4664
  };
4628
4665
  const Events: {
4629
4666
  SEI: string;
@@ -4652,6 +4689,20 @@ declare namespace event {
4652
4689
  ABR_SWITCH_START: string;
4653
4690
  ABR_SWITCH_SUCCESS: string;
4654
4691
  ABR_SWITCH_FAILED: string;
4692
+ AD_FIRST_QUARTILE: string;
4693
+ AD_MIDPOINT: string;
4694
+ AD_THIRD_QUARTILE: string;
4695
+ AD_CLICK: string;
4696
+ AD_IMPRESSION: string;
4697
+ AD_RESUME: string;
4698
+ AD_START: string;
4699
+ AD_PLAY: string;
4700
+ AD_PAUSE: string;
4701
+ AD_TIME_UPDATE: string;
4702
+ AD_SKIPPED: string;
4703
+ AD_ERROR: string;
4704
+ AD_COMPLETE: string;
4705
+ AD_ALL_COMPLETED: string;
4655
4706
  REPLAY: string;
4656
4707
  ERROR: string;
4657
4708
  PLAY: string;