@byteplus/veplayer 1.1.2 → 1.6.0-alpha.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 +59 -47
- package/dist/index.d.ts +12 -13
- package/dist/index.min.js +2 -2
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -1,52 +1,64 @@
|
|
|
1
|
-
|
|
1
|
+
### Volcengine/player
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
By byteplus-veplayer, you can build a web video player application for playing multiple formats/protocols video (including mp4\hls\flv\dash),
|
|
5
|
-
which can meet the needs of businesses based on video-on-demand and live video services provided by [BytePlus](https://www.byteplus.com/en/)
|
|
3
|
+
火山引擎视频云播放器
|
|
6
4
|
|
|
7
|
-
###
|
|
5
|
+
### 安装
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
```bash
|
|
8
|
+
npm install @volcengine/veplayer --save
|
|
9
|
+
```
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$ npm install @byteplus/veplayer
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
2. Usage
|
|
16
|
-
|
|
17
|
-
Step 1:
|
|
18
|
-
|
|
19
|
-
```html
|
|
20
|
-
<div id="vs"></div>
|
|
21
|
-
```
|
|
22
|
-
Step 2:
|
|
23
|
-
|
|
24
|
-
```js
|
|
25
|
-
const playerSdk = new VePlayer({
|
|
26
|
-
id: 'vs',
|
|
27
|
-
width: 600,
|
|
28
|
-
height: 400,
|
|
29
|
-
streamType: 'hls',
|
|
30
|
-
url: 'http://xx.demo.com/demo.m3u8',
|
|
31
|
-
playList: [
|
|
32
|
-
{
|
|
33
|
-
streamType: 'hls',
|
|
34
|
-
definition: 'HD',
|
|
35
|
-
url: 'http://xx.demo.com/demo_hd.m3u8',
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
streamType: 'hls',
|
|
39
|
-
definition: 'UD',
|
|
40
|
-
url: 'http://xx.demo.com/demo_ud.m3u8',
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
streamType: 'hls',
|
|
44
|
-
definition: 'SD',
|
|
45
|
-
url: 'http://xx.demo.com/demo_sd.m3u8',
|
|
46
|
-
},
|
|
47
|
-
]
|
|
48
|
-
});
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Document
|
|
11
|
+
### 示例
|
|
52
12
|
|
|
13
|
+
```js
|
|
14
|
+
const playerSdk = new VePlayer({
|
|
15
|
+
id: 'mse',
|
|
16
|
+
isLive: true,
|
|
17
|
+
streamType: 'rtm',
|
|
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,
|
|
63
|
+
});
|
|
64
|
+
```
|
package/dist/index.d.ts
CHANGED
|
@@ -1104,8 +1104,6 @@ declare enum PlatformEnum {
|
|
|
1104
1104
|
export interface apiMapItem {
|
|
1105
1105
|
playDomain: string;
|
|
1106
1106
|
backupPlayDomain?: string;
|
|
1107
|
-
licenseUrl: string;
|
|
1108
|
-
keyDomain: string;
|
|
1109
1107
|
}
|
|
1110
1108
|
declare enum CodecType {
|
|
1111
1109
|
H265 = "h265",
|
|
@@ -1723,6 +1721,11 @@ export interface IPlayAuthTokenConfig {
|
|
|
1723
1721
|
* @memberof IPlayAuthTokenConfig
|
|
1724
1722
|
*/
|
|
1725
1723
|
getDrmAuthToken?: (playAuthIds: string, vid: string, unionInfo: string) => Promise<string>;
|
|
1724
|
+
/**
|
|
1725
|
+
* 是否禁用DRM解密播放降级,默认false
|
|
1726
|
+
* @type {boolean}
|
|
1727
|
+
*/
|
|
1728
|
+
disDrmDegraded?: boolean;
|
|
1726
1729
|
/**
|
|
1727
1730
|
* 可携带aid等透传参数,如
|
|
1728
1731
|
* {aid: 1234},以playAuthToken下发的参数的优先级最高。
|
|
@@ -2037,6 +2040,7 @@ declare class VePlayer {
|
|
|
2037
2040
|
private _isFirstCreated;
|
|
2038
2041
|
/**
|
|
2039
2042
|
* @hidden
|
|
2043
|
+
* 要注册的sdk插件
|
|
2040
2044
|
*
|
|
2041
2045
|
* @type {*}
|
|
2042
2046
|
* @memberof VePlayer
|
|
@@ -2044,6 +2048,7 @@ declare class VePlayer {
|
|
|
2044
2048
|
sdkPlugins: any[];
|
|
2045
2049
|
/**
|
|
2046
2050
|
* @hidden
|
|
2051
|
+
* 缓存运行的sdk插件实例
|
|
2047
2052
|
*
|
|
2048
2053
|
* @type {*}
|
|
2049
2054
|
* @memberof VePlayer
|
|
@@ -2237,13 +2242,7 @@ declare class VePlayer {
|
|
|
2237
2242
|
getCurrentPlayerConfig(): {
|
|
2238
2243
|
type?: "vod" | "live";
|
|
2239
2244
|
isLive?: boolean;
|
|
2240
|
-
lineId?: string | number;
|
|
2241
|
-
* @description 触发sdk事件
|
|
2242
|
-
*
|
|
2243
|
-
* @param {string} action
|
|
2244
|
-
* @param {*} [payload]
|
|
2245
|
-
* @memberof VePlayer
|
|
2246
|
-
*/
|
|
2245
|
+
lineId?: string | number;
|
|
2247
2246
|
definition?: string;
|
|
2248
2247
|
startTime?: number;
|
|
2249
2248
|
volume?: number;
|
|
@@ -2376,7 +2375,7 @@ declare class VePlayer {
|
|
|
2376
2375
|
set src(url: any);
|
|
2377
2376
|
/**
|
|
2378
2377
|
* 切换视频url
|
|
2379
|
-
* @param {string} url
|
|
2378
|
+
* @param {string} url 同一个视频,更新视频地址
|
|
2380
2379
|
* @notes 切换后从切换前的时间点继续播放
|
|
2381
2380
|
* @return {Promise<void>}
|
|
2382
2381
|
* @memberof VePlayer
|
|
@@ -2386,15 +2385,15 @@ declare class VePlayer {
|
|
|
2386
2385
|
* 重建播放下一个
|
|
2387
2386
|
*
|
|
2388
2387
|
* @param {playerConfig} config
|
|
2389
|
-
* @param { boolean } isNewVideo 是否是新视频,默认true
|
|
2388
|
+
* @param { boolean } isNewVideo 是否是新视频,默认true。若为false即表示同一个视频切换token播放,会在切换前时间点继续播放
|
|
2390
2389
|
* @memberof VePlayer
|
|
2391
2390
|
*/
|
|
2392
2391
|
next(config: IPlayerConfig, isNewVideo?: boolean): Promise<void>;
|
|
2393
2392
|
/**
|
|
2394
|
-
*
|
|
2393
|
+
* 切换视频源
|
|
2395
2394
|
*
|
|
2396
2395
|
* @param {IPlayerConfig} config
|
|
2397
|
-
* @param { boolean } isNewVideo 是否是新视频,默认true
|
|
2396
|
+
* @param { boolean } isNewVideo 是否是新视频,默认true。若为false即表示同一个视频切换地址播放,会在切换前的时间点继续播放
|
|
2398
2397
|
* @return{Promise<any>}
|
|
2399
2398
|
* @memberof VePlayer
|
|
2400
2399
|
*/
|