@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/umd/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
|
|
@@ -13873,7 +13873,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13873
13873
|
var _a, _b;
|
|
13874
13874
|
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) {
|
|
13875
13875
|
this._sourceManager.updateSources(target);
|
|
13876
|
-
await this._switchUrl(target);
|
|
13876
|
+
await this._switchUrl(target, { seamless: options == null ? void 0 : options.seamless });
|
|
13877
13877
|
return this._sourceManager.definition;
|
|
13878
13878
|
}
|
|
13879
13879
|
const targetDefinition = this._sourceManager.find(target, options);
|
|
@@ -14059,6 +14059,9 @@ var __publicField = (obj, key, value) => {
|
|
|
14059
14059
|
blur(data) {
|
|
14060
14060
|
return this._player.blur(data);
|
|
14061
14061
|
}
|
|
14062
|
+
canPlayType(type) {
|
|
14063
|
+
return this._player.canPlayType(type);
|
|
14064
|
+
}
|
|
14062
14065
|
/** {zh}
|
|
14063
14066
|
* @brief 调用此方法进入系统全屏状态。如果该方法调用的时候处于网页全屏状态会自动退出网页全屏,下发事件 `Events.FULLSCREEN_CHANGE`。
|
|
14064
14067
|
* @param el 全屏作用的 DOM 节点。
|
|
@@ -14256,14 +14259,16 @@ var __publicField = (obj, key, value) => {
|
|
|
14256
14259
|
this._player.changeDefinition(targetDefinition, preDefinition);
|
|
14257
14260
|
}
|
|
14258
14261
|
}
|
|
14259
|
-
async _switchUrl(url) {
|
|
14262
|
+
async _switchUrl(url, config) {
|
|
14260
14263
|
const { plugins: newPlugins, options } = await this.prepare(url) || {};
|
|
14261
14264
|
const newUrl = (options == null ? void 0 : options.url) ?? url;
|
|
14262
14265
|
this._sourceManager.url = newUrl;
|
|
14263
14266
|
if (newPlugins == null ? void 0 : newPlugins.length) {
|
|
14264
14267
|
this._callBeforePlayerInitForUrl(newPlugins, newUrl);
|
|
14265
14268
|
} else {
|
|
14266
|
-
const res = this._player.switchURL(newUrl,
|
|
14269
|
+
const res = this._player.switchURL(newUrl, {
|
|
14270
|
+
seamless: config == null ? void 0 : config.seamless
|
|
14271
|
+
});
|
|
14267
14272
|
const curTime = this._player.currentTime;
|
|
14268
14273
|
if (res && res.then) {
|
|
14269
14274
|
return res;
|
|
@@ -21894,10 +21899,10 @@ var __publicField = (obj, key, value) => {
|
|
|
21894
21899
|
user_id: this._userId,
|
|
21895
21900
|
device_id: this._deviceId,
|
|
21896
21901
|
ext: {
|
|
21897
|
-
veplayer_version: "2.4.0-rc.
|
|
21898
|
-
flv_version: "3.0.
|
|
21902
|
+
veplayer_version: "2.4.0-rc.2",
|
|
21903
|
+
flv_version: "3.0.18-alpha.3",
|
|
21899
21904
|
hls_version: "3.0.17",
|
|
21900
|
-
rts_version: "0.2.
|
|
21905
|
+
rts_version: "0.2.1-alpha.0"
|
|
21901
21906
|
}
|
|
21902
21907
|
});
|
|
21903
21908
|
}
|
|
@@ -22203,7 +22208,10 @@ var __publicField = (obj, key, value) => {
|
|
|
22203
22208
|
const abrPlugin = await load(DynamicModule.PluginAbr).catch(() => void 0);
|
|
22204
22209
|
return {
|
|
22205
22210
|
options: {
|
|
22206
|
-
[streamType === "flv" ? "abr" : "hlsabr"]:
|
|
22211
|
+
[streamType === "flv" ? "abr" : "hlsabr"]: {
|
|
22212
|
+
...abrOptions,
|
|
22213
|
+
open: abrOptions.enable ?? true
|
|
22214
|
+
}
|
|
22207
22215
|
},
|
|
22208
22216
|
plugins: [
|
|
22209
22217
|
streamType === "flv" ? abrPlugin == null ? void 0 : abrPlugin.AbrPlugin : abrPlugin == null ? void 0 : abrPlugin.HlsAbrPlugin
|
|
@@ -22298,6 +22306,23 @@ var __publicField = (obj, key, value) => {
|
|
|
22298
22306
|
var _a, _b, _c;
|
|
22299
22307
|
(_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.drm) == null ? void 0 : _c.updateDrmConfig(config);
|
|
22300
22308
|
}
|
|
22309
|
+
switchAbr({ enable, bitrate }) {
|
|
22310
|
+
var _a, _b;
|
|
22311
|
+
if (!((_a = this._player.plugins) == null ? void 0 : _a.abr)) {
|
|
22312
|
+
return;
|
|
22313
|
+
}
|
|
22314
|
+
if (typeof bitrate !== "undefined") {
|
|
22315
|
+
const url = this._player.plugins.abr.config.urls[bitrate];
|
|
22316
|
+
if (!url) {
|
|
22317
|
+
return;
|
|
22318
|
+
}
|
|
22319
|
+
this.switch(url, { seamless: true });
|
|
22320
|
+
this._player.plugins.abr.bitrate = bitrate;
|
|
22321
|
+
}
|
|
22322
|
+
if (typeof enable !== "undefined") {
|
|
22323
|
+
(_b = this._player.plugins) == null ? void 0 : _b.abr.switchAbr(enable);
|
|
22324
|
+
}
|
|
22325
|
+
}
|
|
22301
22326
|
async switch(target, options) {
|
|
22302
22327
|
var _a, _b, _c;
|
|
22303
22328
|
const { abr, ...rest } = options ?? {};
|
|
@@ -22306,6 +22331,31 @@ var __publicField = (obj, key, value) => {
|
|
|
22306
22331
|
}
|
|
22307
22332
|
return super.switch(target, rest);
|
|
22308
22333
|
}
|
|
22334
|
+
getPlayTime() {
|
|
22335
|
+
var _a, _b, _c, _d;
|
|
22336
|
+
if (!((_b = (_a = this._player) == null ? void 0 : _a.played) == null ? void 0 : _b.length)) {
|
|
22337
|
+
return 0;
|
|
22338
|
+
}
|
|
22339
|
+
const length = this._player.played.length;
|
|
22340
|
+
let time = 0;
|
|
22341
|
+
for (let index = 0; index < length; index++) {
|
|
22342
|
+
const start = (_c = this._player) == null ? void 0 : _c.played.start(index);
|
|
22343
|
+
const end = (_d = this._player) == null ? void 0 : _d.played.end(index);
|
|
22344
|
+
time += end - start;
|
|
22345
|
+
}
|
|
22346
|
+
return time;
|
|
22347
|
+
}
|
|
22348
|
+
getPlayerVersion() {
|
|
22349
|
+
return "2.4.0-rc.2";
|
|
22350
|
+
}
|
|
22351
|
+
getRTMNetWorkInfo() {
|
|
22352
|
+
var _a, _b, _c;
|
|
22353
|
+
return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.rts) == null ? void 0 : _c.getNetWorkInfo();
|
|
22354
|
+
}
|
|
22355
|
+
getFLVStats() {
|
|
22356
|
+
var _a, _b, _c;
|
|
22357
|
+
return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.flv) == null ? void 0 : _c.getStats();
|
|
22358
|
+
}
|
|
22309
22359
|
}
|
|
22310
22360
|
async function createLivePlayer(options) {
|
|
22311
22361
|
var _a, _b;
|
package/umd/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
|
|
@@ -13873,7 +13873,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13873
13873
|
var _a, _b;
|
|
13874
13874
|
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) {
|
|
13875
13875
|
this._sourceManager.updateSources(target);
|
|
13876
|
-
await this._switchUrl(target);
|
|
13876
|
+
await this._switchUrl(target, { seamless: options == null ? void 0 : options.seamless });
|
|
13877
13877
|
return this._sourceManager.definition;
|
|
13878
13878
|
}
|
|
13879
13879
|
const targetDefinition = this._sourceManager.find(target, options);
|
|
@@ -14059,6 +14059,9 @@ var __publicField = (obj, key, value) => {
|
|
|
14059
14059
|
blur(data) {
|
|
14060
14060
|
return this._player.blur(data);
|
|
14061
14061
|
}
|
|
14062
|
+
canPlayType(type) {
|
|
14063
|
+
return this._player.canPlayType(type);
|
|
14064
|
+
}
|
|
14062
14065
|
/** {zh}
|
|
14063
14066
|
* @brief 调用此方法进入系统全屏状态。如果该方法调用的时候处于网页全屏状态会自动退出网页全屏,下发事件 `Events.FULLSCREEN_CHANGE`。
|
|
14064
14067
|
* @param el 全屏作用的 DOM 节点。
|
|
@@ -14256,14 +14259,16 @@ var __publicField = (obj, key, value) => {
|
|
|
14256
14259
|
this._player.changeDefinition(targetDefinition, preDefinition);
|
|
14257
14260
|
}
|
|
14258
14261
|
}
|
|
14259
|
-
async _switchUrl(url) {
|
|
14262
|
+
async _switchUrl(url, config) {
|
|
14260
14263
|
const { plugins: newPlugins, options } = await this.prepare(url) || {};
|
|
14261
14264
|
const newUrl = (options == null ? void 0 : options.url) ?? url;
|
|
14262
14265
|
this._sourceManager.url = newUrl;
|
|
14263
14266
|
if (newPlugins == null ? void 0 : newPlugins.length) {
|
|
14264
14267
|
this._callBeforePlayerInitForUrl(newPlugins, newUrl);
|
|
14265
14268
|
} else {
|
|
14266
|
-
const res = this._player.switchURL(newUrl,
|
|
14269
|
+
const res = this._player.switchURL(newUrl, {
|
|
14270
|
+
seamless: config == null ? void 0 : config.seamless
|
|
14271
|
+
});
|
|
14267
14272
|
const curTime = this._player.currentTime;
|
|
14268
14273
|
if (res && res.then) {
|
|
14269
14274
|
return res;
|
|
@@ -21894,10 +21899,10 @@ var __publicField = (obj, key, value) => {
|
|
|
21894
21899
|
user_id: this._userId,
|
|
21895
21900
|
device_id: this._deviceId,
|
|
21896
21901
|
ext: {
|
|
21897
|
-
veplayer_version: "2.4.0-rc.
|
|
21898
|
-
flv_version: "3.0.
|
|
21902
|
+
veplayer_version: "2.4.0-rc.2",
|
|
21903
|
+
flv_version: "3.0.18-alpha.3",
|
|
21899
21904
|
hls_version: "3.0.17",
|
|
21900
|
-
rts_version: "0.2.
|
|
21905
|
+
rts_version: "0.2.1-alpha.0"
|
|
21901
21906
|
}
|
|
21902
21907
|
});
|
|
21903
21908
|
}
|
|
@@ -22203,7 +22208,10 @@ var __publicField = (obj, key, value) => {
|
|
|
22203
22208
|
const abrPlugin = await load(DynamicModule.PluginAbr).catch(() => void 0);
|
|
22204
22209
|
return {
|
|
22205
22210
|
options: {
|
|
22206
|
-
[streamType === "flv" ? "abr" : "hlsabr"]:
|
|
22211
|
+
[streamType === "flv" ? "abr" : "hlsabr"]: {
|
|
22212
|
+
...abrOptions,
|
|
22213
|
+
open: abrOptions.enable ?? true
|
|
22214
|
+
}
|
|
22207
22215
|
},
|
|
22208
22216
|
plugins: [
|
|
22209
22217
|
streamType === "flv" ? abrPlugin == null ? void 0 : abrPlugin.AbrPlugin : abrPlugin == null ? void 0 : abrPlugin.HlsAbrPlugin
|
|
@@ -22298,6 +22306,23 @@ var __publicField = (obj, key, value) => {
|
|
|
22298
22306
|
var _a, _b, _c;
|
|
22299
22307
|
(_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.drm) == null ? void 0 : _c.updateDrmConfig(config);
|
|
22300
22308
|
}
|
|
22309
|
+
switchAbr({ enable, bitrate }) {
|
|
22310
|
+
var _a, _b;
|
|
22311
|
+
if (!((_a = this._player.plugins) == null ? void 0 : _a.abr)) {
|
|
22312
|
+
return;
|
|
22313
|
+
}
|
|
22314
|
+
if (typeof bitrate !== "undefined") {
|
|
22315
|
+
const url = this._player.plugins.abr.config.urls[bitrate];
|
|
22316
|
+
if (!url) {
|
|
22317
|
+
return;
|
|
22318
|
+
}
|
|
22319
|
+
this.switch(url, { seamless: true });
|
|
22320
|
+
this._player.plugins.abr.bitrate = bitrate;
|
|
22321
|
+
}
|
|
22322
|
+
if (typeof enable !== "undefined") {
|
|
22323
|
+
(_b = this._player.plugins) == null ? void 0 : _b.abr.switchAbr(enable);
|
|
22324
|
+
}
|
|
22325
|
+
}
|
|
22301
22326
|
async switch(target, options) {
|
|
22302
22327
|
var _a, _b, _c;
|
|
22303
22328
|
const { abr, ...rest } = options ?? {};
|
|
@@ -22306,6 +22331,31 @@ var __publicField = (obj, key, value) => {
|
|
|
22306
22331
|
}
|
|
22307
22332
|
return super.switch(target, rest);
|
|
22308
22333
|
}
|
|
22334
|
+
getPlayTime() {
|
|
22335
|
+
var _a, _b, _c, _d;
|
|
22336
|
+
if (!((_b = (_a = this._player) == null ? void 0 : _a.played) == null ? void 0 : _b.length)) {
|
|
22337
|
+
return 0;
|
|
22338
|
+
}
|
|
22339
|
+
const length = this._player.played.length;
|
|
22340
|
+
let time = 0;
|
|
22341
|
+
for (let index = 0; index < length; index++) {
|
|
22342
|
+
const start = (_c = this._player) == null ? void 0 : _c.played.start(index);
|
|
22343
|
+
const end = (_d = this._player) == null ? void 0 : _d.played.end(index);
|
|
22344
|
+
time += end - start;
|
|
22345
|
+
}
|
|
22346
|
+
return time;
|
|
22347
|
+
}
|
|
22348
|
+
getPlayerVersion() {
|
|
22349
|
+
return "2.4.0-rc.2";
|
|
22350
|
+
}
|
|
22351
|
+
getRTMNetWorkInfo() {
|
|
22352
|
+
var _a, _b, _c;
|
|
22353
|
+
return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.rts) == null ? void 0 : _c.getNetWorkInfo();
|
|
22354
|
+
}
|
|
22355
|
+
getFLVStats() {
|
|
22356
|
+
var _a, _b, _c;
|
|
22357
|
+
return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.flv) == null ? void 0 : _c.getStats();
|
|
22358
|
+
}
|
|
22309
22359
|
}
|
|
22310
22360
|
async function createLivePlayer(options) {
|
|
22311
22361
|
var _a, _b;
|