@volcengine/veplayer 1.5.17-beta.0 → 1.6.0
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/README.md +36 -53
- package/{dist/index.d.ts → index.d.ts} +261 -25
- package/index.min.css +1 -0
- package/index.min.js +2 -0
- package/package.json +5 -74
- package/LICENSE +0 -20
- package/dist/index.min.css +0 -1
- package/dist/index.min.js +0 -2
package/README.md
CHANGED
|
@@ -1,64 +1,47 @@
|
|
|
1
|
-
###
|
|
1
|
+
### VePlayer
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
### 安装
|
|
3
|
+
[火山引擎视频云](https://www.volcengine.com/)Web播放器SDK,自动适配PC和H5场景,支持MP4、HLS、FLV、DASH等多种格式的点播和直播,结合视频云具有播放质量日志上报、加密播放等功能。
|
|
6
4
|
|
|
5
|
+
### 引入依赖
|
|
6
|
+
通过包管理工具将 SDK 的依赖安装到项目中。
|
|
7
7
|
```bash
|
|
8
8
|
npm install @volcengine/veplayer --save
|
|
9
9
|
```
|
|
10
|
+
在项目中引入 VePlayer 和样式文件。
|
|
11
|
+
```javascript
|
|
12
|
+
import VePlayer from '@volcengine/veplayer';
|
|
13
|
+
import '@volcengine/veplayer/dist/index.min.css';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### 添加播放容器
|
|
17
|
+
在需要展示播放器的页面添加播放器容器,例如,在 index.html 中加入以下代码。
|
|
18
|
+
```javascript
|
|
19
|
+
<div id="video"></div>
|
|
20
|
+
```
|
|
21
|
+
### 播放器实例化
|
|
22
|
+
在获取到视频地址后,实例化播放器。
|
|
10
23
|
|
|
11
|
-
|
|
24
|
+
#### 点播
|
|
25
|
+
```javascript
|
|
26
|
+
const player = new VePlayer({
|
|
27
|
+
id: 'video', // 视频容器dom的id
|
|
28
|
+
url: "https://demo.vod.com/xxx.mp4", // 视频地址
|
|
29
|
+
vodLogOpts: {
|
|
30
|
+
vtype: 'MP4', // 视频格式,HLS协议的视频请传入HLS
|
|
31
|
+
tag: '普通视频', // 业务标签,用于区分业务中不同的场景,方便后续进行多维度分析
|
|
32
|
+
line_app_id: 348293, // 【必选】该值为 int 类型,接入视频点播的SDK应用id,可以从点播控制台-点播SDK-应用管理获取
|
|
33
|
+
line_user_id: 'XXX' // 用户 id, String 或者 int 类型, 不传入将是一个根据用户浏览器随机生成的值
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
点播功能的详细说明参考[火山引擎-视频点播-Web 点播SDK](https://www.volcengine.com/docs/4/127897)
|
|
12
38
|
|
|
13
|
-
|
|
39
|
+
#### 直播
|
|
40
|
+
```javascript
|
|
14
41
|
const playerSdk = new VePlayer({
|
|
15
|
-
id: '
|
|
42
|
+
id: 'video',
|
|
16
43
|
isLive: true,
|
|
17
|
-
|
|
18
|
-
url: '/url',
|
|
19
|
-
playList: [
|
|
20
|
-
{
|
|
21
|
-
lineId: 1,
|
|
22
|
-
lineTextKey: '线路一',
|
|
23
|
-
url: '/url',
|
|
24
|
-
definition: 'ld',
|
|
25
|
-
streamType: 'rtm',
|
|
26
|
-
definitionTextKey: 'LD',
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
lineId: 1,
|
|
30
|
-
lineTextKey: '线路一',
|
|
31
|
-
url: '/url',
|
|
32
|
-
definition: 'hd',
|
|
33
|
-
streamType: 'rtm',
|
|
34
|
-
definitionTextKey: 'HD',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
lineId: 1,
|
|
38
|
-
lineTextKey: '线路一',
|
|
39
|
-
url: '/url',
|
|
40
|
-
definition: 'uhd',
|
|
41
|
-
streamType: 'rtm',
|
|
42
|
-
definitionTextKey: 'UHD',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
lineId: 2,
|
|
46
|
-
lineTextKey: '线路二',
|
|
47
|
-
url: '/url',
|
|
48
|
-
definition: 'ld',
|
|
49
|
-
streamType: 'rtm',
|
|
50
|
-
definitionTextKey: 'LD',
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
lineId: 2,
|
|
54
|
-
lineTextKey: '线路二',
|
|
55
|
-
url: '/url',
|
|
56
|
-
definition: 'hd',
|
|
57
|
-
streamType: 'rtm',
|
|
58
|
-
definitionTextKey: 'HD',
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
width: 600,
|
|
62
|
-
height: 400,
|
|
44
|
+
url: '//livepull.example.com/appname/streamname.flv'
|
|
63
45
|
});
|
|
64
46
|
```
|
|
47
|
+
直播功能的详细说明参考[火山引擎-视频直播-Web SDK-拉流SDK](https://www.volcengine.com/docs/6469/127525)
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import VodLogger from '@byted/xgplayer-app-logger/es/logger.js';
|
|
1
2
|
import { Property } from 'dom-helpers/esm/types';
|
|
3
|
+
import EventEmitter from 'eventemitter3';
|
|
2
4
|
import Player from 'xgplayer';
|
|
3
|
-
import { I18N,
|
|
5
|
+
import { I18N, IXGI18nText, Plugin } from 'xgplayer';
|
|
4
6
|
|
|
5
7
|
declare enum POSITIONS {
|
|
6
8
|
ROOT = "root",
|
|
@@ -828,11 +830,17 @@ export interface IVodLogOptsConfig {
|
|
|
828
830
|
*/
|
|
829
831
|
vtype?: "MP4" | "HLS" | "DASH" | "FLV";
|
|
830
832
|
/**
|
|
831
|
-
*
|
|
833
|
+
* 自定义标签,对应控制台"业务维类型"维度
|
|
832
834
|
* 默认:`default`
|
|
833
835
|
* 必选
|
|
834
836
|
*/
|
|
835
837
|
tag?: string;
|
|
838
|
+
/**
|
|
839
|
+
* 自定义子标签,对应控制台"自定义标签"维度
|
|
840
|
+
* 默认:`default`
|
|
841
|
+
* 必选
|
|
842
|
+
*/
|
|
843
|
+
subtag?: string;
|
|
836
844
|
/**
|
|
837
845
|
* 视频解码器类型名称
|
|
838
846
|
* 默认:`h264`
|
|
@@ -971,6 +979,132 @@ export interface IMp4EncryptPlayerConfig {
|
|
|
971
979
|
};
|
|
972
980
|
};
|
|
973
981
|
}
|
|
982
|
+
export declare type IDefinition = {
|
|
983
|
+
[propName: string]: any;
|
|
984
|
+
url: any;
|
|
985
|
+
definition: any;
|
|
986
|
+
bitrate?: number;
|
|
987
|
+
bandwidth?: number;
|
|
988
|
+
text?: string | {
|
|
989
|
+
[propName: string]: any;
|
|
990
|
+
};
|
|
991
|
+
iconText?: string | {
|
|
992
|
+
[propName: string]: any;
|
|
993
|
+
};
|
|
994
|
+
};
|
|
995
|
+
export declare type IPlayerOptions = {
|
|
996
|
+
[propName: string]: any;
|
|
997
|
+
id?: string;
|
|
998
|
+
el?: HTMLElement;
|
|
999
|
+
url?: any;
|
|
1000
|
+
domEventType?: "default" | "touch" | "mouse";
|
|
1001
|
+
nullUrlStart?: boolean;
|
|
1002
|
+
width?: number | string;
|
|
1003
|
+
height?: number | string;
|
|
1004
|
+
fluid?: boolean;
|
|
1005
|
+
fitVideoSize?: "fixWidth" | "fixHeight" | "fixed";
|
|
1006
|
+
videoFillMode?: "auto" | "fillHeight" | "fillWidth" | "fill" | "cover";
|
|
1007
|
+
volume?: number | {
|
|
1008
|
+
[propName: string]: any;
|
|
1009
|
+
};
|
|
1010
|
+
autoplay?: boolean;
|
|
1011
|
+
autoplayMuted?: boolean;
|
|
1012
|
+
loop?: boolean;
|
|
1013
|
+
isLive?: boolean;
|
|
1014
|
+
zoom?: number;
|
|
1015
|
+
videoInit?: boolean;
|
|
1016
|
+
poster?: string | {
|
|
1017
|
+
[propName: string]: any;
|
|
1018
|
+
};
|
|
1019
|
+
isMobileSimulateMode?: "mobile" | "pc";
|
|
1020
|
+
defaultPlaybackRate?: number;
|
|
1021
|
+
execBeforePluginsCall?: () => any;
|
|
1022
|
+
allowSeekAfterEnded?: boolean;
|
|
1023
|
+
enableContextmenu?: boolean;
|
|
1024
|
+
closeVideoClick?: boolean;
|
|
1025
|
+
closeVideoDblclick?: boolean;
|
|
1026
|
+
closePlayerBlur?: boolean;
|
|
1027
|
+
closeDelayBlur?: boolean;
|
|
1028
|
+
leavePlayerTime?: number;
|
|
1029
|
+
closePlayVideoFocus?: boolean;
|
|
1030
|
+
closePauseVideoFocus?: boolean;
|
|
1031
|
+
closeFocusVideoFocus?: boolean;
|
|
1032
|
+
closeControlsBlur?: boolean;
|
|
1033
|
+
topBarAutoHide?: boolean;
|
|
1034
|
+
videoAttributes?: {
|
|
1035
|
+
[propName: string]: any;
|
|
1036
|
+
};
|
|
1037
|
+
startTime?: number;
|
|
1038
|
+
seekedStatus?: "play" | "pause" | "auto";
|
|
1039
|
+
miniprogress?: boolean;
|
|
1040
|
+
disableSwipeHandler?: () => any;
|
|
1041
|
+
enableSwipeHandler?: () => any;
|
|
1042
|
+
ignores?: Array<"cssfullscreen" | "screenshot" | "pip" | "miniscreen" | "keyboard" | "download" | "playbackrate" | "time" | "definition" | "error" | "fullscreen" | "loading" | "mobile" | "pc" | "play" | "poster" | "progress" | "replay" | "start" | "volume" | string>;
|
|
1043
|
+
inactive?: number;
|
|
1044
|
+
lang?: string;
|
|
1045
|
+
controls?: boolean | {
|
|
1046
|
+
[propName: string]: any;
|
|
1047
|
+
};
|
|
1048
|
+
marginControls?: boolean;
|
|
1049
|
+
fullscreenTarget?: HTMLElement;
|
|
1050
|
+
screenShot?: boolean | {
|
|
1051
|
+
[propName: string]: any;
|
|
1052
|
+
};
|
|
1053
|
+
rotate?: boolean | {
|
|
1054
|
+
[propName: string]: any;
|
|
1055
|
+
};
|
|
1056
|
+
pip?: boolean | {
|
|
1057
|
+
[propName: string]: any;
|
|
1058
|
+
};
|
|
1059
|
+
download?: boolean | {
|
|
1060
|
+
[propName: string]: any;
|
|
1061
|
+
};
|
|
1062
|
+
mini?: boolean | {
|
|
1063
|
+
[propName: string]: any;
|
|
1064
|
+
};
|
|
1065
|
+
cssFullscreen?: boolean | {
|
|
1066
|
+
[propName: string]: any;
|
|
1067
|
+
};
|
|
1068
|
+
keyShortcut?: boolean;
|
|
1069
|
+
presets?: any[];
|
|
1070
|
+
plugins?: any[];
|
|
1071
|
+
playbackRate?: number | number[] | {
|
|
1072
|
+
[propName: string]: any;
|
|
1073
|
+
};
|
|
1074
|
+
definition?: {
|
|
1075
|
+
[propName: string]: any;
|
|
1076
|
+
list: Array<IDefinition>;
|
|
1077
|
+
defaultDefinition?: IDefinition["definition"];
|
|
1078
|
+
};
|
|
1079
|
+
playsinline?: boolean;
|
|
1080
|
+
customDuration?: number;
|
|
1081
|
+
timeOffset?: number;
|
|
1082
|
+
icons?: {
|
|
1083
|
+
[propName: string]: string | HTMLElement | (() => HTMLElement | string);
|
|
1084
|
+
};
|
|
1085
|
+
i18n?: Array<any>;
|
|
1086
|
+
tabindex?: number;
|
|
1087
|
+
thumbnail?: {
|
|
1088
|
+
urls: Array<string>;
|
|
1089
|
+
pic_num: number;
|
|
1090
|
+
col: number;
|
|
1091
|
+
row: number;
|
|
1092
|
+
height?: number;
|
|
1093
|
+
width?: number;
|
|
1094
|
+
};
|
|
1095
|
+
videoConfig?: {
|
|
1096
|
+
[propName: string]: any;
|
|
1097
|
+
};
|
|
1098
|
+
commonStyle?: {
|
|
1099
|
+
progressColor?: string;
|
|
1100
|
+
playedColor?: string;
|
|
1101
|
+
cachedColor?: string;
|
|
1102
|
+
sliderBtnStyle?: {
|
|
1103
|
+
[propName: string]: any;
|
|
1104
|
+
};
|
|
1105
|
+
volumeColor?: string;
|
|
1106
|
+
};
|
|
1107
|
+
};
|
|
974
1108
|
declare enum PlatformEnum {
|
|
975
1109
|
VOLC_ENGINE = "volcengine",
|
|
976
1110
|
BYTE_PLUS = "byteplus"
|
|
@@ -978,8 +1112,13 @@ declare enum PlatformEnum {
|
|
|
978
1112
|
export interface apiMapItem {
|
|
979
1113
|
playDomain: string;
|
|
980
1114
|
backupPlayDomain?: string;
|
|
981
|
-
|
|
982
|
-
|
|
1115
|
+
}
|
|
1116
|
+
export interface IAutoplayPluginConfig {
|
|
1117
|
+
position?: string;
|
|
1118
|
+
enableDegradeMuteAutoplay?: boolean;
|
|
1119
|
+
enableWxJsBridgeAutoplay?: boolean;
|
|
1120
|
+
userActionDom?: Node;
|
|
1121
|
+
enableUserActionAutoplay?: boolean;
|
|
983
1122
|
}
|
|
984
1123
|
declare enum CodecType {
|
|
985
1124
|
H265 = "h265",
|
|
@@ -1375,6 +1514,34 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
1375
1514
|
* @memberof IPlayerConfig
|
|
1376
1515
|
*/
|
|
1377
1516
|
expireDetectType?: Array<"xhrStatus" | "getUrlTime">;
|
|
1517
|
+
/**
|
|
1518
|
+
* 有声音自动播放失败时是否降级成静音自动播放,默认不降级
|
|
1519
|
+
*
|
|
1520
|
+
* @type {boolean}
|
|
1521
|
+
* @memberof IPlayerConfig
|
|
1522
|
+
*/
|
|
1523
|
+
enableDegradeMuteAutoplay?: boolean;
|
|
1524
|
+
/**
|
|
1525
|
+
* 启用微信jsBridge方式的自动播放,默认不开启
|
|
1526
|
+
*
|
|
1527
|
+
* @type {boolean}
|
|
1528
|
+
* @memberof IPlayerConfig
|
|
1529
|
+
*/
|
|
1530
|
+
enableWxJsBridgeAutoplay?: boolean;
|
|
1531
|
+
/**
|
|
1532
|
+
* 开启任意点击的用户行为触发自动播放,默认不开启
|
|
1533
|
+
*
|
|
1534
|
+
* @type {boolean}
|
|
1535
|
+
* @memberof IPlayerConfig
|
|
1536
|
+
*/
|
|
1537
|
+
enableUserActionAutoplay?: boolean;
|
|
1538
|
+
/**
|
|
1539
|
+
* 禁用点播日志配置检测,默认开启,如果未配置line_app_id则会播放报错
|
|
1540
|
+
*
|
|
1541
|
+
* @type {boolean}
|
|
1542
|
+
* @memberof IPlayerConfig
|
|
1543
|
+
*/
|
|
1544
|
+
disableVodLogOptsCheck?: boolean;
|
|
1378
1545
|
/**
|
|
1379
1546
|
* 播放器报错展示配置, 可以配置播放异常时的播放器显示的异常文案、图片,以及是否提供刷新按钮等
|
|
1380
1547
|
*
|
|
@@ -1466,6 +1633,12 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
1466
1633
|
* @memberof IPlayerConfig
|
|
1467
1634
|
*/
|
|
1468
1635
|
music?: IMusicConfig;
|
|
1636
|
+
/**
|
|
1637
|
+
* 自动播放配置
|
|
1638
|
+
* @type {IMusicConfig}
|
|
1639
|
+
* @memberof IPlayerConfig
|
|
1640
|
+
*/
|
|
1641
|
+
AutoplayPlugin?: IAutoplayPluginConfig;
|
|
1469
1642
|
}
|
|
1470
1643
|
/**
|
|
1471
1644
|
* 初始配置
|
|
@@ -1547,6 +1720,14 @@ export interface IPlayAuthTokenConfig {
|
|
|
1547
1720
|
* @memberof IPlayAuthTokenConfig
|
|
1548
1721
|
*/
|
|
1549
1722
|
playAuthToken: string;
|
|
1723
|
+
/**
|
|
1724
|
+
* 默认清晰度
|
|
1725
|
+
*
|
|
1726
|
+
* @notes 为空时默认为最大码率的清晰度
|
|
1727
|
+
* @type {string}
|
|
1728
|
+
* @memberof IPlayAuthTokenConfig
|
|
1729
|
+
*/
|
|
1730
|
+
defaultDefinition?: string;
|
|
1550
1731
|
/**
|
|
1551
1732
|
* 求地址接口域名
|
|
1552
1733
|
*
|
|
@@ -1598,20 +1779,20 @@ export interface IPlayAuthTokenConfig {
|
|
|
1598
1779
|
*/
|
|
1599
1780
|
getKeyType?: string;
|
|
1600
1781
|
/**
|
|
1601
|
-
* 获取privateDrmAuthToken
|
|
1782
|
+
* 获取privateDrmAuthToken的异步回调,
|
|
1602
1783
|
* @type {(
|
|
1603
1784
|
* playAuthIds: string,
|
|
1604
1785
|
* vid: string,
|
|
1605
1786
|
* unionInfo: string,
|
|
1606
|
-
* ) => Promise<
|
|
1787
|
+
* ) => Promise<string>}
|
|
1788
|
+
* 回调入参:
|
|
1789
|
+
* playAuthIds 视频的密钥 KeyID,对应OpenAPI GetPlayInfo{@link https://www.volcengine.com/docs/4/2918#%E8%AF%B7%E6%B1%82%E8%AF%B4%E6%98%8E} 返回视频信息中的PlayAuthId,当有多个KeyID时以英文逗号相连
|
|
1790
|
+
* vid 视频vid
|
|
1791
|
+
* unionInfo 由unionId生成的unionInfo,以用来加密PrivateDrmAuthToken
|
|
1607
1792
|
* @memberof IPlayAuthTokenConfig
|
|
1793
|
+
*
|
|
1608
1794
|
*/
|
|
1609
1795
|
getDrmAuthToken?: (playAuthIds: string, vid: string, unionInfo: string) => Promise<string>;
|
|
1610
|
-
/**
|
|
1611
|
-
* 是否禁用DRM解密播放降级,默认false
|
|
1612
|
-
* @type {boolean}
|
|
1613
|
-
*/
|
|
1614
|
-
disDrmDegraded?: boolean;
|
|
1615
1796
|
/**
|
|
1616
1797
|
* 可携带aid等透传参数,如
|
|
1617
1798
|
* {aid: 1234},以playAuthToken下发的参数的优先级最高。
|
|
@@ -1788,6 +1969,7 @@ declare class PlayerData {
|
|
|
1788
1969
|
unionId?: string;
|
|
1789
1970
|
unionInfo?: string;
|
|
1790
1971
|
isMusic?: boolean;
|
|
1972
|
+
sdkPlugins: any[];
|
|
1791
1973
|
useHlsPluginForSafari: boolean;
|
|
1792
1974
|
constructor(configs: IPlayerConfig);
|
|
1793
1975
|
initPlayData(configs: any): void;
|
|
@@ -1814,7 +1996,7 @@ declare class PlayerData {
|
|
|
1814
1996
|
/**
|
|
1815
1997
|
* @description: 获取根据线路ID去重的流,用于获取有几个线路
|
|
1816
1998
|
*/
|
|
1817
|
-
getLineList():
|
|
1999
|
+
getLineList(): Stream[];
|
|
1818
2000
|
/**
|
|
1819
2001
|
* @description: 根据线路ID获取符合条件的流
|
|
1820
2002
|
* @param {number} lineId
|
|
@@ -1824,7 +2006,7 @@ declare class PlayerData {
|
|
|
1824
2006
|
* @description: 根据线路ID获取清晰度list,用于获取某个线路下有几个清晰度
|
|
1825
2007
|
* @param {number} lineId
|
|
1826
2008
|
*/
|
|
1827
|
-
getDefinitionListByLineId(lineId: number | string):
|
|
2009
|
+
getDefinitionListByLineId(lineId: number | string): Stream[];
|
|
1828
2010
|
/**
|
|
1829
2011
|
* @description: 根据条件筛选符合条件的流list
|
|
1830
2012
|
* @param {Condition} condition
|
|
@@ -1852,6 +2034,7 @@ declare class MobilePlayerPanel {
|
|
|
1852
2034
|
container: HTMLElement | undefined;
|
|
1853
2035
|
title: HTMLElement | undefined;
|
|
1854
2036
|
isShow: boolean;
|
|
2037
|
+
showCancelBtn: boolean;
|
|
1855
2038
|
constructor(args: any);
|
|
1856
2039
|
initEvents(): void;
|
|
1857
2040
|
handleOrientationChange(): void;
|
|
@@ -1889,6 +2072,7 @@ declare class VePlayer {
|
|
|
1889
2072
|
playerVersion?: string;
|
|
1890
2073
|
panel?: MobilePlayerPanel;
|
|
1891
2074
|
emitExpireTimestamp?: number;
|
|
2075
|
+
vodLogger?: VodLogger;
|
|
1892
2076
|
};
|
|
1893
2077
|
/**
|
|
1894
2078
|
* @hidden
|
|
@@ -1927,6 +2111,7 @@ declare class VePlayer {
|
|
|
1927
2111
|
private _isFirstCreated;
|
|
1928
2112
|
/**
|
|
1929
2113
|
* @hidden
|
|
2114
|
+
* 要注册的sdk插件
|
|
1930
2115
|
*
|
|
1931
2116
|
* @type {*}
|
|
1932
2117
|
* @memberof VePlayer
|
|
@@ -1934,6 +2119,7 @@ declare class VePlayer {
|
|
|
1934
2119
|
sdkPlugins: any[];
|
|
1935
2120
|
/**
|
|
1936
2121
|
* @hidden
|
|
2122
|
+
* 缓存运行的sdk插件实例
|
|
1937
2123
|
*
|
|
1938
2124
|
* @type {*}
|
|
1939
2125
|
* @memberof VePlayer
|
|
@@ -1984,10 +2170,10 @@ declare class VePlayer {
|
|
|
1984
2170
|
private sdkUmdLoader;
|
|
1985
2171
|
static isMSESupported: typeof isMSESupport;
|
|
1986
2172
|
static isRTMSupported: typeof import("@byted/xgplayer-rts").RtsPlugin.isSupported;
|
|
2173
|
+
static sdkVersion: string;
|
|
1987
2174
|
static isRTMSupportCodec: (codec: RTMCodec, options: {
|
|
1988
2175
|
targetProfileLevel?: string;
|
|
1989
2176
|
}) => Promise<boolean>;
|
|
1990
|
-
static playerVersion: string;
|
|
1991
2177
|
constructor(configs: IPlayerConfig);
|
|
1992
2178
|
/**
|
|
1993
2179
|
*
|
|
@@ -2015,6 +2201,7 @@ declare class VePlayer {
|
|
|
2015
2201
|
* @memberof VePlayer
|
|
2016
2202
|
*/
|
|
2017
2203
|
private initUmdLoader;
|
|
2204
|
+
private checkVodLogOptions;
|
|
2018
2205
|
/**
|
|
2019
2206
|
* @hidden
|
|
2020
2207
|
* @description umd 加载失败的回调
|
|
@@ -2097,6 +2284,7 @@ declare class VePlayer {
|
|
|
2097
2284
|
playerVersion?: string;
|
|
2098
2285
|
panel?: MobilePlayerPanel;
|
|
2099
2286
|
emitExpireTimestamp?: number;
|
|
2287
|
+
vodLogger?: VodLogger;
|
|
2100
2288
|
}>;
|
|
2101
2289
|
/**
|
|
2102
2290
|
* @hidden
|
|
@@ -2128,13 +2316,7 @@ declare class VePlayer {
|
|
|
2128
2316
|
* @memberof VePlayer
|
|
2129
2317
|
*/
|
|
2130
2318
|
getCurrentPlayerConfig(): {
|
|
2131
|
-
type?: "vod" | "live";
|
|
2132
|
-
* @description 监听sdk事件
|
|
2133
|
-
*
|
|
2134
|
-
* @param {string} action
|
|
2135
|
-
* @param {(...args: any[]) => void} func
|
|
2136
|
-
* @memberof VePlayer
|
|
2137
|
-
*/
|
|
2319
|
+
type?: "vod" | "live";
|
|
2138
2320
|
isLive?: boolean;
|
|
2139
2321
|
lineId?: string | number;
|
|
2140
2322
|
definition?: string;
|
|
@@ -2269,7 +2451,7 @@ declare class VePlayer {
|
|
|
2269
2451
|
set src(url: any);
|
|
2270
2452
|
/**
|
|
2271
2453
|
* 切换视频url
|
|
2272
|
-
* @param {string} url
|
|
2454
|
+
* @param {string} url 同一个视频,更新视频地址
|
|
2273
2455
|
* @notes 切换后从切换前的时间点继续播放
|
|
2274
2456
|
* @return {Promise<void>}
|
|
2275
2457
|
* @memberof VePlayer
|
|
@@ -2279,15 +2461,15 @@ declare class VePlayer {
|
|
|
2279
2461
|
* 重建播放下一个
|
|
2280
2462
|
*
|
|
2281
2463
|
* @param {playerConfig} config
|
|
2282
|
-
* @param { boolean } isNewVideo 是否是新视频,默认true
|
|
2464
|
+
* @param { boolean } isNewVideo 是否是新视频,默认true。若为false即表示同一个视频切换token播放,会在切换前时间点继续播放
|
|
2283
2465
|
* @memberof VePlayer
|
|
2284
2466
|
*/
|
|
2285
2467
|
next(config: IPlayerConfig, isNewVideo?: boolean): Promise<void>;
|
|
2286
2468
|
/**
|
|
2287
|
-
*
|
|
2469
|
+
* 切换视频源
|
|
2288
2470
|
*
|
|
2289
2471
|
* @param {IPlayerConfig} config
|
|
2290
|
-
* @param { boolean } isNewVideo 是否是新视频,默认true
|
|
2472
|
+
* @param { boolean } isNewVideo 是否是新视频,默认true。若为false即表示同一个视频切换地址播放,会在切换前的时间点继续播放
|
|
2291
2473
|
* @return{Promise<any>}
|
|
2292
2474
|
* @memberof VePlayer
|
|
2293
2475
|
*/
|
|
@@ -2319,6 +2501,7 @@ declare class VePlayer {
|
|
|
2319
2501
|
playerVersion?: string;
|
|
2320
2502
|
panel?: MobilePlayerPanel;
|
|
2321
2503
|
emitExpireTimestamp?: number;
|
|
2504
|
+
vodLogger?: VodLogger;
|
|
2322
2505
|
};
|
|
2323
2506
|
/**
|
|
2324
2507
|
* @hidden
|
|
@@ -2459,6 +2642,11 @@ declare class VePlayer {
|
|
|
2459
2642
|
* @memberof VePlayer
|
|
2460
2643
|
*/
|
|
2461
2644
|
musicRemoveAbCycle(): void;
|
|
2645
|
+
/**
|
|
2646
|
+
* 获取质量日志上报的用户id
|
|
2647
|
+
* @return {string | undefined}
|
|
2648
|
+
*/
|
|
2649
|
+
getLogUserId(): any;
|
|
2462
2650
|
/**
|
|
2463
2651
|
* 销毁当前播放器SDK实例
|
|
2464
2652
|
*
|
|
@@ -3024,6 +3212,54 @@ export declare class LiveInfoPanel extends Plugin {
|
|
|
3024
3212
|
close(): void;
|
|
3025
3213
|
render(): string;
|
|
3026
3214
|
}
|
|
3215
|
+
export declare class SdkPlugin {
|
|
3216
|
+
pluginName: string;
|
|
3217
|
+
__args: any;
|
|
3218
|
+
sdk: VePlayer;
|
|
3219
|
+
playerData: PlayerData;
|
|
3220
|
+
player: Player;
|
|
3221
|
+
_emitter: EventEmitter;
|
|
3222
|
+
static defineGetterOrSetter(Obj: any, map: any): void;
|
|
3223
|
+
/**
|
|
3224
|
+
* @type { string }
|
|
3225
|
+
*/
|
|
3226
|
+
static get pluginName(): string;
|
|
3227
|
+
/**
|
|
3228
|
+
* @constructor
|
|
3229
|
+
* @param { { sdk: object, pluginName: string, [propName: string]: any;} } args
|
|
3230
|
+
*/
|
|
3231
|
+
constructor(args: any);
|
|
3232
|
+
/**
|
|
3233
|
+
* @description sdk实例创建,挂载插件实例时首先执行
|
|
3234
|
+
*/
|
|
3235
|
+
beforeCreate(): void;
|
|
3236
|
+
/**
|
|
3237
|
+
* @description sdk实例创建,挂载插件实例完后执行
|
|
3238
|
+
*/
|
|
3239
|
+
afterCreate(): void;
|
|
3240
|
+
/**
|
|
3241
|
+
* @description sdk创建播放器前执行,只有这里能保证异步操作在creatPlayer之前同步完成
|
|
3242
|
+
*/
|
|
3243
|
+
beforePlayerCreate(): void;
|
|
3244
|
+
/**
|
|
3245
|
+
* @description sdk创建播放器完执行
|
|
3246
|
+
*/
|
|
3247
|
+
afterPlayerCreate(): void;
|
|
3248
|
+
/**
|
|
3249
|
+
* @description sdk销毁时执行
|
|
3250
|
+
*/
|
|
3251
|
+
destroy(): void;
|
|
3252
|
+
/**
|
|
3253
|
+
* @private
|
|
3254
|
+
* @param { any } args
|
|
3255
|
+
*/
|
|
3256
|
+
__init(args: any): void;
|
|
3257
|
+
/**
|
|
3258
|
+
* @description 插件销毁
|
|
3259
|
+
* @private
|
|
3260
|
+
*/
|
|
3261
|
+
__destroy(): void;
|
|
3262
|
+
}
|
|
3027
3263
|
export * from "xgplayer";
|
|
3028
3264
|
|
|
3029
3265
|
export {
|