@volcengine/veplayer 1.15.3-rc.13 → 1.15.3-rc.15
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/index.d.ts +196 -0
- package/index.min.js +2 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -4148,6 +4148,174 @@ export interface ApiMapConfig {
|
|
|
4148
4148
|
playDomain: string;
|
|
4149
4149
|
backupPlayDomain?: string;
|
|
4150
4150
|
}
|
|
4151
|
+
/**
|
|
4152
|
+
* @list Options
|
|
4153
|
+
* @brief 字幕项。
|
|
4154
|
+
* @kind property
|
|
4155
|
+
*/
|
|
4156
|
+
/** {en}
|
|
4157
|
+
* @brief 字幕项配置
|
|
4158
|
+
*/
|
|
4159
|
+
export interface ISubTitleItem {
|
|
4160
|
+
/**
|
|
4161
|
+
* @brief 字幕语言。
|
|
4162
|
+
* @default -
|
|
4163
|
+
*/
|
|
4164
|
+
/** {en}
|
|
4165
|
+
* @brief 字幕语言
|
|
4166
|
+
*/
|
|
4167
|
+
language?: string | number;
|
|
4168
|
+
/**
|
|
4169
|
+
* @brief 字幕 ID。
|
|
4170
|
+
* @default -
|
|
4171
|
+
*/
|
|
4172
|
+
/** {en}
|
|
4173
|
+
* @brief 字幕id
|
|
4174
|
+
*/
|
|
4175
|
+
id?: number | string;
|
|
4176
|
+
/**
|
|
4177
|
+
* @brief 是否为默认选择的字幕。
|
|
4178
|
+
* @default false
|
|
4179
|
+
*/
|
|
4180
|
+
/** {en}
|
|
4181
|
+
* @brief 是否是默认选择的字幕
|
|
4182
|
+
*/
|
|
4183
|
+
isDefault?: boolean;
|
|
4184
|
+
/**
|
|
4185
|
+
* @brief 字幕名称。
|
|
4186
|
+
* @default -
|
|
4187
|
+
*/
|
|
4188
|
+
/** {en}
|
|
4189
|
+
* @brief 字幕名称
|
|
4190
|
+
*/
|
|
4191
|
+
text?: string;
|
|
4192
|
+
/**
|
|
4193
|
+
* @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
|
|
4194
|
+
* @default -
|
|
4195
|
+
*/
|
|
4196
|
+
label?: string | number;
|
|
4197
|
+
/**
|
|
4198
|
+
* @brief 外挂字幕 URL 地址。
|
|
4199
|
+
* @default -
|
|
4200
|
+
*/
|
|
4201
|
+
/** {en}
|
|
4202
|
+
* @brief 外挂字幕地址
|
|
4203
|
+
*/
|
|
4204
|
+
url?: string;
|
|
4205
|
+
/**
|
|
4206
|
+
* stringContent
|
|
4207
|
+
* @default 无
|
|
4208
|
+
* @hidden
|
|
4209
|
+
* @type {string}
|
|
4210
|
+
* @memberof ISubTitleItem
|
|
4211
|
+
*/
|
|
4212
|
+
stringContent?: string;
|
|
4213
|
+
/**
|
|
4214
|
+
* 字幕内容列表,非url形式时使用
|
|
4215
|
+
* @default 无
|
|
4216
|
+
* @type {Array<Object>}
|
|
4217
|
+
* @memberof ISubTitleItem
|
|
4218
|
+
* @brief 字幕内容列表。非 `url` 形式时使用。
|
|
4219
|
+
*/
|
|
4220
|
+
/** {en}
|
|
4221
|
+
* @brief 字幕内容列表,非url形式时使用
|
|
4222
|
+
*/
|
|
4223
|
+
list?: IListItem[];
|
|
4224
|
+
}
|
|
4225
|
+
/**
|
|
4226
|
+
* @brief 字幕内容项。
|
|
4227
|
+
* @list Options
|
|
4228
|
+
* @kind property
|
|
4229
|
+
* @export
|
|
4230
|
+
* @interface IListItem
|
|
4231
|
+
*/
|
|
4232
|
+
/** {en}
|
|
4233
|
+
* @brief 字幕内容项配置
|
|
4234
|
+
*/
|
|
4235
|
+
export interface IListItem {
|
|
4236
|
+
/**
|
|
4237
|
+
* 开始时间
|
|
4238
|
+
* @type {number}
|
|
4239
|
+
* @brief 开始时间,单位为秒。
|
|
4240
|
+
*/
|
|
4241
|
+
/** {en}
|
|
4242
|
+
* @brief 开始时间
|
|
4243
|
+
*/
|
|
4244
|
+
start: number;
|
|
4245
|
+
/**
|
|
4246
|
+
* 结束时间
|
|
4247
|
+
* @type {number}
|
|
4248
|
+
* @brief 结束时间,单位为秒。
|
|
4249
|
+
*/
|
|
4250
|
+
/** {en}
|
|
4251
|
+
* @brief 结束时间
|
|
4252
|
+
*/
|
|
4253
|
+
end: number;
|
|
4254
|
+
/**
|
|
4255
|
+
* 字幕数据列表
|
|
4256
|
+
* @type {Array<ITextItem>}
|
|
4257
|
+
* @brief 字幕数据列表。
|
|
4258
|
+
*/
|
|
4259
|
+
/** {en}
|
|
4260
|
+
* @brief 字幕数据列表
|
|
4261
|
+
*/
|
|
4262
|
+
list: Array<ITextItem>;
|
|
4263
|
+
/**
|
|
4264
|
+
* @default 无
|
|
4265
|
+
* @hidden
|
|
4266
|
+
* @type {any}
|
|
4267
|
+
*/
|
|
4268
|
+
[propName: string]: any;
|
|
4269
|
+
}
|
|
4270
|
+
/**
|
|
4271
|
+
* @breif 字幕文案配置
|
|
4272
|
+
* @list Options
|
|
4273
|
+
* @kind property
|
|
4274
|
+
*/
|
|
4275
|
+
export interface ITextItem {
|
|
4276
|
+
/**
|
|
4277
|
+
* @default 无
|
|
4278
|
+
* @hidden
|
|
4279
|
+
* @type {any}
|
|
4280
|
+
*/
|
|
4281
|
+
[propName: string]: any;
|
|
4282
|
+
/**
|
|
4283
|
+
* 开始时间
|
|
4284
|
+
* @type {number}
|
|
4285
|
+
* @brief 开始时间,单位为秒。
|
|
4286
|
+
*/
|
|
4287
|
+
/** {en}
|
|
4288
|
+
* @brief 开始时间
|
|
4289
|
+
*/
|
|
4290
|
+
start: number;
|
|
4291
|
+
/**
|
|
4292
|
+
* 结束时间
|
|
4293
|
+
* @type {number}
|
|
4294
|
+
* @brief 结束时间,单位为秒。
|
|
4295
|
+
*/
|
|
4296
|
+
/** {en}
|
|
4297
|
+
* @brief 结束时间
|
|
4298
|
+
*/
|
|
4299
|
+
end: number;
|
|
4300
|
+
/**
|
|
4301
|
+
* 字幕文案数组
|
|
4302
|
+
* @type {string[]}
|
|
4303
|
+
* @brief 字幕文案数组。
|
|
4304
|
+
*/
|
|
4305
|
+
/** {en}
|
|
4306
|
+
* @brief 字幕文案数组
|
|
4307
|
+
*/
|
|
4308
|
+
text: string[];
|
|
4309
|
+
/**
|
|
4310
|
+
* 字幕顺序
|
|
4311
|
+
* @type {number}
|
|
4312
|
+
* @brief 字幕顺序。
|
|
4313
|
+
*/
|
|
4314
|
+
/** {en}
|
|
4315
|
+
* @brief 字幕顺序
|
|
4316
|
+
*/
|
|
4317
|
+
index?: number;
|
|
4318
|
+
}
|
|
4151
4319
|
export type TLogChannel = "cn" | "va" | "sg";
|
|
4152
4320
|
declare enum PreloadScene {
|
|
4153
4321
|
/**
|
|
@@ -4586,6 +4754,8 @@ export declare type UMDMap = Record<UmdKeys, {
|
|
|
4586
4754
|
declare class UMDLoader {
|
|
4587
4755
|
private static jsLoadMap;
|
|
4588
4756
|
private static jsLoadPromiseMap;
|
|
4757
|
+
/** 清除指定插件的加载缓存,使下次 loadPlugins 重新触发加载(用于修复首次加载失败的情况) */
|
|
4758
|
+
clearPluginCache(pluginName: UmdKeys): void;
|
|
4589
4759
|
umdMap: UMDMap;
|
|
4590
4760
|
backupUmdUrlMap: Record<string, string>;
|
|
4591
4761
|
failCallback: (umdName: string, err: any) => any;
|
|
@@ -6050,6 +6220,32 @@ declare class VePlayer {
|
|
|
6050
6220
|
* @param pluginName 插件名。
|
|
6051
6221
|
*/
|
|
6052
6222
|
getPlugin(pluginName: string): null | BasePlugin;
|
|
6223
|
+
/** {zh}
|
|
6224
|
+
* @brief 获取字幕列表。需配置 `Subtitle` 插件后调用。
|
|
6225
|
+
* @return 当前字幕列表,每项包含 `id`、`language`、`text`(显示名称)等字段。列表为空时返回空数组。
|
|
6226
|
+
* @memberof VePlayer
|
|
6227
|
+
*/
|
|
6228
|
+
getSubtitleList(): ISubTitleItem[];
|
|
6229
|
+
/** {zh}
|
|
6230
|
+
* @brief 切换字幕。需配置 `Subtitle` 插件后调用。
|
|
6231
|
+
* @param subtitle 目标字幕的 id 或 language,任意一个非空即可定位字幕项。
|
|
6232
|
+
* @return 切换成功时 resolve,失败(未找到、切换被中止)时 reject。
|
|
6233
|
+
* @memberof VePlayer
|
|
6234
|
+
*/
|
|
6235
|
+
switchSubtitle(subtitle: {
|
|
6236
|
+
id?: string | number;
|
|
6237
|
+
language?: string | number;
|
|
6238
|
+
}): Promise<void>;
|
|
6239
|
+
/** {zh}
|
|
6240
|
+
* @brief 开启字幕展示。恢复上次选中的字幕项;若从未选中过则默认选第一项。需配置 `Subtitle` 插件后调用。
|
|
6241
|
+
* @memberof VePlayer
|
|
6242
|
+
*/
|
|
6243
|
+
showSubtitle(): void;
|
|
6244
|
+
/** {zh}
|
|
6245
|
+
* @brief 关闭字幕展示。字幕数据保留,可通过 `showSubtitle` 重新开启。需配置 `Subtitle` 插件后调用。
|
|
6246
|
+
* @memberof VePlayer
|
|
6247
|
+
*/
|
|
6248
|
+
hideSubtitle(): void;
|
|
6053
6249
|
/** {zh}
|
|
6054
6250
|
* @memberof VePlayer
|
|
6055
6251
|
* @brief 销毁当前播放器实例。
|