@volcengine/veplayer 1.18.0-rc.3 → 1.18.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.
Files changed (3) hide show
  1. package/index.d.ts +73 -25
  2. package/index.min.js +2 -2
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -882,8 +882,13 @@ export interface IListItem {
882
882
  */
883
883
  [propName: string]: any;
884
884
  }
885
- /**
886
- * @brief 字幕文案配置
885
+ /** {zh}
886
+ * @brief 字幕文案配置。
887
+ * @list Options
888
+ * @kind property
889
+ */
890
+ /** {en}
891
+ * @brief Subtitle text item configuration.
887
892
  * @list Options
888
893
  * @kind property
889
894
  */
@@ -930,7 +935,7 @@ export interface ITextItem {
930
935
  */
931
936
  index?: number;
932
937
  }
933
- /**
938
+ /** {zh}
934
939
  * @brief 清晰度降级配置。
935
940
  * @list Options
936
941
  * @kind property
@@ -1051,15 +1056,17 @@ export declare class DefinitionDemotePlugin extends Plugin {
1051
1056
  destroy(): void;
1052
1057
  }
1053
1058
  /** {zh}
1054
- * 音轨选择选项。
1059
+ * @brief 音轨选择选项。
1055
1060
  * 对应 hls.js `AudioSelectionOption` 的所有字段,所有字段均可选。
1056
- * 用于 `switchAudioTrack()` 参数(配合 `id` 使用)以及 `audioPreference` 配置。
1061
+ * 用于 `switchAudioTrack()` 参数以及 `audioPreference` 配置。
1062
+ * @list Options
1057
1063
  * @kind property
1058
1064
  */
1059
1065
  /** {en}
1060
1066
  * @brief Audio track selection options.
1061
1067
  * Corresponding to all fields of hls.js `AudioSelectionOption`, all fields are optional.
1062
- * Used as parameters for `switchAudioTrack()` (using `id`) and `audioPreference` configuration.
1068
+ * Used for `switchAudioTrack()` and `audioPreference` configuration.
1069
+ * @list Options
1063
1070
  * @kind property
1064
1071
  */
1065
1072
  export interface AudioTrackOption {
@@ -1128,9 +1135,11 @@ export interface AudioTrackOption {
1128
1135
  [key: string]: unknown;
1129
1136
  }
1130
1137
  /** {zh}
1138
+ * @detail Api
1131
1139
  * @brief HLS 音轨对象。在 `AudioTrackOption` 基础上包含列表索引与展示名称。
1132
1140
  */
1133
1141
  /** {en}
1142
+ * @detail Api
1134
1143
  * @brief HLS audio track object. Extends `AudioTrackOption` with list index and display name.
1135
1144
  */
1136
1145
  export interface AudioTrack extends AudioTrackOption {
@@ -1157,9 +1166,11 @@ export interface AudioTrack extends AudioTrackOption {
1157
1166
  default: boolean;
1158
1167
  }
1159
1168
  /** {zh}
1169
+ * @detail Api
1160
1170
  * @brief `getAudioTracks()` / `getCurrentAudioTrack()` 的返回项类型,可直接传入 `switchAudioTrack()`。
1161
1171
  */
1162
1172
  /** {en}
1173
+ * @detail Api
1163
1174
  * @brief Return type of `getAudioTracks()` / `getCurrentAudioTrack()`; can be passed directly to `switchAudioTrack()`.
1164
1175
  */
1165
1176
  export interface AudioTrackInfo extends AudioTrack {
@@ -1258,7 +1269,7 @@ export interface IAudioTrackMobileConfig {
1258
1269
  */
1259
1270
  showNameSuffix?: boolean;
1260
1271
  }
1261
- /**
1272
+ /** {zh}
1262
1273
  * @brief DASH 播放配置。
1263
1274
  * @list Options
1264
1275
  * @kind property
@@ -2139,7 +2150,7 @@ export interface IMobileConfig {
2139
2150
  * @default true
2140
2151
  */
2141
2152
  /** {en}
2142
- * @brief Whether to enable left dimming function. Because the web端无法调用系统的亮度,这个功能实际使用透明蒙层实现。
2153
+ * @brief Whether to enable left dimming function. Because the web cannot call the system brightness, this function is actually implemented using a transparent overlay.
2143
2154
  * @default true
2144
2155
  */
2145
2156
  darkness?: boolean;
@@ -2271,32 +2282,54 @@ export interface IMobileConfig {
2271
2282
  */
2272
2283
  disableSeekIcon?: boolean;
2273
2284
  }
2274
- /**
2285
+ /** {zh}
2275
2286
  * @brief 播放器中间切换暂停/播放的按钮。
2276
2287
  */
2288
+ /** {en}
2289
+ * @brief The center play/pause button.
2290
+ */
2277
2291
  export interface IStartConfig {
2278
- /**
2292
+ /** {zh}
2279
2293
  * @brief 暂停是否常驻
2280
2294
  * @default true
2281
2295
  */
2296
+ /** {en}
2297
+ * @brief Whether to keep the pause button visible.
2298
+ * @default true
2299
+ */
2282
2300
  isShowPause?: boolean;
2283
- /**
2301
+ /** {zh}
2284
2302
  * @brief 是否播放结束常驻
2285
2303
  * @default false
2286
2304
  */
2305
+ /** {en}
2306
+ * @brief Whether to keep the end button visible.
2307
+ * @default false
2308
+ */
2287
2309
  isShowEnd?: boolean;
2288
- /**
2310
+ /** {zh}
2289
2311
  * @brief 是否禁用点击动画
2290
2312
  * @default pc:true,mobile:false
2291
2313
  */
2314
+ /** {en}
2315
+ * @brief Whether to disable the click animation.
2316
+ * @default pc: true, mobile: false
2317
+ */
2292
2318
  disableAnimate?: boolean;
2293
- /**
2319
+ /** {zh}
2294
2320
  * @brief 按钮的跟随模式
2295
2321
  * - hide:起播之后隐藏
2296
2322
  * - show:常驻一直存在
2297
2323
  * - auto:自动跟随,播放器激活时即player.isActive=true的时候显示,否则隐藏
2298
2324
  * @default hide
2299
2325
  */
2326
+ /** {en}
2327
+ * @brief The following modes are supported:
2328
+ * - hide: hidden after playback starts
2329
+ * - show: always visible
2330
+ * - auto: automatically follows, visible when player.isActive=true
2331
+ * @default hide
2332
+ */
2300
2333
  mode?: "hide" | "show" | "auto";
2301
2334
  }
2302
2335
  /**
@@ -2304,7 +2337,7 @@ export interface IStartConfig {
2304
2337
  * @brief 西瓜插件
2305
2338
  */
2306
2339
  export declare type XGPlugin = typeof Plugin | typeof BasePlugin;
2307
- /**
2340
+ /** {zh}
2308
2341
  * @brief 自动播放配置。
2309
2342
  * @list Options
2310
2343
  * @kind property
@@ -2319,7 +2352,7 @@ export interface IAutoplayPluginConfig {
2319
2352
  * @hidden
2320
2353
  */
2321
2354
  position?: string;
2322
- /**
2355
+ /** {zh}
2323
2356
  * @brief 是否开启降级静音自动播放。开启后,如果当前浏览器环境不支持有声音自动播放,则降级为静音自动播放。
2324
2357
  * @default false
2325
2358
  */
@@ -2328,7 +2361,7 @@ export interface IAutoplayPluginConfig {
2328
2361
  * @default false
2329
2362
  */
2330
2363
  enableDegradeMuteAutoplay?: boolean;
2331
- /**
2364
+ /** {zh}
2332
2365
  * @brief 启用微信jsBridge方式的自动播放
2333
2366
  * @default false
2334
2367
  * @hidden
@@ -2340,7 +2373,7 @@ export interface IAutoplayPluginConfig {
2340
2373
  * @hidden
2341
2374
  */
2342
2375
  enableWxJsBridgeAutoplay?: boolean;
2343
- /**
2376
+ /** {zh}
2344
2377
  * @brief 用户触发自动播放的目标 dom。
2345
2378
  * @default window.document.body
2346
2379
  */
@@ -2390,7 +2423,7 @@ declare class PlayList {
2390
2423
  setStyle(style: any): void;
2391
2424
  destroy(): void;
2392
2425
  }
2393
- /**
2426
+ /** {zh}
2394
2427
  * @brief 播放列表展示面板触发动作类型。
2395
2428
  */
2396
2429
  /** {en}
@@ -2511,6 +2544,7 @@ declare enum EPlayMode {
2511
2544
  */
2512
2545
  /** {en}
2513
2546
  * @list Options
2547
+ * @brief Playlist plugin configuration.
2514
2548
  * @kind property
2515
2549
  */
2516
2550
  export interface IPlayListConfig {
@@ -2742,7 +2776,7 @@ export interface IWatermarkConfig {
2742
2776
  * @default 12
2743
2777
  */
2744
2778
  /** {en}
2745
- * @brief Watermark font size. When the type is `number`, the unit is px. When the type is `string`, the unit needs to be携带.
2779
+ * @brief Watermark font size. When the type is `number`, the unit is px. When the type is `string`, the unit needs to be included.
2746
2780
  * @default 12
2747
2781
  */
2748
2782
  fontSize?: number | string;
@@ -3395,6 +3429,7 @@ export interface IABCycle {
3395
3429
  */
3396
3430
  /** {en}
3397
3431
  * @list Options
3432
+ * @brief Music playback mode configuration.
3398
3433
  * @kind property
3399
3434
  */
3400
3435
  export interface IMusicConfig {
@@ -6029,7 +6064,7 @@ declare class AuthToken extends SdkPlugin {
6029
6064
  getDrmConfig(videoInfo: IVideoInfo): void;
6030
6065
  init(): void;
6031
6066
  initConfig(getVideoByToken: IPlayAuthTokenConfig): void;
6032
- /**
6067
+ /** {zh}
6033
6068
  * @description 更新playAuthToken
6034
6069
  * @param {IPlayAuthTokenConfig} getVideoByToken token信息
6035
6070
  * @param {boolean} isNewVideo 是否新视频,即是否为切换视频
@@ -6973,11 +7008,16 @@ declare class VePlayer {
6973
7008
  * @hidden
6974
7009
  */
6975
7010
  static veStrategy: typeof VeStrategy;
6976
- /**
7011
+ /** {zh}
6977
7012
  * @brief SDK 版本
6978
7013
  * @type {*}
6979
7014
  * @memberof VePlayer
6980
7015
  */
7016
+ /** {en}
7017
+ * @brief SDK version
7018
+ * @type {*}
7019
+ * @memberof VePlayer
7020
+ */
6981
7021
  static sdkVersion: string;
6982
7022
  /**
6983
7023
  * @hidden
@@ -7359,10 +7399,14 @@ declare class VePlayer {
7359
7399
  * @private
7360
7400
  */
7361
7401
  private _onMediaExpiredAction;
7362
- /**
7402
+ /** {zh}
7363
7403
  * @brief 更新播放源。您可在视频播放地址过期前调用此方法更新地址及过期时间戳。
7364
7404
  * @param source 播放源配置。详见 [SourceConfig](1248901#sourceconfig)。支持传入视频播放地址 `url`、播放列表 `playList` 或者 `vid` 和 `playAuthToken`,还需包含新地址的过期时间戳 `urlExpireTimestamp`。
7365
7405
  */
7406
+ /** {en}
7407
+ * @brief Update the media source. You can call this method to update the address and expiration timestamp before the video playback address expires.
7408
+ * @param source The media source configuration. See SourceConfig. Supports passing video playback address `url`, playback list `playList`, or `vid` and `playAuthToken`, and also includes the expiration timestamp `urlExpireTimestamp` of the new address.
7409
+ */
7366
7410
  updateMediaSource(source: SourceConfig): Promise<void>;
7367
7411
  /** {zh}
7368
7412
  * @hidden
@@ -7613,6 +7657,8 @@ declare class VePlayer {
7613
7657
  * @notes 每项包含 `id`、`name`、`lang`、`channels`、`default`、`selected` 字段;轨道数量 ≤ 1 时返回空数组。
7614
7658
  */
7615
7659
  /** {en}
7660
+ * @brief Get the audio track list. For HLS, tracks come from hls.js; on iOS native playback, from `HTMLMediaElement.audioTracks`.
7661
+ * @notes Each item includes `id`, `name`, `lang`, `channels`, `default`, and `selected`. Returns an empty array when there is at most one track.
7616
7662
  */
7617
7663
  getAudioTracks(): AudioTrackInfo[];
7618
7664
  /** {zh}
@@ -7620,18 +7666,20 @@ declare class VePlayer {
7620
7666
  * @notes HLS 流通过 hls.js 获取,iOS 原生播放通过 HTMLMediaElement.audioTracks 获取;无激活轨道时返回 null。
7621
7667
  */
7622
7668
  /** {en}
7669
+ * @brief Get the currently active audio track.
7670
+ * @notes For HLS, from hls.js; on iOS native playback, from `HTMLMediaElement.audioTracks`. Returns `null` when no track is active.
7623
7671
  */
7624
7672
  getCurrentAudioTrack(): AudioTrackInfo | null;
7625
7673
  /** {zh}
7626
7674
  * @brief 切换音频轨道。
7627
- * @param id 目标轨道的 id,可通过 `getAudioTracks()` 获取。
7628
- * @param lang 目标轨道的语言代码(BCP-47)。若提供,则 id 与 lang 同时匹配时才执行切换,
7629
- * 可用于 iOS 原生 audioTracks 中存在重复 id 的场景。
7675
+ * @param track 目标音轨对象,可通过 `getAudioTracks()` 获取。
7630
7676
  * @notes 切换完成后会触发 `Events.AUDIO_TRACK_CHANGE` 事件;
7631
7677
  * 同时 PC 端和移动端音频轨道插件的选中状态会自动更新。
7632
7678
  */
7633
7679
  /** {en}
7634
7680
  * @brief Switch audio track.
7681
+ * @param track Target audio track object from `getAudioTracks()`.
7682
+ * @notes Emits `Events.AUDIO_TRACK_CHANGE` when done. PC and mobile audio track plugins update selection automatically.
7635
7683
  */
7636
7684
  switchAudioTrack(track: AudioTrackInfo): void;
7637
7685
  /** {zh}