@volcengine/veplayer 1.3.4 → 1.5.8
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/CHANGELOG.md +408 -13664
- package/dist/index.d.ts +469 -189
- package/dist/index.min.css +1 -1
- package/dist/index.min.js +2 -1
- package/package.json +37 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Property } from 'dom-helpers/esm/types';
|
|
2
|
-
import
|
|
2
|
+
import Player from 'xgplayer';
|
|
3
|
+
import { I18N, IPlayerOptions, IXGI18nText, Plugin } from 'xgplayer';
|
|
3
4
|
|
|
4
5
|
declare enum POSITIONS {
|
|
5
6
|
ROOT = "root",
|
|
@@ -330,6 +331,27 @@ export interface ISubtitleConfig {
|
|
|
330
331
|
* @memberof ISubtitleConfig
|
|
331
332
|
*/
|
|
332
333
|
isDefaultOpen?: boolean;
|
|
334
|
+
/**
|
|
335
|
+
* 是否显示图标
|
|
336
|
+
* 默认值:true
|
|
337
|
+
* @type {boolean}
|
|
338
|
+
* @memberof ISubtitleConfig
|
|
339
|
+
*/
|
|
340
|
+
isShowIcon?: boolean;
|
|
341
|
+
/**
|
|
342
|
+
* 字幕渲染模式,外挂字幕或原生字幕
|
|
343
|
+
* 默认值:external
|
|
344
|
+
* @type {string}
|
|
345
|
+
* @memberof ISubtitleConfig
|
|
346
|
+
*/
|
|
347
|
+
mode?: "external" | "native";
|
|
348
|
+
/**
|
|
349
|
+
* 字幕更新模式,默认vod
|
|
350
|
+
* 默认值:vod
|
|
351
|
+
* @type {string}
|
|
352
|
+
* @memberof ISubtitleConfig
|
|
353
|
+
*/
|
|
354
|
+
updateMode?: "vod" | "live";
|
|
333
355
|
/**
|
|
334
356
|
* 字幕样式
|
|
335
357
|
* 默认值:无
|
|
@@ -609,6 +631,12 @@ export interface IDefinitionDemotePlugin {
|
|
|
609
631
|
*/
|
|
610
632
|
demotePriority?: string[];
|
|
611
633
|
}
|
|
634
|
+
/**
|
|
635
|
+
* @detail Options
|
|
636
|
+
* @brief 更多options
|
|
637
|
+
* @id 2
|
|
638
|
+
*
|
|
639
|
+
|
|
612
640
|
/**
|
|
613
641
|
* dash播放配置想
|
|
614
642
|
*
|
|
@@ -943,10 +971,114 @@ export interface IMp4EncryptPlayerConfig {
|
|
|
943
971
|
};
|
|
944
972
|
};
|
|
945
973
|
}
|
|
974
|
+
declare enum PlatformEnum {
|
|
975
|
+
VOLC_ENGINE = "volcengine",
|
|
976
|
+
BYTE_PLUS = "byteplus"
|
|
977
|
+
}
|
|
978
|
+
export interface apiMapItem {
|
|
979
|
+
playDomain: string;
|
|
980
|
+
backupPlayDomain?: string;
|
|
981
|
+
licenseUrl: string;
|
|
982
|
+
keyDomain: string;
|
|
983
|
+
}
|
|
946
984
|
declare enum CodecType {
|
|
947
985
|
H265 = "h265",
|
|
948
986
|
H264 = "h264"
|
|
949
987
|
}
|
|
988
|
+
export declare type PLAY_MODE_TYPE = "order" | "sloop" | "loop" | "random";
|
|
989
|
+
export interface IMusicListItem {
|
|
990
|
+
/**
|
|
991
|
+
* 音乐地址
|
|
992
|
+
*
|
|
993
|
+
* @type {string}
|
|
994
|
+
* @memberof IMusicListItem
|
|
995
|
+
*/
|
|
996
|
+
src: string;
|
|
997
|
+
/**
|
|
998
|
+
* 音乐唯一vid
|
|
999
|
+
*
|
|
1000
|
+
* @type {string | number}
|
|
1001
|
+
* @memberof IMusicListItem
|
|
1002
|
+
*/
|
|
1003
|
+
vid: string | number;
|
|
1004
|
+
/**
|
|
1005
|
+
* 音乐封面
|
|
1006
|
+
*
|
|
1007
|
+
* @type {string}
|
|
1008
|
+
* @memberof IMusicListItem
|
|
1009
|
+
*/
|
|
1010
|
+
poster?: string;
|
|
1011
|
+
/**
|
|
1012
|
+
* 音乐标题
|
|
1013
|
+
*
|
|
1014
|
+
* @type {string}
|
|
1015
|
+
* @memberof IMusicListItem
|
|
1016
|
+
*/
|
|
1017
|
+
title?: string;
|
|
1018
|
+
[propName: string]: any;
|
|
1019
|
+
}
|
|
1020
|
+
export interface IABCycle {
|
|
1021
|
+
/**
|
|
1022
|
+
* AB循环段开始时间
|
|
1023
|
+
*
|
|
1024
|
+
* @type {boolean}
|
|
1025
|
+
* @memberof IABCycle
|
|
1026
|
+
*/
|
|
1027
|
+
start: number;
|
|
1028
|
+
/**
|
|
1029
|
+
* AB循环段结束时间
|
|
1030
|
+
*
|
|
1031
|
+
* @type {boolean}
|
|
1032
|
+
* @memberof IABCycle
|
|
1033
|
+
*/
|
|
1034
|
+
end: number;
|
|
1035
|
+
/**
|
|
1036
|
+
* AB段是否循环播放
|
|
1037
|
+
*
|
|
1038
|
+
* @type {boolean}
|
|
1039
|
+
* @memberof IABCycle
|
|
1040
|
+
*/
|
|
1041
|
+
loop?: boolean;
|
|
1042
|
+
[propName: string]: any;
|
|
1043
|
+
}
|
|
1044
|
+
export interface IMusicConfig {
|
|
1045
|
+
/**
|
|
1046
|
+
* 是否启用离线下载播放
|
|
1047
|
+
*
|
|
1048
|
+
* @type {boolean}
|
|
1049
|
+
* @memberof IMusicConfig
|
|
1050
|
+
*/
|
|
1051
|
+
offline?: boolean;
|
|
1052
|
+
/**
|
|
1053
|
+
* AB循环设置
|
|
1054
|
+
*
|
|
1055
|
+
* @type {IABCycle}
|
|
1056
|
+
* @memberof IMusicConfig
|
|
1057
|
+
*/
|
|
1058
|
+
abCycle?: IABCycle | null;
|
|
1059
|
+
/**
|
|
1060
|
+
* 快进快退时间跨度
|
|
1061
|
+
*
|
|
1062
|
+
* @type {number}
|
|
1063
|
+
* @memberof IMusicConfig
|
|
1064
|
+
*/
|
|
1065
|
+
timeScale?: number;
|
|
1066
|
+
/**
|
|
1067
|
+
* 循环模式
|
|
1068
|
+
*
|
|
1069
|
+
* @type {('order' | 'sloop' | 'loop' | 'random')}
|
|
1070
|
+
* @memberof IMusicConfig
|
|
1071
|
+
*/
|
|
1072
|
+
mode?: PLAY_MODE_TYPE;
|
|
1073
|
+
/**
|
|
1074
|
+
* 播放列表
|
|
1075
|
+
*
|
|
1076
|
+
* @type {Array<IMusicListItem>}
|
|
1077
|
+
* @memberof IMusicConfig
|
|
1078
|
+
*/
|
|
1079
|
+
list?: Array<IMusicListItem>;
|
|
1080
|
+
[propName: string]: any;
|
|
1081
|
+
}
|
|
950
1082
|
/**
|
|
951
1083
|
* @detail Options
|
|
952
1084
|
* @brief 播放地址列表, 可配置多线路和多清晰度
|
|
@@ -1045,19 +1177,12 @@ export interface Current {
|
|
|
1045
1177
|
* 本文档是介绍火山引擎直播和点播播放器VePlayer的相关参数和Api。
|
|
1046
1178
|
*/
|
|
1047
1179
|
export interface IPlayerConfig extends IPlayerOptions {
|
|
1048
|
-
/**
|
|
1049
|
-
* “点播”还是“直播”
|
|
1050
|
-
* @hidden
|
|
1051
|
-
* @type {('live' | 'vod')}
|
|
1052
|
-
* @memberof IPlayerConfig
|
|
1053
|
-
*/
|
|
1054
|
-
type: "live" | "vod";
|
|
1055
1180
|
/**
|
|
1056
1181
|
* 是否是直播,默认为false
|
|
1057
1182
|
* @type {boolean}
|
|
1058
1183
|
* @memberof IPlayerConfig
|
|
1059
1184
|
*/
|
|
1060
|
-
isLive
|
|
1185
|
+
isLive?: boolean;
|
|
1061
1186
|
/**
|
|
1062
1187
|
* 播放器容器id,VePlayer将被插入在该容器中
|
|
1063
1188
|
*
|
|
@@ -1074,14 +1199,7 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
1074
1199
|
*/
|
|
1075
1200
|
root?: HTMLElement;
|
|
1076
1201
|
/**
|
|
1077
|
-
*
|
|
1078
|
-
*
|
|
1079
|
-
* @type {IPlayerOptions}
|
|
1080
|
-
* @memberof IPlayerConfig
|
|
1081
|
-
*/
|
|
1082
|
-
options: IPlayerOptions;
|
|
1083
|
-
/**
|
|
1084
|
-
* 播放地址,
|
|
1202
|
+
* 播放地址
|
|
1085
1203
|
* 直播可通过 {@link https://console.volcengine.com/live/main/locationGenerate 视频直播控制台} 生成
|
|
1086
1204
|
*
|
|
1087
1205
|
* @type {string}
|
|
@@ -1092,24 +1210,45 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
1092
1210
|
* 播放地址类型,可以选值为“rtm”/“flv”/“mp4”/“hls”
|
|
1093
1211
|
* @notes 播放地址带后缀的则streamType非必填,否则为必填
|
|
1094
1212
|
*
|
|
1095
|
-
* @type {('
|
|
1213
|
+
* @type {(''mp4' | 'hls' | 'dash' | 'rtm' | 'flv')}
|
|
1096
1214
|
* @memberof IPlayerConfig
|
|
1097
1215
|
*/
|
|
1098
|
-
streamType?: "
|
|
1216
|
+
streamType?: "mp4" | "hls" | "dash" | "rtm" | "flv";
|
|
1217
|
+
/**
|
|
1218
|
+
* 点播服务平台,可选值为'volcengine' 和 'byteplus',默认为'volcengine'即火山引擎视频点播
|
|
1219
|
+
* 设定此参数会指定默认的服务接口
|
|
1220
|
+
* @type {('volcengine' | 'byteplus')}
|
|
1221
|
+
* @memberof playerConfig
|
|
1222
|
+
*/
|
|
1223
|
+
platform?: PlatformEnum;
|
|
1224
|
+
/**
|
|
1225
|
+
* 是否音乐播放器模式
|
|
1226
|
+
*
|
|
1227
|
+
* @type {boolean}
|
|
1228
|
+
* @memberof IPlayerConfig
|
|
1229
|
+
*/
|
|
1230
|
+
isMusic?: boolean;
|
|
1099
1231
|
/**
|
|
1100
1232
|
* 右键是否可用
|
|
1101
1233
|
*
|
|
1102
1234
|
* @type {boolean}
|
|
1103
1235
|
* @memberof IPlayerConfig
|
|
1104
1236
|
*/
|
|
1105
|
-
enableContextmenu
|
|
1237
|
+
enableContextmenu?: boolean;
|
|
1106
1238
|
/**
|
|
1107
1239
|
* 关闭video上的阻止事件传播
|
|
1108
1240
|
*
|
|
1109
1241
|
* @type {boolean}
|
|
1110
1242
|
* @memberof IPlayerConfig
|
|
1111
1243
|
*/
|
|
1112
|
-
closeVideoStopPropagation
|
|
1244
|
+
closeVideoStopPropagation?: boolean;
|
|
1245
|
+
/**
|
|
1246
|
+
* 是否开启hls的MSE模式,仅移动端生效,开启后采用MSE方式播放HLS,默认在移动端使用原生video播放hls
|
|
1247
|
+
*
|
|
1248
|
+
* @type {boolean}
|
|
1249
|
+
* @memberof IPlayerConfig
|
|
1250
|
+
*/
|
|
1251
|
+
enableHlsMSE?: boolean;
|
|
1113
1252
|
/**
|
|
1114
1253
|
* 是否开启mp4的MSE模式,开启后采用MSE方式播放MP4,
|
|
1115
1254
|
* 同时带来精确的seek加载、视频的无缝切换、流量节省等功能
|
|
@@ -1117,7 +1256,7 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
1117
1256
|
* @type {boolean}
|
|
1118
1257
|
* @memberof IPlayerConfig
|
|
1119
1258
|
*/
|
|
1120
|
-
enableMp4MSE
|
|
1259
|
+
enableMp4MSE?: boolean;
|
|
1121
1260
|
/**
|
|
1122
1261
|
* 播放列表
|
|
1123
1262
|
* @notes url和playList必填一个,二者都传入时, url必须在playList中。
|
|
@@ -1144,7 +1283,6 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
1144
1283
|
defaultConfig?: IDefaultConfig;
|
|
1145
1284
|
/**
|
|
1146
1285
|
* 设置多语言词典,可设置每个语言的多语言词典,
|
|
1147
|
-
* TODO: 这里需要补充当前默认的有哪些,还有如何替换和新增多语言
|
|
1148
1286
|
* 例如:
|
|
1149
1287
|
* {
|
|
1150
1288
|
* zh: {
|
|
@@ -1155,11 +1293,11 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
1155
1293
|
* }
|
|
1156
1294
|
* }
|
|
1157
1295
|
*
|
|
1158
|
-
* @type {{ [key: string]:
|
|
1296
|
+
* @type {{ [key: string]: Record<string, any> }}
|
|
1159
1297
|
* @memberof IPlayerConfig
|
|
1160
1298
|
*/
|
|
1161
1299
|
languages?: {
|
|
1162
|
-
[key: string]:
|
|
1300
|
+
[key: string]: Record<string, any>;
|
|
1163
1301
|
};
|
|
1164
1302
|
/**
|
|
1165
1303
|
* @hidden
|
|
@@ -1168,9 +1306,14 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
1168
1306
|
* @memberof IPlayerConfig
|
|
1169
1307
|
*/
|
|
1170
1308
|
isMobile?: boolean;
|
|
1309
|
+
/**
|
|
1310
|
+
* umd依赖备用地址
|
|
1311
|
+
* 用于依赖的CDN发生网络错误时的降级备用地址
|
|
1312
|
+
* 支持的依赖有hls(非加密hls播放)、flv(flv播放)、XGVideo(软解播放)、hlsEncrypt(加密hls播放)、dash(dash播放)、mp4Encrypt(加密np4播放)、danmujs(弹幕)、danmuMask(蒙版弹幕)、subtitle(外挂字幕)
|
|
1313
|
+
*/
|
|
1314
|
+
umdUrlMap?: Record<string, string>;
|
|
1171
1315
|
/**
|
|
1172
1316
|
* 是否启用软解
|
|
1173
|
-
* @notes 关于软解的一些性能说明参考 https://v3.h5player.bytedance.net/en/plugins/extension/xgplayer-livevideo.html#%E8%BD%AF%E8%A7%A3%E6%A8%A1%E5%9D%97-%E7%94%A8%E4%BA%8E%E6%92%AD%E6%94%BE265%E6%B5%81-hls%E3%80%81flv-%E6%88%96h5%E4%B8%8B%E9%98%B2%E5%8A%AB%E6%8C%81%E6%92%AD%E6%94%BEhls%E3%80%81flv%E6%B5%81-%E5%8F%AF%E4%BB%A5%E4%B8%8Exgplayer-hls%E3%80%81xgplayer-flv%E9%85%8D%E5%90%88%E4%BD%BF%E7%94%A8
|
|
1174
1317
|
* 默认: false
|
|
1175
1318
|
*
|
|
1176
1319
|
* @type {boolean}
|
|
@@ -1238,10 +1381,10 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
1238
1381
|
/**
|
|
1239
1382
|
* 弹幕及面板配置,可配置弹幕的一些参数,如弹幕文字大小、透明度、展示区域等,
|
|
1240
1383
|
*
|
|
1241
|
-
* @type {InitConfig}
|
|
1384
|
+
* @type {InitConfig | boolean}
|
|
1242
1385
|
* @memberof IPlayerConfig
|
|
1243
1386
|
*/
|
|
1244
|
-
DanmuPlugin?: InitConfig;
|
|
1387
|
+
DanmuPlugin?: InitConfig | boolean;
|
|
1245
1388
|
/**
|
|
1246
1389
|
* 清晰度自动降级配置
|
|
1247
1390
|
* @notes 需要先引入DefinitionDemotePlugin插件,plugins: [window.VePlayer.DefinitionDemotePlugin]
|
|
@@ -1250,9 +1393,16 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
1250
1393
|
* @memberof IPlayerConfig
|
|
1251
1394
|
*/
|
|
1252
1395
|
DefinitionDemotePlugin?: IDefinitionDemotePlugin;
|
|
1396
|
+
/**
|
|
1397
|
+
* 唯一id,用于私有DRM加密
|
|
1398
|
+
*
|
|
1399
|
+
* @type {string}
|
|
1400
|
+
* @memberof IPlayerConfig
|
|
1401
|
+
*/
|
|
1402
|
+
unionId?: string;
|
|
1253
1403
|
/**
|
|
1254
1404
|
* vid播放配置项
|
|
1255
|
-
* @notes
|
|
1405
|
+
* @notes 需要业务方服务端通过vid生成临时playAuthToken
|
|
1256
1406
|
*
|
|
1257
1407
|
* @type {IPlayAuthTokenConfig}
|
|
1258
1408
|
* @memberof IPlayerConfig
|
|
@@ -1260,28 +1410,28 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
1260
1410
|
getVideoByToken?: IPlayAuthTokenConfig;
|
|
1261
1411
|
/**
|
|
1262
1412
|
* dash 播放配置项
|
|
1263
|
-
* @type {IDashPluginConfig}
|
|
1413
|
+
* @type {Partial<IDashPluginConfig>}
|
|
1264
1414
|
* @memberof IPlayerConfig
|
|
1265
1415
|
*/
|
|
1266
|
-
DASHPlugin?: IDashPluginConfig
|
|
1416
|
+
DASHPlugin?: Partial<IDashPluginConfig>;
|
|
1267
1417
|
/**
|
|
1268
1418
|
* hls 加密播放配置项
|
|
1269
|
-
* @type {IEncryptHlsPluginConfig}
|
|
1419
|
+
* @type {Partial<IEncryptHlsPluginConfig> | boolean}
|
|
1270
1420
|
* @memberof IPlayerConfig
|
|
1271
1421
|
*/
|
|
1272
|
-
EncryptHlsPlugin?: IEncryptHlsPluginConfig;
|
|
1422
|
+
EncryptHlsPlugin?: Partial<IEncryptHlsPluginConfig> | boolean;
|
|
1273
1423
|
/**
|
|
1274
1424
|
* 质量日志配置项
|
|
1275
|
-
* @type {IVodLogOptsConfig}
|
|
1425
|
+
* @type {Partial<IVodLogOptsConfig>}
|
|
1276
1426
|
* @memberof IPlayerConfig
|
|
1277
1427
|
*/
|
|
1278
|
-
vodLogOpts?: IVodLogOptsConfig
|
|
1428
|
+
vodLogOpts?: Partial<IVodLogOptsConfig>;
|
|
1279
1429
|
/**
|
|
1280
1430
|
* mp4加密播放配置项
|
|
1281
|
-
* @type {IMp4EncryptPlayerConfig}
|
|
1431
|
+
* @type {Partial<IMp4EncryptPlayerConfig> | boolean}
|
|
1282
1432
|
* @memberof IPlayerConfig
|
|
1283
1433
|
*/
|
|
1284
|
-
Mp4EncryptPlayer?: IMp4EncryptPlayerConfig;
|
|
1434
|
+
Mp4EncryptPlayer?: Partial<IMp4EncryptPlayerConfig> | boolean;
|
|
1285
1435
|
/**
|
|
1286
1436
|
* 自适应码率配置项
|
|
1287
1437
|
* @type {IAutoBitrateOptsConfig}
|
|
@@ -1299,7 +1449,13 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
1299
1449
|
* @type {IMemoryPlayConfig}
|
|
1300
1450
|
* @memberof IPlayerConfig
|
|
1301
1451
|
*/
|
|
1302
|
-
MemoryPlay?: IMemoryPlayConfig;
|
|
1452
|
+
MemoryPlay?: IMemoryPlayConfig | boolean;
|
|
1453
|
+
/**
|
|
1454
|
+
* 音乐播放器配置项
|
|
1455
|
+
* @type {IMusicConfig}
|
|
1456
|
+
* @memberof IPlayerConfig
|
|
1457
|
+
*/
|
|
1458
|
+
music?: IMusicConfig;
|
|
1303
1459
|
}
|
|
1304
1460
|
/**
|
|
1305
1461
|
* 初始配置
|
|
@@ -1390,23 +1546,29 @@ export interface IPlayAuthTokenConfig {
|
|
|
1390
1546
|
*/
|
|
1391
1547
|
playDomain?: string;
|
|
1392
1548
|
/**
|
|
1393
|
-
*
|
|
1549
|
+
* 是否启用控制台设置的封面图,默认false
|
|
1394
1550
|
* @type {boolean}
|
|
1395
1551
|
* @memberof IPlayAuthTokenConfig
|
|
1396
1552
|
*/
|
|
1397
1553
|
needPoster?: boolean;
|
|
1398
1554
|
/**
|
|
1399
|
-
*
|
|
1555
|
+
* 是否启用控制台设置的雪碧图,默认false
|
|
1400
1556
|
* @type {boolean}
|
|
1401
1557
|
* @memberof IPlayAuthTokenConfig
|
|
1402
1558
|
*/
|
|
1403
1559
|
needThumbs?: boolean;
|
|
1404
1560
|
/**
|
|
1405
|
-
*
|
|
1561
|
+
* 是否启用控制台设置的蒙版弹幕,默认false
|
|
1406
1562
|
* @type {boolean}
|
|
1407
1563
|
* @memberof IPlayAuthTokenConfig
|
|
1408
1564
|
*/
|
|
1409
1565
|
needBarrageMask?: boolean;
|
|
1566
|
+
/**
|
|
1567
|
+
* 是否需要多清晰度,默认为true
|
|
1568
|
+
* @type {boolean}
|
|
1569
|
+
* @memberof IPlayAuthTokenConfig
|
|
1570
|
+
*/
|
|
1571
|
+
needDefinitionList?: boolean;
|
|
1410
1572
|
/**
|
|
1411
1573
|
* hls标准加密播放所用的keyToken
|
|
1412
1574
|
* @type {boolean}
|
|
@@ -1415,18 +1577,31 @@ export interface IPlayAuthTokenConfig {
|
|
|
1415
1577
|
keyToken?: string;
|
|
1416
1578
|
/**
|
|
1417
1579
|
* 密钥请求域名
|
|
1418
|
-
* @hidden
|
|
1419
1580
|
* @type {string}
|
|
1420
1581
|
* @memberof IPlayAuthTokenConfig
|
|
1421
1582
|
*/
|
|
1422
1583
|
keyDomain?: string;
|
|
1423
1584
|
/**
|
|
1424
1585
|
* 获取key方式,默认'TOP'
|
|
1425
|
-
* @hidden
|
|
1426
1586
|
* @type {string}
|
|
1427
1587
|
* @memberof IPlayAuthTokenConfig
|
|
1428
1588
|
*/
|
|
1429
1589
|
getKeyType?: string;
|
|
1590
|
+
/**
|
|
1591
|
+
* 获取privateDrmAuthToken的回调,
|
|
1592
|
+
* @type {(
|
|
1593
|
+
* playAuthIds: string,
|
|
1594
|
+
* vid: string,
|
|
1595
|
+
* unionInfo: string,
|
|
1596
|
+
* ) => Promise<Record<string, string>>}
|
|
1597
|
+
* @memberof IPlayAuthTokenConfig
|
|
1598
|
+
*/
|
|
1599
|
+
getDrmAuthToken?: (playAuthIds: string, vid: string, unionInfo: string) => Promise<string>;
|
|
1600
|
+
/**
|
|
1601
|
+
* 是否禁用DRM解密播放降级,默认false
|
|
1602
|
+
* @type {boolean}
|
|
1603
|
+
*/
|
|
1604
|
+
disDrmDegraded?: boolean;
|
|
1430
1605
|
/**
|
|
1431
1606
|
* 可携带aid等透传参数,如
|
|
1432
1607
|
* {aid: 1234},以playAuthToken下发的参数的优先级最高。
|
|
@@ -1450,8 +1625,8 @@ export interface IPlayAuthTokenConfig {
|
|
|
1450
1625
|
* ``` javascript
|
|
1451
1626
|
* {
|
|
1452
1627
|
* '480p': {
|
|
1453
|
-
* definition: 'hd',
|
|
1454
|
-
* definitionTextKey: 'HD'
|
|
1628
|
+
* definition: 'hd', // 清晰度兜底文案
|
|
1629
|
+
* definitionTextKey: 'HD' // 多语言文案key
|
|
1455
1630
|
* },
|
|
1456
1631
|
* '720p': {
|
|
1457
1632
|
* definition: 'uhd',
|
|
@@ -1464,6 +1639,12 @@ export interface IPlayAuthTokenConfig {
|
|
|
1464
1639
|
* @memberof IPlayAuthTokenConfig
|
|
1465
1640
|
*/
|
|
1466
1641
|
definitionMap?: Record<string, string | definitionItem>;
|
|
1642
|
+
/**
|
|
1643
|
+
* 服务502错误时重试次数,默认为1
|
|
1644
|
+
* @type {number}
|
|
1645
|
+
* @memberof IPlayAuthTokenConfig
|
|
1646
|
+
*/
|
|
1647
|
+
retryCount?: number;
|
|
1467
1648
|
}
|
|
1468
1649
|
/**
|
|
1469
1650
|
* 清晰度定义
|
|
@@ -1592,6 +1773,11 @@ declare class PlayerData {
|
|
|
1592
1773
|
expireDetectType: Array<"xhrStatus" | "urlExpire" | "getUrlTime">;
|
|
1593
1774
|
onMediaExpired: () => Promise<IPlayerConfig>;
|
|
1594
1775
|
onTokenExpired: () => Promise<IPlayAuthTokenConfig>;
|
|
1776
|
+
platform: PlatformEnum;
|
|
1777
|
+
apiMap: apiMapItem;
|
|
1778
|
+
unionId?: string;
|
|
1779
|
+
unionInfo?: string;
|
|
1780
|
+
isMusic?: boolean;
|
|
1595
1781
|
constructor(configs: IPlayerConfig);
|
|
1596
1782
|
initPlayData(configs: any): void;
|
|
1597
1783
|
initPlaylistAndGetCurrent(configs: IPlayerConfig): any;
|
|
@@ -1639,6 +1825,38 @@ declare class PlayerData {
|
|
|
1639
1825
|
*/
|
|
1640
1826
|
getNextDefinition(isDown: boolean, demotePriority: any): Stream[];
|
|
1641
1827
|
}
|
|
1828
|
+
declare function isMSESupport(mime?: string): boolean;
|
|
1829
|
+
export interface IConfig {
|
|
1830
|
+
mode?: number;
|
|
1831
|
+
isAutoChange?: boolean;
|
|
1832
|
+
}
|
|
1833
|
+
declare class MobilePlayerPanel {
|
|
1834
|
+
config: IConfig;
|
|
1835
|
+
parent: HTMLElement;
|
|
1836
|
+
root: any;
|
|
1837
|
+
mode: number;
|
|
1838
|
+
isAutoChange: number;
|
|
1839
|
+
player: any;
|
|
1840
|
+
children: HTMLElement | undefined;
|
|
1841
|
+
container: HTMLElement | undefined;
|
|
1842
|
+
title: HTMLElement | undefined;
|
|
1843
|
+
isShow: boolean;
|
|
1844
|
+
constructor(args: any);
|
|
1845
|
+
initEvents(): void;
|
|
1846
|
+
handleOrientationChange(): void;
|
|
1847
|
+
changeConfig(config: IConfig): void;
|
|
1848
|
+
changeMode(mode: number): void;
|
|
1849
|
+
renderPanel(): void;
|
|
1850
|
+
showPanel(children: HTMLElement, title?: string, isItemList?: boolean): Promise<void>;
|
|
1851
|
+
updatePanel(children: HTMLElement): void;
|
|
1852
|
+
setTitle(title: any): void;
|
|
1853
|
+
renderTitle(title: any): HTMLElement;
|
|
1854
|
+
show(): void;
|
|
1855
|
+
hide(): void;
|
|
1856
|
+
handleHide(e: any): void;
|
|
1857
|
+
bind(event: string, eventHandle: any, isBubble?: boolean): void;
|
|
1858
|
+
destroy(): void;
|
|
1859
|
+
}
|
|
1642
1860
|
declare class VePlayer {
|
|
1643
1861
|
/**
|
|
1644
1862
|
* 播放相关配置数据
|
|
@@ -1649,12 +1867,18 @@ declare class VePlayer {
|
|
|
1649
1867
|
*/
|
|
1650
1868
|
playerData: PlayerData;
|
|
1651
1869
|
/**
|
|
1652
|
-
*
|
|
1653
|
-
* @hidden
|
|
1870
|
+
* 播放器内核实例
|
|
1654
1871
|
* @type {*}
|
|
1655
1872
|
* @memberof VePlayer
|
|
1656
1873
|
*/
|
|
1657
|
-
player:
|
|
1874
|
+
player: Player & {
|
|
1875
|
+
changePluginsIcon?: (name: any, isShow: any) => void;
|
|
1876
|
+
playerData?: PlayerData;
|
|
1877
|
+
playerType?: string;
|
|
1878
|
+
playerVersion?: string;
|
|
1879
|
+
panel?: MobilePlayerPanel;
|
|
1880
|
+
emitExpireTimestamp?: number;
|
|
1881
|
+
};
|
|
1658
1882
|
/**
|
|
1659
1883
|
* @hidden
|
|
1660
1884
|
*
|
|
@@ -1738,8 +1962,18 @@ declare class VePlayer {
|
|
|
1738
1962
|
* @type {*}
|
|
1739
1963
|
* @memberof VePlayer
|
|
1740
1964
|
*/
|
|
1741
|
-
|
|
1965
|
+
delayError: any[];
|
|
1742
1966
|
private isFirstEmitted;
|
|
1967
|
+
/**
|
|
1968
|
+
* @hidden
|
|
1969
|
+
* umd加载器
|
|
1970
|
+
* @type {*}
|
|
1971
|
+
* @memberof VePlayer
|
|
1972
|
+
*/
|
|
1973
|
+
private sdkUmdLoader;
|
|
1974
|
+
static isMSESupported: typeof isMSESupport;
|
|
1975
|
+
static isRTMSupported: typeof import("@byted/xgplayer-rts").RtsPlugin.isSupported;
|
|
1976
|
+
static playerVersion: string;
|
|
1743
1977
|
constructor(configs: IPlayerConfig);
|
|
1744
1978
|
/**
|
|
1745
1979
|
*
|
|
@@ -1761,6 +1995,18 @@ declare class VePlayer {
|
|
|
1761
1995
|
* @memberof VePlayer
|
|
1762
1996
|
*/
|
|
1763
1997
|
initCheckExpire(): void;
|
|
1998
|
+
/**
|
|
1999
|
+
* @hidden
|
|
2000
|
+
* @description 更新umd的备用地址
|
|
2001
|
+
* @memberof VePlayer
|
|
2002
|
+
*/
|
|
2003
|
+
private initUmdLoader;
|
|
2004
|
+
/**
|
|
2005
|
+
* @hidden
|
|
2006
|
+
* @description umd 加载失败的回调
|
|
2007
|
+
* @memberof VePlayer
|
|
2008
|
+
*/
|
|
2009
|
+
umdLoadErr(umdName: any, err: any): void;
|
|
1764
2010
|
/**
|
|
1765
2011
|
* @hidden
|
|
1766
2012
|
* @description 循环执行过期检测
|
|
@@ -1830,16 +2076,22 @@ declare class VePlayer {
|
|
|
1830
2076
|
* @return {*}
|
|
1831
2077
|
* @memberof VePlayer
|
|
1832
2078
|
*/
|
|
1833
|
-
createPlayer(): Promise<
|
|
2079
|
+
createPlayer(): Promise<Player & {
|
|
2080
|
+
changePluginsIcon?: (name: any, isShow: any) => void;
|
|
2081
|
+
playerData?: PlayerData;
|
|
2082
|
+
playerType?: string;
|
|
2083
|
+
playerVersion?: string;
|
|
2084
|
+
panel?: MobilePlayerPanel;
|
|
2085
|
+
emitExpireTimestamp?: number;
|
|
2086
|
+
}>;
|
|
1834
2087
|
/**
|
|
1835
2088
|
* @hidden
|
|
1836
2089
|
*
|
|
1837
2090
|
* @param {*} finalOptions
|
|
1838
|
-
* @param {IEncryptHlsPluginConfig} encryptHlsPluginConfig
|
|
1839
2091
|
* @return {*}
|
|
1840
2092
|
* @memberof VePlayer
|
|
1841
2093
|
*/
|
|
1842
|
-
|
|
2094
|
+
setPluginConfig(finalOptions: IPlayerConfig): void;
|
|
1843
2095
|
/**
|
|
1844
2096
|
* @hidden
|
|
1845
2097
|
*
|
|
@@ -1862,7 +2114,7 @@ declare class VePlayer {
|
|
|
1862
2114
|
* @memberof VePlayer
|
|
1863
2115
|
*/
|
|
1864
2116
|
getCurrentPlayerConfig(): {
|
|
1865
|
-
type?: "
|
|
2117
|
+
type?: "vod" | "live";
|
|
1866
2118
|
isLive?: boolean;
|
|
1867
2119
|
lineId?: string | number;
|
|
1868
2120
|
definition?: string;
|
|
@@ -1901,7 +2153,7 @@ declare class VePlayer {
|
|
|
1901
2153
|
*
|
|
1902
2154
|
* @memberof VePlayer
|
|
1903
2155
|
*/
|
|
1904
|
-
_setPlayerInfo
|
|
2156
|
+
private _setPlayerInfo;
|
|
1905
2157
|
/**
|
|
1906
2158
|
*
|
|
1907
2159
|
*
|
|
@@ -1972,14 +2224,14 @@ declare class VePlayer {
|
|
|
1972
2224
|
getSdkPlugin(name: any): any;
|
|
1973
2225
|
/**
|
|
1974
2226
|
* @description 更换playAuthToken的方法
|
|
1975
|
-
* @
|
|
1976
|
-
* @param { IPlayAuthTokenConfig } config
|
|
1977
|
-
* @param { boolean } isNewVideo 是否是新视频,默认false
|
|
2227
|
+
* @notes 这里指同一个视频切换视频源,不能用来切换不同类型的视频
|
|
2228
|
+
* @param { IPlayAuthTokenConfig } config authToken配置
|
|
2229
|
+
* @param { boolean } isNewVideo 是否是新视频,默认true。若未false即表示同一个视频切换token播放,会在切换前时间点继续播放
|
|
1978
2230
|
* @memberof VePlayer
|
|
1979
2231
|
*/
|
|
1980
2232
|
switchAuthToken(config: IPlayAuthTokenConfig, isNewVideo?: boolean): Promise<void>;
|
|
1981
2233
|
/**
|
|
1982
|
-
* @description 更新playAuthToken
|
|
2234
|
+
* @description 更新playAuthToken的方法,用来更新视频地址
|
|
1983
2235
|
* @param { IPlayAuthTokenConfig } config
|
|
1984
2236
|
* @memberof VePlayer
|
|
1985
2237
|
*/
|
|
@@ -1991,14 +2243,14 @@ declare class VePlayer {
|
|
|
1991
2243
|
get src(): any;
|
|
1992
2244
|
/**
|
|
1993
2245
|
* @description 设置当前视频的地址
|
|
1994
|
-
* @
|
|
2246
|
+
* @notes 会重新拉取新的视频,从0开始起播
|
|
1995
2247
|
* @memberof VePlayer
|
|
1996
2248
|
*/
|
|
1997
2249
|
set src(url: any);
|
|
1998
2250
|
/**
|
|
1999
2251
|
* 切换视频url
|
|
2000
2252
|
* @param {string} url 同一个视频,切换视频地址
|
|
2001
|
-
* @
|
|
2253
|
+
* @notes 切换后从切换前的时间点继续播放
|
|
2002
2254
|
* @return {Promise<void>}
|
|
2003
2255
|
* @memberof VePlayer
|
|
2004
2256
|
*/
|
|
@@ -2007,17 +2259,19 @@ declare class VePlayer {
|
|
|
2007
2259
|
* 重建播放下一个
|
|
2008
2260
|
*
|
|
2009
2261
|
* @param {playerConfig} config
|
|
2262
|
+
* @param { boolean } isNewVideo 是否是新视频,默认true。若未false即表示同一个视频切换token播放,会在切换前时间点继续播放
|
|
2010
2263
|
* @memberof VePlayer
|
|
2011
2264
|
*/
|
|
2012
|
-
next(config: IPlayerConfig): Promise<void>;
|
|
2265
|
+
next(config: IPlayerConfig, isNewVideo?: boolean): Promise<void>;
|
|
2013
2266
|
/**
|
|
2014
2267
|
* 切换视频源,主要用于在视频过期时更新视频源
|
|
2015
2268
|
*
|
|
2016
2269
|
* @param {IPlayerConfig} config
|
|
2270
|
+
* @param { boolean } isNewVideo 是否是新视频,默认true。若未false即表示同一个视频切换token播放,会在切换前时间点继续播放
|
|
2017
2271
|
* @return{Promise<any>}
|
|
2018
2272
|
* @memberof VePlayer
|
|
2019
2273
|
*/
|
|
2020
|
-
playNext(config: IPlayerConfig): Promise<any>;
|
|
2274
|
+
playNext(config: IPlayerConfig, isNewVideo?: boolean): Promise<any>;
|
|
2021
2275
|
/**
|
|
2022
2276
|
* @hidden
|
|
2023
2277
|
*
|
|
@@ -2038,9 +2292,16 @@ declare class VePlayer {
|
|
|
2038
2292
|
* @return {*}
|
|
2039
2293
|
* @memberof VePlayer
|
|
2040
2294
|
*/
|
|
2041
|
-
getPlayerInstance():
|
|
2295
|
+
getPlayerInstance(): Player & {
|
|
2296
|
+
changePluginsIcon?: (name: any, isShow: any) => void;
|
|
2297
|
+
playerData?: PlayerData;
|
|
2298
|
+
playerType?: string;
|
|
2299
|
+
playerVersion?: string;
|
|
2300
|
+
panel?: MobilePlayerPanel;
|
|
2301
|
+
emitExpireTimestamp?: number;
|
|
2302
|
+
};
|
|
2042
2303
|
/**
|
|
2043
|
-
* @
|
|
2304
|
+
* @hidden
|
|
2044
2305
|
*
|
|
2045
2306
|
* @return {*}
|
|
2046
2307
|
* @memberof VePlayer
|
|
@@ -2069,13 +2330,128 @@ declare class VePlayer {
|
|
|
2069
2330
|
*/
|
|
2070
2331
|
private _initI18N;
|
|
2071
2332
|
/**
|
|
2072
|
-
*
|
|
2333
|
+
* 获取音乐播放模式
|
|
2334
|
+
* @notes 仅音乐播放模式有效
|
|
2335
|
+
* @return {PLAY_MODE_TYPE}
|
|
2336
|
+
* @memberof VePlayer
|
|
2337
|
+
*/
|
|
2338
|
+
get musicMode(): PLAY_MODE_TYPE;
|
|
2339
|
+
/**
|
|
2340
|
+
* 设置音乐播放模式
|
|
2341
|
+
* @notes 仅音乐播放模式有效
|
|
2342
|
+
* @memberof VePlayer
|
|
2343
|
+
* @param {PLAY_MODE_TYPE} val 模式值
|
|
2344
|
+
*/
|
|
2345
|
+
set musicMode(val: PLAY_MODE_TYPE);
|
|
2346
|
+
/**
|
|
2347
|
+
* 获取音乐播放快进快退时间跨度
|
|
2348
|
+
* @notes 仅音乐播放模式有效
|
|
2349
|
+
* @return {number}
|
|
2350
|
+
* @memberof VePlayer
|
|
2351
|
+
*/
|
|
2352
|
+
get musicTimeScale(): number;
|
|
2353
|
+
/**
|
|
2354
|
+
* 设置音乐播放快进快退时间跨度
|
|
2355
|
+
* @notes 仅音乐播放模式有效
|
|
2356
|
+
* @param {number} scale 时间跨度
|
|
2357
|
+
* @memberof VePlayer
|
|
2358
|
+
*/
|
|
2359
|
+
set musicTimeScale(scale: number);
|
|
2360
|
+
/**
|
|
2361
|
+
* 获取音乐播放列表
|
|
2362
|
+
* @notes 仅音乐播放模式有效
|
|
2363
|
+
* @return {IMusicListItem[]}
|
|
2364
|
+
* @memberof VePlayer
|
|
2365
|
+
*/
|
|
2366
|
+
get musicList(): IMusicListItem[];
|
|
2367
|
+
/**
|
|
2368
|
+
* 设置音乐播放列表
|
|
2369
|
+
* @notes 仅音乐播放模式有效
|
|
2370
|
+
* @param {IMusicListItem[]} list 播放列表
|
|
2371
|
+
* @memberof VePlayer
|
|
2372
|
+
*/
|
|
2373
|
+
set musicList(list: IMusicListItem[]);
|
|
2374
|
+
/**
|
|
2375
|
+
* 向播放列表中加入歌曲
|
|
2376
|
+
* @notes 仅音乐播放模式有效
|
|
2377
|
+
* @param {IMusicListItem} meta 歌曲信息
|
|
2378
|
+
* @memberof VePlayer
|
|
2379
|
+
*/
|
|
2380
|
+
musicAdd(meta: IMusicListItem): void;
|
|
2381
|
+
/**
|
|
2382
|
+
* 随机获取播放列表中某一首歌曲
|
|
2383
|
+
* @notes 仅音乐播放模式有效
|
|
2384
|
+
* @return {IMusicListItem} 歌曲信息
|
|
2385
|
+
* @memberof VePlayer
|
|
2386
|
+
*/
|
|
2387
|
+
musicRandom(): IMusicListItem;
|
|
2388
|
+
/**
|
|
2389
|
+
* 播放播放列表的下一首歌曲
|
|
2390
|
+
* @notes 仅音乐播放模式有效
|
|
2391
|
+
* @memberof VePlayer
|
|
2392
|
+
*/
|
|
2393
|
+
musicNext(): void;
|
|
2394
|
+
/**
|
|
2395
|
+
* 播放播放列表的上一首歌曲
|
|
2396
|
+
* @notes 仅音乐播放模式有效
|
|
2397
|
+
* @memberof VePlayer
|
|
2398
|
+
*/
|
|
2399
|
+
musicPrev(): void;
|
|
2400
|
+
/**
|
|
2401
|
+
* 播放播放列表的第n首歌曲
|
|
2402
|
+
* @notes 仅音乐播放模式有效
|
|
2403
|
+
* @param {number} index 播放列表中的序号
|
|
2404
|
+
* @memberof VePlayer
|
|
2405
|
+
*/
|
|
2406
|
+
musicSetIndex(index: number): void;
|
|
2407
|
+
/**
|
|
2408
|
+
* 歌曲快进
|
|
2409
|
+
* @notes 仅音乐播放模式有效
|
|
2410
|
+
* @memberof VePlayer
|
|
2411
|
+
*/
|
|
2412
|
+
musicForward(): void;
|
|
2413
|
+
/**
|
|
2414
|
+
* 歌曲后退
|
|
2415
|
+
* @notes 仅音乐播放模式有效
|
|
2416
|
+
* @memberof VePlayer
|
|
2417
|
+
*/
|
|
2418
|
+
musicBackward(): void;
|
|
2419
|
+
/**
|
|
2420
|
+
* 从播放列表移除指定歌曲
|
|
2421
|
+
* @notes 仅音乐播放模式有效
|
|
2422
|
+
* @param {string | number} vid 歌曲vid
|
|
2423
|
+
* @memberof VePlayer
|
|
2424
|
+
*/
|
|
2425
|
+
musicRemove(vid: string | number): void;
|
|
2426
|
+
/**
|
|
2427
|
+
* 设置ab循环
|
|
2428
|
+
* @param { number | IABCycle } start
|
|
2429
|
+
* @param { number } [end]
|
|
2430
|
+
* @param { boolean } [loop]
|
|
2431
|
+
* @param {{ [propName: string]: any }} [ext]
|
|
2432
|
+
* @memberof VePlayer
|
|
2433
|
+
*/
|
|
2434
|
+
musicSetAbCycle(start: number | IABCycle, end?: number, loop?: boolean, ext?: {
|
|
2435
|
+
[propName: string]: any;
|
|
2436
|
+
}): void;
|
|
2437
|
+
/**
|
|
2438
|
+
* 移除ab循环
|
|
2439
|
+
* @memberof VePlayer
|
|
2440
|
+
*/
|
|
2441
|
+
musicRemoveAbCycle(): void;
|
|
2442
|
+
/**
|
|
2443
|
+
* 销毁当前播放器SDK实例
|
|
2073
2444
|
*
|
|
2074
2445
|
* @memberof VePlayer
|
|
2075
2446
|
*/
|
|
2076
2447
|
destroy(): Promise<void>;
|
|
2077
2448
|
}
|
|
2078
2449
|
export declare function getI18N(): typeof I18N;
|
|
2450
|
+
declare class MusicPreset {
|
|
2451
|
+
ignores: string[];
|
|
2452
|
+
plugins: any[];
|
|
2453
|
+
constructor(options: any, playerConfig: any);
|
|
2454
|
+
}
|
|
2079
2455
|
export interface ISubTitles {
|
|
2080
2456
|
timestamp: number;
|
|
2081
2457
|
text: string;
|
|
@@ -2226,6 +2602,7 @@ export interface IPanelItem {
|
|
|
2226
2602
|
"data-type"?: string;
|
|
2227
2603
|
}
|
|
2228
2604
|
export declare class Subtitle extends Plugin {
|
|
2605
|
+
constructor(args: any);
|
|
2229
2606
|
static get pluginName(): string;
|
|
2230
2607
|
static get defaultConfig(): {
|
|
2231
2608
|
position: string;
|
|
@@ -2245,6 +2622,9 @@ export declare class Subtitle extends Plugin {
|
|
|
2245
2622
|
line: string;
|
|
2246
2623
|
fontColor: string;
|
|
2247
2624
|
};
|
|
2625
|
+
isShowIcon: boolean;
|
|
2626
|
+
mode: string;
|
|
2627
|
+
updateMode: string;
|
|
2248
2628
|
};
|
|
2249
2629
|
private _delegates;
|
|
2250
2630
|
isOpenState: boolean;
|
|
@@ -2253,13 +2633,31 @@ export declare class Subtitle extends Plugin {
|
|
|
2253
2633
|
subTitles: any;
|
|
2254
2634
|
curIndex: number;
|
|
2255
2635
|
curItem: ISubTitleItem;
|
|
2256
|
-
beforeCreate(args: any): void;
|
|
2257
2636
|
afterCreate(): void;
|
|
2637
|
+
/**
|
|
2638
|
+
* @description 初始化原生字幕
|
|
2639
|
+
*
|
|
2640
|
+
*/
|
|
2641
|
+
_initNativeSubtitle(defaultIndex: any): void;
|
|
2642
|
+
/**
|
|
2643
|
+
* 初始化外挂字幕
|
|
2644
|
+
* @param {number} defaultIndex
|
|
2645
|
+
*/
|
|
2646
|
+
_initExtSubTitle(defaultIndex: any): void;
|
|
2647
|
+
_renderList(defaultIndex: any): void;
|
|
2648
|
+
_onOff(): void;
|
|
2649
|
+
_onChange(data: any): void;
|
|
2650
|
+
_onListReset(data: any): void;
|
|
2651
|
+
updateCurItem(cIndex: any, subtitle: any): void;
|
|
2258
2652
|
initEvents(): void;
|
|
2259
2653
|
handleButtonChange(e: any): void;
|
|
2260
2654
|
showList(): void;
|
|
2261
2655
|
hideList(): void;
|
|
2262
2656
|
openSubtitle(): void;
|
|
2657
|
+
getSubTitleIndex(list: any, subtitle?: {
|
|
2658
|
+
id: string;
|
|
2659
|
+
language: string;
|
|
2660
|
+
}): number;
|
|
2263
2661
|
registerIcons(): {
|
|
2264
2662
|
vttSubOpen: {
|
|
2265
2663
|
icon: any;
|
|
@@ -2301,13 +2699,15 @@ export declare class Subtitle extends Plugin {
|
|
|
2301
2699
|
*/
|
|
2302
2700
|
switchSubTitle(subtitle?: ISubTitleItem): any;
|
|
2303
2701
|
switchOffSubtitle(): void;
|
|
2702
|
+
noShowSubtitle(): void;
|
|
2304
2703
|
renderItemList(): void;
|
|
2305
2704
|
/**
|
|
2306
2705
|
*
|
|
2307
|
-
* @param { Array<
|
|
2706
|
+
* @param { Array<SubTitleItem> } list
|
|
2308
2707
|
* @param { boolean } needRemove 是否移除原来的字幕
|
|
2309
2708
|
*/
|
|
2310
2709
|
updateSubtitles(list?: any[], needRemove?: boolean): void;
|
|
2710
|
+
updateList(data?: {}): void;
|
|
2311
2711
|
changeTipText(): void;
|
|
2312
2712
|
showMobilePanel(): void;
|
|
2313
2713
|
updatePanel(): void;
|
|
@@ -2429,127 +2829,6 @@ export declare class TimeShiftPlugin extends Plugin {
|
|
|
2429
2829
|
destroy(): void;
|
|
2430
2830
|
render(): string;
|
|
2431
2831
|
}
|
|
2432
|
-
declare enum EventName {
|
|
2433
|
-
UNKNOWN_NATIVE_EVENT = "UNKNOWN_NATIVE_EVENT",
|
|
2434
|
-
SWITCH_NORMAL_WINDOW = "SWITCH_NORMAL_WINDOW",
|
|
2435
|
-
SWITCH_MINI_WINDOW = "SWITCH_MINI_WINDOW"
|
|
2436
|
-
}
|
|
2437
|
-
declare enum CallNativeEvent {
|
|
2438
|
-
/** 初始值 */
|
|
2439
|
-
Unknown = 0,
|
|
2440
|
-
/** 直播页面准备好开始播放 */
|
|
2441
|
-
LiveReady = 1,
|
|
2442
|
-
/** 直播开始播放 */
|
|
2443
|
-
LiveStart = 2,
|
|
2444
|
-
/** 直播暂停 */
|
|
2445
|
-
LivePause = 3,
|
|
2446
|
-
/** 直播结束 */
|
|
2447
|
-
LiveEnd = 4,
|
|
2448
|
-
/** 直播出现错误 */
|
|
2449
|
-
LiveError = 5,
|
|
2450
|
-
/** 直播静音按钮被点击 */
|
|
2451
|
-
LiveMuted = 6,
|
|
2452
|
-
/** 直播流地址变化,主要用于用户切花和程序自动切换兜底 */
|
|
2453
|
-
LiveStreamChange = 7,
|
|
2454
|
-
/** 弹幕开关变化 */
|
|
2455
|
-
DanmakuChange = 8,
|
|
2456
|
-
/** JS准备好,可以接收Native消息 */
|
|
2457
|
-
JsReady = 9
|
|
2458
|
-
}
|
|
2459
|
-
export declare type CallNativeDataParamsMap = Record<CallNativeEvent, Record<string, string>>;
|
|
2460
|
-
/**
|
|
2461
|
-
* 通信数据中通用的数据,因为根播放器相关的字段多个事件都在使用,所以单独写成一个结构体
|
|
2462
|
-
* @property stream_link 当前播放的流地址
|
|
2463
|
-
* @property muted 当前播放是否静音
|
|
2464
|
-
* @property danmaku_active 当前弹幕是否启用
|
|
2465
|
-
*/
|
|
2466
|
-
export interface CallNativeDataParamsCommon {
|
|
2467
|
-
stream_link?: string;
|
|
2468
|
-
muted?: boolean;
|
|
2469
|
-
danmaku_active?: boolean;
|
|
2470
|
-
}
|
|
2471
|
-
export declare type EventHandler = (...args: any) => void;
|
|
2472
|
-
export interface LarkJsBridgeOptions {
|
|
2473
|
-
liveId: string;
|
|
2474
|
-
}
|
|
2475
|
-
declare class LarkJsBridge {
|
|
2476
|
-
private emitter;
|
|
2477
|
-
private currentHost;
|
|
2478
|
-
private currentLarkVersion;
|
|
2479
|
-
private currentLiveId;
|
|
2480
|
-
private isInAndroid;
|
|
2481
|
-
private isInIOS;
|
|
2482
|
-
private isInLark;
|
|
2483
|
-
private isInitialized;
|
|
2484
|
-
private useV2;
|
|
2485
|
-
constructor();
|
|
2486
|
-
init(options?: LarkJsBridgeOptions): void;
|
|
2487
|
-
private initVariables;
|
|
2488
|
-
/**
|
|
2489
|
-
* 初始化需要在window对象上定义 native callback 回调
|
|
2490
|
-
* native 向 webview 通信时会调用
|
|
2491
|
-
*/
|
|
2492
|
-
private initNativeCallWebCallback;
|
|
2493
|
-
/**
|
|
2494
|
-
* 定义native发送给web事件的回调函数
|
|
2495
|
-
* @param event
|
|
2496
|
-
* @param data
|
|
2497
|
-
*/
|
|
2498
|
-
private callWebHandler;
|
|
2499
|
-
/**
|
|
2500
|
-
* 目前处理容器模式发生变化的事件通知
|
|
2501
|
-
* @param event
|
|
2502
|
-
* @param data
|
|
2503
|
-
*/
|
|
2504
|
-
private handleContainerModeChange;
|
|
2505
|
-
/**
|
|
2506
|
-
* 按通信定义的数据结构生成通信参数
|
|
2507
|
-
* @param event
|
|
2508
|
-
* @param params
|
|
2509
|
-
* @returns
|
|
2510
|
-
*/
|
|
2511
|
-
private genTransferNativeData;
|
|
2512
|
-
private generateCallNativeDataV1;
|
|
2513
|
-
private generateCallNativeDataV2;
|
|
2514
|
-
/**
|
|
2515
|
-
* webview 发送给 native 事件的方法
|
|
2516
|
-
* @param event
|
|
2517
|
-
* @param params
|
|
2518
|
-
* @returns
|
|
2519
|
-
*/
|
|
2520
|
-
postMessage<T extends CallNativeEvent>(event: T, params: CallNativeDataParamsMap[T] & CallNativeDataParamsCommon): void;
|
|
2521
|
-
/**
|
|
2522
|
-
* 注册监听native事件回调
|
|
2523
|
-
* @param ev
|
|
2524
|
-
* @param handler
|
|
2525
|
-
*/
|
|
2526
|
-
addEventListener(ev: EventName, handler: EventHandler): void;
|
|
2527
|
-
/**
|
|
2528
|
-
* 注销监听native事件回调
|
|
2529
|
-
* @param ev
|
|
2530
|
-
* @param handler
|
|
2531
|
-
*/
|
|
2532
|
-
removeEventListener(ev: EventName, handler: EventHandler): void;
|
|
2533
|
-
destroy(): void;
|
|
2534
|
-
}
|
|
2535
|
-
declare class NativeWindowPlugin extends BasePlugin {
|
|
2536
|
-
static get pluginName(): string;
|
|
2537
|
-
private isFirstLoad;
|
|
2538
|
-
larkJsBridge: LarkJsBridge;
|
|
2539
|
-
afterCreate(): void;
|
|
2540
|
-
destroy(): void;
|
|
2541
|
-
private postMessage;
|
|
2542
|
-
handleReady: () => void;
|
|
2543
|
-
handlePlay: () => void;
|
|
2544
|
-
handlePause: () => void;
|
|
2545
|
-
handleError: () => void;
|
|
2546
|
-
handleMuted: () => void;
|
|
2547
|
-
handleDanmakuChange: () => void;
|
|
2548
|
-
handleLoadedData: () => void;
|
|
2549
|
-
handleMiniMode: () => void;
|
|
2550
|
-
handleNormalMode: () => void;
|
|
2551
|
-
handleDanmaku(isOpen: boolean): void;
|
|
2552
|
-
}
|
|
2553
2832
|
export declare class MirrorPlugin extends Plugin {
|
|
2554
2833
|
static get pluginName(): string;
|
|
2555
2834
|
static get defaultConfig(): {
|
|
@@ -2725,10 +3004,11 @@ export declare class LiveInfoPanel extends Plugin {
|
|
|
2725
3004
|
close(): void;
|
|
2726
3005
|
render(): string;
|
|
2727
3006
|
}
|
|
3007
|
+
export * from "xgplayer";
|
|
2728
3008
|
|
|
2729
3009
|
export {
|
|
2730
3010
|
LiveSubTitlesPlugin as LiveSubtitlesPlugin,
|
|
2731
|
-
|
|
3011
|
+
MusicPreset as Music,
|
|
2732
3012
|
VePlayer as default,
|
|
2733
3013
|
};
|
|
2734
3014
|
|