@volcengine/veplayer 2.4.0-rc.0 → 2.4.0-rc.2
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/esm/index.d.ts +2 -0
- package/esm/veplayer.biz.live.development.js +48 -3
- package/esm/veplayer.biz.live.production.js +1 -1
- package/esm/veplayer.d.ts +34 -4
- package/esm/veplayer.development.js +57 -7
- package/esm/veplayer.live.d.ts +34 -4
- package/esm/veplayer.live.development.js +57 -7
- package/esm/veplayer.live.production.js +3 -3
- package/esm/veplayer.production.js +4 -4
- package/esm/veplayer.vod.d.ts +2 -0
- package/esm/veplayer.vod.development.js +8 -3
- package/esm/veplayer.vod.production.js +3 -3
- package/package.json +1 -1
- package/umd/index.d.ts +2 -0
- package/umd/veplayer.biz.live.development.js +48 -3
- package/umd/veplayer.biz.live.production.js +1 -1
- package/umd/veplayer.d.ts +34 -4
- package/umd/veplayer.development.js +57 -7
- package/umd/veplayer.live.d.ts +34 -4
- package/umd/veplayer.live.development.js +57 -7
- package/umd/veplayer.live.production.js +1 -1
- package/umd/veplayer.production.js +1 -1
- package/umd/veplayer.vod.d.ts +2 -0
- package/umd/veplayer.vod.development.js +8 -3
- package/umd/veplayer.vod.production.js +1 -1
- package/veplayer.d.ts +34 -4
- package/veplayer.live.d.ts +34 -4
- package/veplayer.vod.d.ts +2 -0
package/esm/veplayer.d.ts
CHANGED
|
@@ -2019,6 +2019,7 @@ declare class VePlayerBase {
|
|
|
2019
2019
|
*
|
|
2020
2020
|
*/
|
|
2021
2021
|
fallbackToFirstDefinition?: boolean;
|
|
2022
|
+
seamless?: boolean;
|
|
2022
2023
|
}): Promise<ExposedDefinition>;
|
|
2023
2024
|
/** {zh}
|
|
2024
2025
|
* @brief 调用此方法更新拉流地址列表。
|
|
@@ -2187,6 +2188,7 @@ declare class VePlayerBase {
|
|
|
2187
2188
|
*/
|
|
2188
2189
|
ignorePaused?: boolean;
|
|
2189
2190
|
}): void;
|
|
2191
|
+
canPlayType(type: string): boolean;
|
|
2190
2192
|
/** {zh}
|
|
2191
2193
|
* @brief 调用此方法进入系统全屏状态。如果该方法调用的时候处于网页全屏状态会自动退出网页全屏,下发事件 `Events.FULLSCREEN_CHANGE`。
|
|
2192
2194
|
* @param el 全屏作用的 DOM 节点。
|
|
@@ -5304,7 +5306,7 @@ interface Abr {
|
|
|
5304
5306
|
downTip?: boolean;
|
|
5305
5307
|
debug?: boolean;
|
|
5306
5308
|
bitrate: number;
|
|
5307
|
-
urls
|
|
5309
|
+
urls?: {
|
|
5308
5310
|
[bitrate: number]: string;
|
|
5309
5311
|
};
|
|
5310
5312
|
}
|
|
@@ -5501,6 +5503,7 @@ interface Rtm {
|
|
|
5501
5503
|
* @default false
|
|
5502
5504
|
*/
|
|
5503
5505
|
enableRTMAutoTranscode?: boolean;
|
|
5506
|
+
networkEvaluateInterval?: number;
|
|
5504
5507
|
}
|
|
5505
5508
|
/** {zh}
|
|
5506
5509
|
* @list option
|
|
@@ -5559,6 +5562,8 @@ interface Flv {
|
|
|
5559
5562
|
*/
|
|
5560
5563
|
abrPts?: string | number;
|
|
5561
5564
|
abr?: Abr;
|
|
5565
|
+
mseLowLatency?: boolean;
|
|
5566
|
+
maxReaderInterval?: number;
|
|
5562
5567
|
}
|
|
5563
5568
|
/** {zh}
|
|
5564
5569
|
* @list option
|
|
@@ -5610,6 +5615,7 @@ interface Hls {
|
|
|
5610
5615
|
*/
|
|
5611
5616
|
enableMSE?: boolean;
|
|
5612
5617
|
abr?: HlsAbr;
|
|
5618
|
+
mseLowLatency?: boolean;
|
|
5613
5619
|
}
|
|
5614
5620
|
/** {zh}
|
|
5615
5621
|
* @detail api
|
|
@@ -5668,6 +5674,10 @@ declare class VePlayerLive extends VePlayerBase {
|
|
|
5668
5674
|
* @hidden
|
|
5669
5675
|
*/
|
|
5670
5676
|
updateDrmConfig(config: FairplayDrmConfig): void;
|
|
5677
|
+
switchAbr({ enable, bitrate }: {
|
|
5678
|
+
enable: boolean;
|
|
5679
|
+
bitrate: number;
|
|
5680
|
+
}): void;
|
|
5671
5681
|
switch(target: string | {
|
|
5672
5682
|
/** {zh}
|
|
5673
5683
|
* @brief 清晰度的唯一标识。
|
|
@@ -5697,7 +5707,8 @@ declare class VePlayerLive extends VePlayerBase {
|
|
|
5697
5707
|
*
|
|
5698
5708
|
*/
|
|
5699
5709
|
fallbackToFirstDefinition?: boolean;
|
|
5700
|
-
|
|
5710
|
+
seamless?: boolean;
|
|
5711
|
+
abr?: {
|
|
5701
5712
|
bitrate: number; // 默认起播的码率,必传
|
|
5702
5713
|
method?: number; // 选择abr算法编号
|
|
5703
5714
|
urls: {
|
|
@@ -5705,6 +5716,10 @@ declare class VePlayerLive extends VePlayerBase {
|
|
|
5705
5716
|
}; // 可用的码率和对应的拉流地址
|
|
5706
5717
|
};
|
|
5707
5718
|
}): Promise<any>;
|
|
5719
|
+
getPlayTime(): number;
|
|
5720
|
+
getPlayerVersion(): string;
|
|
5721
|
+
getRTMNetWorkInfo(): any;
|
|
5722
|
+
getFLVStats(): any;
|
|
5708
5723
|
}
|
|
5709
5724
|
/** {zh}
|
|
5710
5725
|
* @detail api
|
|
@@ -8723,6 +8738,7 @@ declare namespace live {
|
|
|
8723
8738
|
*
|
|
8724
8739
|
*/
|
|
8725
8740
|
fallbackToFirstDefinition?: boolean;
|
|
8741
|
+
seamless?: boolean;
|
|
8726
8742
|
}): Promise<ExposedDefinition>;
|
|
8727
8743
|
/** {zh}
|
|
8728
8744
|
* @brief 调用此方法更新拉流地址列表。
|
|
@@ -8891,6 +8907,7 @@ declare namespace live {
|
|
|
8891
8907
|
*/
|
|
8892
8908
|
ignorePaused?: boolean;
|
|
8893
8909
|
}): void;
|
|
8910
|
+
canPlayType(type: string): boolean;
|
|
8894
8911
|
/** {zh}
|
|
8895
8912
|
* @brief 调用此方法进入系统全屏状态。如果该方法调用的时候处于网页全屏状态会自动退出网页全屏,下发事件 `Events.FULLSCREEN_CHANGE`。
|
|
8896
8913
|
* @param el 全屏作用的 DOM 节点。
|
|
@@ -9852,7 +9869,7 @@ declare namespace live {
|
|
|
9852
9869
|
downTip?: boolean;
|
|
9853
9870
|
debug?: boolean;
|
|
9854
9871
|
bitrate: number;
|
|
9855
|
-
urls
|
|
9872
|
+
urls?: {
|
|
9856
9873
|
[bitrate: number]: string;
|
|
9857
9874
|
};
|
|
9858
9875
|
}
|
|
@@ -10049,6 +10066,7 @@ declare namespace live {
|
|
|
10049
10066
|
* @default false
|
|
10050
10067
|
*/
|
|
10051
10068
|
enableRTMAutoTranscode?: boolean;
|
|
10069
|
+
networkEvaluateInterval?: number;
|
|
10052
10070
|
}
|
|
10053
10071
|
/** {zh}
|
|
10054
10072
|
* @list option
|
|
@@ -10107,6 +10125,8 @@ declare namespace live {
|
|
|
10107
10125
|
*/
|
|
10108
10126
|
abrPts?: string | number;
|
|
10109
10127
|
abr?: Abr;
|
|
10128
|
+
mseLowLatency?: boolean;
|
|
10129
|
+
maxReaderInterval?: number;
|
|
10110
10130
|
}
|
|
10111
10131
|
/** {zh}
|
|
10112
10132
|
* @list option
|
|
@@ -10158,6 +10178,7 @@ declare namespace live {
|
|
|
10158
10178
|
*/
|
|
10159
10179
|
enableMSE?: boolean;
|
|
10160
10180
|
abr?: HlsAbr;
|
|
10181
|
+
mseLowLatency?: boolean;
|
|
10161
10182
|
}
|
|
10162
10183
|
/** {zh}
|
|
10163
10184
|
* @detail api
|
|
@@ -10216,6 +10237,10 @@ declare namespace live {
|
|
|
10216
10237
|
* @hidden
|
|
10217
10238
|
*/
|
|
10218
10239
|
updateDrmConfig(config: FairplayDrmConfig): void;
|
|
10240
|
+
switchAbr({ enable, bitrate }: {
|
|
10241
|
+
enable: boolean;
|
|
10242
|
+
bitrate: number;
|
|
10243
|
+
}): void;
|
|
10219
10244
|
switch(target: string | {
|
|
10220
10245
|
/** {zh}
|
|
10221
10246
|
* @brief 清晰度的唯一标识。
|
|
@@ -10245,7 +10270,8 @@ declare namespace live {
|
|
|
10245
10270
|
*
|
|
10246
10271
|
*/
|
|
10247
10272
|
fallbackToFirstDefinition?: boolean;
|
|
10248
|
-
|
|
10273
|
+
seamless?: boolean;
|
|
10274
|
+
abr?: {
|
|
10249
10275
|
bitrate: number; // 默认起播的码率,必传
|
|
10250
10276
|
method?: number; // 选择abr算法编号
|
|
10251
10277
|
urls: {
|
|
@@ -10253,6 +10279,10 @@ declare namespace live {
|
|
|
10253
10279
|
}; // 可用的码率和对应的拉流地址
|
|
10254
10280
|
};
|
|
10255
10281
|
}): Promise<any>;
|
|
10282
|
+
getPlayTime(): number;
|
|
10283
|
+
getPlayerVersion(): string;
|
|
10284
|
+
getRTMNetWorkInfo(): any;
|
|
10285
|
+
getFLVStats(): any;
|
|
10256
10286
|
}
|
|
10257
10287
|
/** {zh}
|
|
10258
10288
|
* @detail api
|
|
@@ -13869,7 +13869,7 @@ class VePlayerBase {
|
|
|
13869
13869
|
var _a, _b;
|
|
13870
13870
|
if (typeof target === "string" && this._sourceManager.sources.length === 1 && ((_b = (_a = this._sourceManager.sources) == null ? void 0 : _a[0].definitions) == null ? void 0 : _b.length) === 1) {
|
|
13871
13871
|
this._sourceManager.updateSources(target);
|
|
13872
|
-
await this._switchUrl(target);
|
|
13872
|
+
await this._switchUrl(target, { seamless: options == null ? void 0 : options.seamless });
|
|
13873
13873
|
return this._sourceManager.definition;
|
|
13874
13874
|
}
|
|
13875
13875
|
const targetDefinition = this._sourceManager.find(target, options);
|
|
@@ -14055,6 +14055,9 @@ class VePlayerBase {
|
|
|
14055
14055
|
blur(data) {
|
|
14056
14056
|
return this._player.blur(data);
|
|
14057
14057
|
}
|
|
14058
|
+
canPlayType(type) {
|
|
14059
|
+
return this._player.canPlayType(type);
|
|
14060
|
+
}
|
|
14058
14061
|
/** {zh}
|
|
14059
14062
|
* @brief 调用此方法进入系统全屏状态。如果该方法调用的时候处于网页全屏状态会自动退出网页全屏,下发事件 `Events.FULLSCREEN_CHANGE`。
|
|
14060
14063
|
* @param el 全屏作用的 DOM 节点。
|
|
@@ -14252,14 +14255,16 @@ class VePlayerBase {
|
|
|
14252
14255
|
this._player.changeDefinition(targetDefinition, preDefinition);
|
|
14253
14256
|
}
|
|
14254
14257
|
}
|
|
14255
|
-
async _switchUrl(url) {
|
|
14258
|
+
async _switchUrl(url, config) {
|
|
14256
14259
|
const { plugins: newPlugins, options } = await this.prepare(url) || {};
|
|
14257
14260
|
const newUrl = (options == null ? void 0 : options.url) ?? url;
|
|
14258
14261
|
this._sourceManager.url = newUrl;
|
|
14259
14262
|
if (newPlugins == null ? void 0 : newPlugins.length) {
|
|
14260
14263
|
this._callBeforePlayerInitForUrl(newPlugins, newUrl);
|
|
14261
14264
|
} else {
|
|
14262
|
-
const res = this._player.switchURL(newUrl,
|
|
14265
|
+
const res = this._player.switchURL(newUrl, {
|
|
14266
|
+
seamless: config == null ? void 0 : config.seamless
|
|
14267
|
+
});
|
|
14263
14268
|
const curTime = this._player.currentTime;
|
|
14264
14269
|
if (res && res.then) {
|
|
14265
14270
|
return res;
|
|
@@ -21890,10 +21895,10 @@ class Logger extends Plugin {
|
|
|
21890
21895
|
user_id: this._userId,
|
|
21891
21896
|
device_id: this._deviceId,
|
|
21892
21897
|
ext: {
|
|
21893
|
-
veplayer_version: "2.4.0-rc.
|
|
21894
|
-
flv_version: "3.0.
|
|
21898
|
+
veplayer_version: "2.4.0-rc.2",
|
|
21899
|
+
flv_version: "3.0.18-alpha.3",
|
|
21895
21900
|
hls_version: "3.0.17",
|
|
21896
|
-
rts_version: "0.2.
|
|
21901
|
+
rts_version: "0.2.1-alpha.0"
|
|
21897
21902
|
}
|
|
21898
21903
|
});
|
|
21899
21904
|
}
|
|
@@ -22199,7 +22204,10 @@ const getAbrStrategy = async (options) => {
|
|
|
22199
22204
|
const abrPlugin = await load(DynamicModule.PluginAbr).catch(() => void 0);
|
|
22200
22205
|
return {
|
|
22201
22206
|
options: {
|
|
22202
|
-
[streamType === "flv" ? "abr" : "hlsabr"]:
|
|
22207
|
+
[streamType === "flv" ? "abr" : "hlsabr"]: {
|
|
22208
|
+
...abrOptions,
|
|
22209
|
+
open: abrOptions.enable ?? true
|
|
22210
|
+
}
|
|
22203
22211
|
},
|
|
22204
22212
|
plugins: [
|
|
22205
22213
|
streamType === "flv" ? abrPlugin == null ? void 0 : abrPlugin.AbrPlugin : abrPlugin == null ? void 0 : abrPlugin.HlsAbrPlugin
|
|
@@ -22294,6 +22302,23 @@ class VePlayerLive extends VePlayerBase {
|
|
|
22294
22302
|
var _a, _b, _c;
|
|
22295
22303
|
(_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.drm) == null ? void 0 : _c.updateDrmConfig(config);
|
|
22296
22304
|
}
|
|
22305
|
+
switchAbr({ enable, bitrate }) {
|
|
22306
|
+
var _a, _b;
|
|
22307
|
+
if (!((_a = this._player.plugins) == null ? void 0 : _a.abr)) {
|
|
22308
|
+
return;
|
|
22309
|
+
}
|
|
22310
|
+
if (typeof bitrate !== "undefined") {
|
|
22311
|
+
const url = this._player.plugins.abr.config.urls[bitrate];
|
|
22312
|
+
if (!url) {
|
|
22313
|
+
return;
|
|
22314
|
+
}
|
|
22315
|
+
this.switch(url, { seamless: true });
|
|
22316
|
+
this._player.plugins.abr.bitrate = bitrate;
|
|
22317
|
+
}
|
|
22318
|
+
if (typeof enable !== "undefined") {
|
|
22319
|
+
(_b = this._player.plugins) == null ? void 0 : _b.abr.switchAbr(enable);
|
|
22320
|
+
}
|
|
22321
|
+
}
|
|
22297
22322
|
async switch(target, options) {
|
|
22298
22323
|
var _a, _b, _c;
|
|
22299
22324
|
const { abr, ...rest } = options ?? {};
|
|
@@ -22302,6 +22327,31 @@ class VePlayerLive extends VePlayerBase {
|
|
|
22302
22327
|
}
|
|
22303
22328
|
return super.switch(target, rest);
|
|
22304
22329
|
}
|
|
22330
|
+
getPlayTime() {
|
|
22331
|
+
var _a, _b, _c, _d;
|
|
22332
|
+
if (!((_b = (_a = this._player) == null ? void 0 : _a.played) == null ? void 0 : _b.length)) {
|
|
22333
|
+
return 0;
|
|
22334
|
+
}
|
|
22335
|
+
const length = this._player.played.length;
|
|
22336
|
+
let time = 0;
|
|
22337
|
+
for (let index = 0; index < length; index++) {
|
|
22338
|
+
const start = (_c = this._player) == null ? void 0 : _c.played.start(index);
|
|
22339
|
+
const end = (_d = this._player) == null ? void 0 : _d.played.end(index);
|
|
22340
|
+
time += end - start;
|
|
22341
|
+
}
|
|
22342
|
+
return time;
|
|
22343
|
+
}
|
|
22344
|
+
getPlayerVersion() {
|
|
22345
|
+
return "2.4.0-rc.2";
|
|
22346
|
+
}
|
|
22347
|
+
getRTMNetWorkInfo() {
|
|
22348
|
+
var _a, _b, _c;
|
|
22349
|
+
return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.rts) == null ? void 0 : _c.getNetWorkInfo();
|
|
22350
|
+
}
|
|
22351
|
+
getFLVStats() {
|
|
22352
|
+
var _a, _b, _c;
|
|
22353
|
+
return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.flv) == null ? void 0 : _c.getStats();
|
|
22354
|
+
}
|
|
22305
22355
|
}
|
|
22306
22356
|
async function createLivePlayer(options) {
|
|
22307
22357
|
var _a, _b;
|
package/esm/veplayer.live.d.ts
CHANGED
|
@@ -2019,6 +2019,7 @@ declare class VePlayerBase {
|
|
|
2019
2019
|
*
|
|
2020
2020
|
*/
|
|
2021
2021
|
fallbackToFirstDefinition?: boolean;
|
|
2022
|
+
seamless?: boolean;
|
|
2022
2023
|
}): Promise<ExposedDefinition>;
|
|
2023
2024
|
/** {zh}
|
|
2024
2025
|
* @brief 调用此方法更新拉流地址列表。
|
|
@@ -2187,6 +2188,7 @@ declare class VePlayerBase {
|
|
|
2187
2188
|
*/
|
|
2188
2189
|
ignorePaused?: boolean;
|
|
2189
2190
|
}): void;
|
|
2191
|
+
canPlayType(type: string): boolean;
|
|
2190
2192
|
/** {zh}
|
|
2191
2193
|
* @brief 调用此方法进入系统全屏状态。如果该方法调用的时候处于网页全屏状态会自动退出网页全屏,下发事件 `Events.FULLSCREEN_CHANGE`。
|
|
2192
2194
|
* @param el 全屏作用的 DOM 节点。
|
|
@@ -5304,7 +5306,7 @@ interface Abr {
|
|
|
5304
5306
|
downTip?: boolean;
|
|
5305
5307
|
debug?: boolean;
|
|
5306
5308
|
bitrate: number;
|
|
5307
|
-
urls
|
|
5309
|
+
urls?: {
|
|
5308
5310
|
[bitrate: number]: string;
|
|
5309
5311
|
};
|
|
5310
5312
|
}
|
|
@@ -5501,6 +5503,7 @@ interface Rtm {
|
|
|
5501
5503
|
* @default false
|
|
5502
5504
|
*/
|
|
5503
5505
|
enableRTMAutoTranscode?: boolean;
|
|
5506
|
+
networkEvaluateInterval?: number;
|
|
5504
5507
|
}
|
|
5505
5508
|
/** {zh}
|
|
5506
5509
|
* @list option
|
|
@@ -5559,6 +5562,8 @@ interface Flv {
|
|
|
5559
5562
|
*/
|
|
5560
5563
|
abrPts?: string | number;
|
|
5561
5564
|
abr?: Abr;
|
|
5565
|
+
mseLowLatency?: boolean;
|
|
5566
|
+
maxReaderInterval?: number;
|
|
5562
5567
|
}
|
|
5563
5568
|
/** {zh}
|
|
5564
5569
|
* @list option
|
|
@@ -5610,6 +5615,7 @@ interface Hls {
|
|
|
5610
5615
|
*/
|
|
5611
5616
|
enableMSE?: boolean;
|
|
5612
5617
|
abr?: HlsAbr;
|
|
5618
|
+
mseLowLatency?: boolean;
|
|
5613
5619
|
}
|
|
5614
5620
|
/** {zh}
|
|
5615
5621
|
* @detail api
|
|
@@ -5668,6 +5674,10 @@ declare class VePlayerLive extends VePlayerBase {
|
|
|
5668
5674
|
* @hidden
|
|
5669
5675
|
*/
|
|
5670
5676
|
updateDrmConfig(config: FairplayDrmConfig): void;
|
|
5677
|
+
switchAbr({ enable, bitrate }: {
|
|
5678
|
+
enable: boolean;
|
|
5679
|
+
bitrate: number;
|
|
5680
|
+
}): void;
|
|
5671
5681
|
switch(target: string | {
|
|
5672
5682
|
/** {zh}
|
|
5673
5683
|
* @brief 清晰度的唯一标识。
|
|
@@ -5697,7 +5707,8 @@ declare class VePlayerLive extends VePlayerBase {
|
|
|
5697
5707
|
*
|
|
5698
5708
|
*/
|
|
5699
5709
|
fallbackToFirstDefinition?: boolean;
|
|
5700
|
-
|
|
5710
|
+
seamless?: boolean;
|
|
5711
|
+
abr?: {
|
|
5701
5712
|
bitrate: number; // 默认起播的码率,必传
|
|
5702
5713
|
method?: number; // 选择abr算法编号
|
|
5703
5714
|
urls: {
|
|
@@ -5705,6 +5716,10 @@ declare class VePlayerLive extends VePlayerBase {
|
|
|
5705
5716
|
}; // 可用的码率和对应的拉流地址
|
|
5706
5717
|
};
|
|
5707
5718
|
}): Promise<any>;
|
|
5719
|
+
getPlayTime(): number;
|
|
5720
|
+
getPlayerVersion(): string;
|
|
5721
|
+
getRTMNetWorkInfo(): any;
|
|
5722
|
+
getFLVStats(): any;
|
|
5708
5723
|
}
|
|
5709
5724
|
/** {zh}
|
|
5710
5725
|
* @detail api
|
|
@@ -8723,6 +8738,7 @@ declare namespace live {
|
|
|
8723
8738
|
*
|
|
8724
8739
|
*/
|
|
8725
8740
|
fallbackToFirstDefinition?: boolean;
|
|
8741
|
+
seamless?: boolean;
|
|
8726
8742
|
}): Promise<ExposedDefinition>;
|
|
8727
8743
|
/** {zh}
|
|
8728
8744
|
* @brief 调用此方法更新拉流地址列表。
|
|
@@ -8891,6 +8907,7 @@ declare namespace live {
|
|
|
8891
8907
|
*/
|
|
8892
8908
|
ignorePaused?: boolean;
|
|
8893
8909
|
}): void;
|
|
8910
|
+
canPlayType(type: string): boolean;
|
|
8894
8911
|
/** {zh}
|
|
8895
8912
|
* @brief 调用此方法进入系统全屏状态。如果该方法调用的时候处于网页全屏状态会自动退出网页全屏,下发事件 `Events.FULLSCREEN_CHANGE`。
|
|
8896
8913
|
* @param el 全屏作用的 DOM 节点。
|
|
@@ -9852,7 +9869,7 @@ declare namespace live {
|
|
|
9852
9869
|
downTip?: boolean;
|
|
9853
9870
|
debug?: boolean;
|
|
9854
9871
|
bitrate: number;
|
|
9855
|
-
urls
|
|
9872
|
+
urls?: {
|
|
9856
9873
|
[bitrate: number]: string;
|
|
9857
9874
|
};
|
|
9858
9875
|
}
|
|
@@ -10049,6 +10066,7 @@ declare namespace live {
|
|
|
10049
10066
|
* @default false
|
|
10050
10067
|
*/
|
|
10051
10068
|
enableRTMAutoTranscode?: boolean;
|
|
10069
|
+
networkEvaluateInterval?: number;
|
|
10052
10070
|
}
|
|
10053
10071
|
/** {zh}
|
|
10054
10072
|
* @list option
|
|
@@ -10107,6 +10125,8 @@ declare namespace live {
|
|
|
10107
10125
|
*/
|
|
10108
10126
|
abrPts?: string | number;
|
|
10109
10127
|
abr?: Abr;
|
|
10128
|
+
mseLowLatency?: boolean;
|
|
10129
|
+
maxReaderInterval?: number;
|
|
10110
10130
|
}
|
|
10111
10131
|
/** {zh}
|
|
10112
10132
|
* @list option
|
|
@@ -10158,6 +10178,7 @@ declare namespace live {
|
|
|
10158
10178
|
*/
|
|
10159
10179
|
enableMSE?: boolean;
|
|
10160
10180
|
abr?: HlsAbr;
|
|
10181
|
+
mseLowLatency?: boolean;
|
|
10161
10182
|
}
|
|
10162
10183
|
/** {zh}
|
|
10163
10184
|
* @detail api
|
|
@@ -10216,6 +10237,10 @@ declare namespace live {
|
|
|
10216
10237
|
* @hidden
|
|
10217
10238
|
*/
|
|
10218
10239
|
updateDrmConfig(config: FairplayDrmConfig): void;
|
|
10240
|
+
switchAbr({ enable, bitrate }: {
|
|
10241
|
+
enable: boolean;
|
|
10242
|
+
bitrate: number;
|
|
10243
|
+
}): void;
|
|
10219
10244
|
switch(target: string | {
|
|
10220
10245
|
/** {zh}
|
|
10221
10246
|
* @brief 清晰度的唯一标识。
|
|
@@ -10245,7 +10270,8 @@ declare namespace live {
|
|
|
10245
10270
|
*
|
|
10246
10271
|
*/
|
|
10247
10272
|
fallbackToFirstDefinition?: boolean;
|
|
10248
|
-
|
|
10273
|
+
seamless?: boolean;
|
|
10274
|
+
abr?: {
|
|
10249
10275
|
bitrate: number; // 默认起播的码率,必传
|
|
10250
10276
|
method?: number; // 选择abr算法编号
|
|
10251
10277
|
urls: {
|
|
@@ -10253,6 +10279,10 @@ declare namespace live {
|
|
|
10253
10279
|
}; // 可用的码率和对应的拉流地址
|
|
10254
10280
|
};
|
|
10255
10281
|
}): Promise<any>;
|
|
10282
|
+
getPlayTime(): number;
|
|
10283
|
+
getPlayerVersion(): string;
|
|
10284
|
+
getRTMNetWorkInfo(): any;
|
|
10285
|
+
getFLVStats(): any;
|
|
10256
10286
|
}
|
|
10257
10287
|
/** {zh}
|
|
10258
10288
|
* @detail api
|
|
@@ -13869,7 +13869,7 @@ class VePlayerBase {
|
|
|
13869
13869
|
var _a, _b;
|
|
13870
13870
|
if (typeof target === "string" && this._sourceManager.sources.length === 1 && ((_b = (_a = this._sourceManager.sources) == null ? void 0 : _a[0].definitions) == null ? void 0 : _b.length) === 1) {
|
|
13871
13871
|
this._sourceManager.updateSources(target);
|
|
13872
|
-
await this._switchUrl(target);
|
|
13872
|
+
await this._switchUrl(target, { seamless: options == null ? void 0 : options.seamless });
|
|
13873
13873
|
return this._sourceManager.definition;
|
|
13874
13874
|
}
|
|
13875
13875
|
const targetDefinition = this._sourceManager.find(target, options);
|
|
@@ -14055,6 +14055,9 @@ class VePlayerBase {
|
|
|
14055
14055
|
blur(data) {
|
|
14056
14056
|
return this._player.blur(data);
|
|
14057
14057
|
}
|
|
14058
|
+
canPlayType(type) {
|
|
14059
|
+
return this._player.canPlayType(type);
|
|
14060
|
+
}
|
|
14058
14061
|
/** {zh}
|
|
14059
14062
|
* @brief 调用此方法进入系统全屏状态。如果该方法调用的时候处于网页全屏状态会自动退出网页全屏,下发事件 `Events.FULLSCREEN_CHANGE`。
|
|
14060
14063
|
* @param el 全屏作用的 DOM 节点。
|
|
@@ -14252,14 +14255,16 @@ class VePlayerBase {
|
|
|
14252
14255
|
this._player.changeDefinition(targetDefinition, preDefinition);
|
|
14253
14256
|
}
|
|
14254
14257
|
}
|
|
14255
|
-
async _switchUrl(url) {
|
|
14258
|
+
async _switchUrl(url, config) {
|
|
14256
14259
|
const { plugins: newPlugins, options } = await this.prepare(url) || {};
|
|
14257
14260
|
const newUrl = (options == null ? void 0 : options.url) ?? url;
|
|
14258
14261
|
this._sourceManager.url = newUrl;
|
|
14259
14262
|
if (newPlugins == null ? void 0 : newPlugins.length) {
|
|
14260
14263
|
this._callBeforePlayerInitForUrl(newPlugins, newUrl);
|
|
14261
14264
|
} else {
|
|
14262
|
-
const res = this._player.switchURL(newUrl,
|
|
14265
|
+
const res = this._player.switchURL(newUrl, {
|
|
14266
|
+
seamless: config == null ? void 0 : config.seamless
|
|
14267
|
+
});
|
|
14263
14268
|
const curTime = this._player.currentTime;
|
|
14264
14269
|
if (res && res.then) {
|
|
14265
14270
|
return res;
|
|
@@ -21890,10 +21895,10 @@ class Logger extends Plugin {
|
|
|
21890
21895
|
user_id: this._userId,
|
|
21891
21896
|
device_id: this._deviceId,
|
|
21892
21897
|
ext: {
|
|
21893
|
-
veplayer_version: "2.4.0-rc.
|
|
21894
|
-
flv_version: "3.0.
|
|
21898
|
+
veplayer_version: "2.4.0-rc.2",
|
|
21899
|
+
flv_version: "3.0.18-alpha.3",
|
|
21895
21900
|
hls_version: "3.0.17",
|
|
21896
|
-
rts_version: "0.2.
|
|
21901
|
+
rts_version: "0.2.1-alpha.0"
|
|
21897
21902
|
}
|
|
21898
21903
|
});
|
|
21899
21904
|
}
|
|
@@ -22199,7 +22204,10 @@ const getAbrStrategy = async (options) => {
|
|
|
22199
22204
|
const abrPlugin = await load(DynamicModule.PluginAbr).catch(() => void 0);
|
|
22200
22205
|
return {
|
|
22201
22206
|
options: {
|
|
22202
|
-
[streamType === "flv" ? "abr" : "hlsabr"]:
|
|
22207
|
+
[streamType === "flv" ? "abr" : "hlsabr"]: {
|
|
22208
|
+
...abrOptions,
|
|
22209
|
+
open: abrOptions.enable ?? true
|
|
22210
|
+
}
|
|
22203
22211
|
},
|
|
22204
22212
|
plugins: [
|
|
22205
22213
|
streamType === "flv" ? abrPlugin == null ? void 0 : abrPlugin.AbrPlugin : abrPlugin == null ? void 0 : abrPlugin.HlsAbrPlugin
|
|
@@ -22294,6 +22302,23 @@ class VePlayerLive extends VePlayerBase {
|
|
|
22294
22302
|
var _a, _b, _c;
|
|
22295
22303
|
(_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.drm) == null ? void 0 : _c.updateDrmConfig(config);
|
|
22296
22304
|
}
|
|
22305
|
+
switchAbr({ enable, bitrate }) {
|
|
22306
|
+
var _a, _b;
|
|
22307
|
+
if (!((_a = this._player.plugins) == null ? void 0 : _a.abr)) {
|
|
22308
|
+
return;
|
|
22309
|
+
}
|
|
22310
|
+
if (typeof bitrate !== "undefined") {
|
|
22311
|
+
const url = this._player.plugins.abr.config.urls[bitrate];
|
|
22312
|
+
if (!url) {
|
|
22313
|
+
return;
|
|
22314
|
+
}
|
|
22315
|
+
this.switch(url, { seamless: true });
|
|
22316
|
+
this._player.plugins.abr.bitrate = bitrate;
|
|
22317
|
+
}
|
|
22318
|
+
if (typeof enable !== "undefined") {
|
|
22319
|
+
(_b = this._player.plugins) == null ? void 0 : _b.abr.switchAbr(enable);
|
|
22320
|
+
}
|
|
22321
|
+
}
|
|
22297
22322
|
async switch(target, options) {
|
|
22298
22323
|
var _a, _b, _c;
|
|
22299
22324
|
const { abr, ...rest } = options ?? {};
|
|
@@ -22302,6 +22327,31 @@ class VePlayerLive extends VePlayerBase {
|
|
|
22302
22327
|
}
|
|
22303
22328
|
return super.switch(target, rest);
|
|
22304
22329
|
}
|
|
22330
|
+
getPlayTime() {
|
|
22331
|
+
var _a, _b, _c, _d;
|
|
22332
|
+
if (!((_b = (_a = this._player) == null ? void 0 : _a.played) == null ? void 0 : _b.length)) {
|
|
22333
|
+
return 0;
|
|
22334
|
+
}
|
|
22335
|
+
const length = this._player.played.length;
|
|
22336
|
+
let time = 0;
|
|
22337
|
+
for (let index = 0; index < length; index++) {
|
|
22338
|
+
const start = (_c = this._player) == null ? void 0 : _c.played.start(index);
|
|
22339
|
+
const end = (_d = this._player) == null ? void 0 : _d.played.end(index);
|
|
22340
|
+
time += end - start;
|
|
22341
|
+
}
|
|
22342
|
+
return time;
|
|
22343
|
+
}
|
|
22344
|
+
getPlayerVersion() {
|
|
22345
|
+
return "2.4.0-rc.2";
|
|
22346
|
+
}
|
|
22347
|
+
getRTMNetWorkInfo() {
|
|
22348
|
+
var _a, _b, _c;
|
|
22349
|
+
return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.rts) == null ? void 0 : _c.getNetWorkInfo();
|
|
22350
|
+
}
|
|
22351
|
+
getFLVStats() {
|
|
22352
|
+
var _a, _b, _c;
|
|
22353
|
+
return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.flv) == null ? void 0 : _c.getStats();
|
|
22354
|
+
}
|
|
22305
22355
|
}
|
|
22306
22356
|
async function createLivePlayer(options) {
|
|
22307
22357
|
var _a, _b;
|