@volcengine/veplayer 2.12.1 → 2.13.1-rc.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/esm/veplayer.biz.live.development.js +156 -8
- package/esm/veplayer.biz.live.production.js +1 -1
- package/esm/veplayer.d.ts +86 -4
- package/esm/veplayer.development.js +157 -9
- package/esm/veplayer.live.d.ts +86 -4
- package/esm/veplayer.live.development.js +157 -9
- package/esm/veplayer.live.production.js +3 -3
- package/esm/veplayer.production.js +3 -3
- package/esm/veplayer.vod.development.js +1 -1
- package/esm/veplayer.vod.production.js +1 -1
- package/package.json +1 -1
- package/umd/veplayer.biz.live.development.js +156 -8
- package/umd/veplayer.biz.live.production.js +1 -1
- package/umd/veplayer.d.ts +86 -4
- package/umd/veplayer.development.js +157 -9
- package/umd/veplayer.live.d.ts +86 -4
- package/umd/veplayer.live.development.js +157 -9
- package/umd/veplayer.live.production.js +1 -1
- package/umd/veplayer.production.js +1 -1
- package/umd/veplayer.vod.development.js +1 -1
- package/umd/veplayer.vod.production.js +1 -1
- package/veplayer.d.ts +86 -4
- package/veplayer.live.d.ts +86 -4
package/esm/veplayer.d.ts
CHANGED
|
@@ -6217,6 +6217,7 @@ interface PrepareOptions {
|
|
|
6217
6217
|
logger?: LoggerConfig;
|
|
6218
6218
|
}
|
|
6219
6219
|
interface LiveEN {
|
|
6220
|
+
INVALID_PARAMETER: string;
|
|
6220
6221
|
ERROR_TYPES?: any;
|
|
6221
6222
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
6222
6223
|
[key: string]: string | unknown;
|
|
@@ -7058,9 +7059,11 @@ interface Rtm {
|
|
|
7058
7059
|
checkStatsErrorDelay?: number;
|
|
7059
7060
|
/** {zh}
|
|
7060
7061
|
* @brief 是否打开 RTM SEI
|
|
7062
|
+
* @default true
|
|
7061
7063
|
*/
|
|
7062
7064
|
/** {en}
|
|
7063
7065
|
* @brief enable RTM SEI data.
|
|
7066
|
+
* @default true
|
|
7064
7067
|
*/
|
|
7065
7068
|
enableSei?: boolean;
|
|
7066
7069
|
}
|
|
@@ -7305,6 +7308,32 @@ interface RTMNetWorkInfo {
|
|
|
7305
7308
|
*/
|
|
7306
7309
|
avgLostRate?: number;
|
|
7307
7310
|
}
|
|
7311
|
+
/** {zh}
|
|
7312
|
+
* @list option
|
|
7313
|
+
* @kind property
|
|
7314
|
+
* @brief 服务端 SEI 延迟统计。
|
|
7315
|
+
*/
|
|
7316
|
+
/** {en}
|
|
7317
|
+
* @list option
|
|
7318
|
+
* @kind property
|
|
7319
|
+
* @brief Server SEI delay statistics.
|
|
7320
|
+
*/
|
|
7321
|
+
interface SEIDelayStats {
|
|
7322
|
+
/** {zh}
|
|
7323
|
+
* @brief 服务端链路延迟,单位为毫秒。没有有效的服务端 SEI 数据时为空。
|
|
7324
|
+
*/
|
|
7325
|
+
/** {en}
|
|
7326
|
+
* @brief Server-side transfer delay in milliseconds. Empty when valid server SEI data is unavailable.
|
|
7327
|
+
*/
|
|
7328
|
+
delay_s2s?: number;
|
|
7329
|
+
/** {zh}
|
|
7330
|
+
* @brief 推流端到播放端的延迟,单位为毫秒。没有有效的服务端 SEI 数据时为空。
|
|
7331
|
+
*/
|
|
7332
|
+
/** {en}
|
|
7333
|
+
* @brief Stream-to-end playback delay in milliseconds. Empty when valid server SEI data is unavailable.
|
|
7334
|
+
*/
|
|
7335
|
+
delay_s2e?: number;
|
|
7336
|
+
}
|
|
7308
7337
|
/** {zh}
|
|
7309
7338
|
* @list option
|
|
7310
7339
|
* @kind property
|
|
@@ -7315,7 +7344,7 @@ interface RTMNetWorkInfo {
|
|
|
7315
7344
|
* @kind property
|
|
7316
7345
|
* @brief RTM live stream information.
|
|
7317
7346
|
*/
|
|
7318
|
-
interface StatsSnapShoot {
|
|
7347
|
+
interface StatsSnapShoot extends SEIDelayStats {
|
|
7319
7348
|
/** {en}
|
|
7320
7349
|
* @brief Video information.
|
|
7321
7350
|
*/
|
|
@@ -7546,7 +7575,7 @@ interface StatsSnapShoot {
|
|
|
7546
7575
|
* @kind property
|
|
7547
7576
|
* @brief Basic information for live stream playback.
|
|
7548
7577
|
*/
|
|
7549
|
-
interface Stats$0 {
|
|
7578
|
+
interface Stats$0 extends SEIDelayStats {
|
|
7550
7579
|
/** {zh}
|
|
7551
7580
|
* @brief 音频格式。
|
|
7552
7581
|
* @hidden
|
|
@@ -7704,6 +7733,7 @@ declare class VePlayerLive extends VePlayerBase {
|
|
|
7704
7733
|
* @hidden
|
|
7705
7734
|
*/
|
|
7706
7735
|
_protocolManager?: ProtocolManager;
|
|
7736
|
+
private _seiDelayStats;
|
|
7707
7737
|
/** {zh}
|
|
7708
7738
|
* @hidden
|
|
7709
7739
|
* @param options
|
|
@@ -7734,6 +7764,13 @@ declare class VePlayerLive extends VePlayerBase {
|
|
|
7734
7764
|
* @hidden
|
|
7735
7765
|
*/
|
|
7736
7766
|
get hls(): any;
|
|
7767
|
+
/** {zh}
|
|
7768
|
+
* @hidden
|
|
7769
|
+
*/
|
|
7770
|
+
/** {en}
|
|
7771
|
+
* @hidden
|
|
7772
|
+
*/
|
|
7773
|
+
destroy(): void;
|
|
7737
7774
|
/** {zh}
|
|
7738
7775
|
* @brief 调用此方法开启直播日志上报。
|
|
7739
7776
|
*/
|
|
@@ -7886,6 +7923,10 @@ declare class VePlayerLive extends VePlayerBase {
|
|
|
7886
7923
|
*/
|
|
7887
7924
|
source?: string;
|
|
7888
7925
|
}, needUpdateProtocol?: boolean): Promise<void>;
|
|
7926
|
+
private _resetSEIDelayStats;
|
|
7927
|
+
private _handleSEI;
|
|
7928
|
+
private _getPlayerBufferTime;
|
|
7929
|
+
private _mergeSEIDelayStats;
|
|
7889
7930
|
}
|
|
7890
7931
|
/** {zh}
|
|
7891
7932
|
* @detail api
|
|
@@ -11539,6 +11580,7 @@ declare namespace live {
|
|
|
11539
11580
|
logger?: LoggerConfig;
|
|
11540
11581
|
}
|
|
11541
11582
|
interface LiveEN {
|
|
11583
|
+
INVALID_PARAMETER: string;
|
|
11542
11584
|
ERROR_TYPES?: any;
|
|
11543
11585
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
11544
11586
|
[key: string]: string | unknown;
|
|
@@ -12390,9 +12432,11 @@ declare namespace live {
|
|
|
12390
12432
|
checkStatsErrorDelay?: number;
|
|
12391
12433
|
/** {zh}
|
|
12392
12434
|
* @brief 是否打开 RTM SEI
|
|
12435
|
+
* @default true
|
|
12393
12436
|
*/
|
|
12394
12437
|
/** {en}
|
|
12395
12438
|
* @brief enable RTM SEI data.
|
|
12439
|
+
* @default true
|
|
12396
12440
|
*/
|
|
12397
12441
|
enableSei?: boolean;
|
|
12398
12442
|
}
|
|
@@ -12637,6 +12681,32 @@ declare namespace live {
|
|
|
12637
12681
|
*/
|
|
12638
12682
|
avgLostRate?: number;
|
|
12639
12683
|
}
|
|
12684
|
+
/** {zh}
|
|
12685
|
+
* @list option
|
|
12686
|
+
* @kind property
|
|
12687
|
+
* @brief 服务端 SEI 延迟统计。
|
|
12688
|
+
*/
|
|
12689
|
+
/** {en}
|
|
12690
|
+
* @list option
|
|
12691
|
+
* @kind property
|
|
12692
|
+
* @brief Server SEI delay statistics.
|
|
12693
|
+
*/
|
|
12694
|
+
interface SEIDelayStats {
|
|
12695
|
+
/** {zh}
|
|
12696
|
+
* @brief 服务端链路延迟,单位为毫秒。没有有效的服务端 SEI 数据时为空。
|
|
12697
|
+
*/
|
|
12698
|
+
/** {en}
|
|
12699
|
+
* @brief Server-side transfer delay in milliseconds. Empty when valid server SEI data is unavailable.
|
|
12700
|
+
*/
|
|
12701
|
+
delay_s2s?: number;
|
|
12702
|
+
/** {zh}
|
|
12703
|
+
* @brief 推流端到播放端的延迟,单位为毫秒。没有有效的服务端 SEI 数据时为空。
|
|
12704
|
+
*/
|
|
12705
|
+
/** {en}
|
|
12706
|
+
* @brief Stream-to-end playback delay in milliseconds. Empty when valid server SEI data is unavailable.
|
|
12707
|
+
*/
|
|
12708
|
+
delay_s2e?: number;
|
|
12709
|
+
}
|
|
12640
12710
|
/** {zh}
|
|
12641
12711
|
* @list option
|
|
12642
12712
|
* @kind property
|
|
@@ -12647,7 +12717,7 @@ declare namespace live {
|
|
|
12647
12717
|
* @kind property
|
|
12648
12718
|
* @brief RTM live stream information.
|
|
12649
12719
|
*/
|
|
12650
|
-
interface StatsSnapShoot {
|
|
12720
|
+
interface StatsSnapShoot extends SEIDelayStats {
|
|
12651
12721
|
/** {en}
|
|
12652
12722
|
* @brief Video information.
|
|
12653
12723
|
*/
|
|
@@ -12878,7 +12948,7 @@ declare namespace live {
|
|
|
12878
12948
|
* @kind property
|
|
12879
12949
|
* @brief Basic information for live stream playback.
|
|
12880
12950
|
*/
|
|
12881
|
-
interface Stats$0 {
|
|
12951
|
+
interface Stats$0 extends SEIDelayStats {
|
|
12882
12952
|
/** {zh}
|
|
12883
12953
|
* @brief 音频格式。
|
|
12884
12954
|
* @hidden
|
|
@@ -13036,6 +13106,7 @@ declare namespace live {
|
|
|
13036
13106
|
* @hidden
|
|
13037
13107
|
*/
|
|
13038
13108
|
_protocolManager?: ProtocolManager;
|
|
13109
|
+
private _seiDelayStats;
|
|
13039
13110
|
/** {zh}
|
|
13040
13111
|
* @hidden
|
|
13041
13112
|
* @param options
|
|
@@ -13066,6 +13137,13 @@ declare namespace live {
|
|
|
13066
13137
|
* @hidden
|
|
13067
13138
|
*/
|
|
13068
13139
|
get hls(): any;
|
|
13140
|
+
/** {zh}
|
|
13141
|
+
* @hidden
|
|
13142
|
+
*/
|
|
13143
|
+
/** {en}
|
|
13144
|
+
* @hidden
|
|
13145
|
+
*/
|
|
13146
|
+
destroy(): void;
|
|
13069
13147
|
/** {zh}
|
|
13070
13148
|
* @brief 调用此方法开启直播日志上报。
|
|
13071
13149
|
*/
|
|
@@ -13218,6 +13296,10 @@ declare namespace live {
|
|
|
13218
13296
|
*/
|
|
13219
13297
|
source?: string;
|
|
13220
13298
|
}, needUpdateProtocol?: boolean): Promise<void>;
|
|
13299
|
+
private _resetSEIDelayStats;
|
|
13300
|
+
private _handleSEI;
|
|
13301
|
+
private _getPlayerBufferTime;
|
|
13302
|
+
private _mergeSEIDelayStats;
|
|
13221
13303
|
}
|
|
13222
13304
|
/** {zh}
|
|
13223
13305
|
* @detail api
|
|
@@ -14711,7 +14711,7 @@ class VePlayerBase {
|
|
|
14711
14711
|
* @brief Retrieve the player SDK version number.
|
|
14712
14712
|
*/
|
|
14713
14713
|
get playerVersion() {
|
|
14714
|
-
return "2.
|
|
14714
|
+
return "2.13.1-rc.0";
|
|
14715
14715
|
}
|
|
14716
14716
|
/** {zh}
|
|
14717
14717
|
* @brief 获取当前播放视频的清晰度唯一标识(definition)。
|
|
@@ -56506,7 +56506,7 @@ let Logger$1 = class Logger2 extends Plugin {
|
|
|
56506
56506
|
device_id: deviceId,
|
|
56507
56507
|
error_report_stop: true,
|
|
56508
56508
|
ext: {
|
|
56509
|
-
veplayer_version: "2.
|
|
56509
|
+
veplayer_version: "2.13.1-rc.0",
|
|
56510
56510
|
flv_version: "3.0.24-rc.6",
|
|
56511
56511
|
hls_version: "3.0.24-rc.2",
|
|
56512
56512
|
rts_version: "0.2.1-alpha.64"
|
|
@@ -56520,7 +56520,6 @@ function normalizeNumber(value, transform2) {
|
|
|
56520
56520
|
return transform2 ? transform2(value) : value.toString();
|
|
56521
56521
|
}
|
|
56522
56522
|
function getDefaultRow(data2) {
|
|
56523
|
-
var _a;
|
|
56524
56523
|
return {
|
|
56525
56524
|
rows: [
|
|
56526
56525
|
{
|
|
@@ -56561,7 +56560,10 @@ function getDefaultRow(data2) {
|
|
|
56561
56560
|
{
|
|
56562
56561
|
key: "bufferEnd",
|
|
56563
56562
|
labelTextKey: "BUFFER_END",
|
|
56564
|
-
value: normalizeNumber(
|
|
56563
|
+
value: normalizeNumber(
|
|
56564
|
+
data2.bufferEnd,
|
|
56565
|
+
(value) => Number(value.toFixed(2)).toString()
|
|
56566
|
+
)
|
|
56565
56567
|
},
|
|
56566
56568
|
{
|
|
56567
56569
|
key: "currentTime",
|
|
@@ -73902,6 +73904,79 @@ class LiveVeStrategy {
|
|
|
73902
73904
|
}
|
|
73903
73905
|
}
|
|
73904
73906
|
const liveVeStrategy = new LiveVeStrategy();
|
|
73907
|
+
const isNumber = (value) => typeof value === "number" && Number.isFinite(value);
|
|
73908
|
+
const getTimestamp = (delaySEI, currentKey, legacyKey) => {
|
|
73909
|
+
const currentValue = delaySEI[currentKey];
|
|
73910
|
+
if (isNumber(currentValue)) {
|
|
73911
|
+
return currentValue;
|
|
73912
|
+
}
|
|
73913
|
+
const legacyValue = delaySEI[legacyKey];
|
|
73914
|
+
return isNumber(legacyValue) ? legacyValue : void 0;
|
|
73915
|
+
};
|
|
73916
|
+
const utf8ArrayToString = (array) => {
|
|
73917
|
+
let result = "";
|
|
73918
|
+
let index = 0;
|
|
73919
|
+
while (index < array.length) {
|
|
73920
|
+
const first = array[index++];
|
|
73921
|
+
if (first < 128) {
|
|
73922
|
+
result += String.fromCharCode(first);
|
|
73923
|
+
} else if (first < 224) {
|
|
73924
|
+
const second = array[index++];
|
|
73925
|
+
result += String.fromCharCode((first & 31) << 6 | second & 63);
|
|
73926
|
+
} else {
|
|
73927
|
+
const second = array[index++];
|
|
73928
|
+
const third = array[index++];
|
|
73929
|
+
result += String.fromCharCode(
|
|
73930
|
+
(first & 15) << 12 | (second & 63) << 6 | third & 63
|
|
73931
|
+
);
|
|
73932
|
+
}
|
|
73933
|
+
}
|
|
73934
|
+
return result;
|
|
73935
|
+
};
|
|
73936
|
+
const getSEIDelayStats = (sei, bufferTime = 0, now3 = Date.now()) => {
|
|
73937
|
+
if ((sei == null ? void 0 : sei.code) !== 100 || !sei.content) {
|
|
73938
|
+
return;
|
|
73939
|
+
}
|
|
73940
|
+
try {
|
|
73941
|
+
const rawSEI = utf8ArrayToString(sei.content);
|
|
73942
|
+
const jsonStart = rawSEI.indexOf("{");
|
|
73943
|
+
const jsonEnd = rawSEI.lastIndexOf("}");
|
|
73944
|
+
if (jsonStart < 0 || jsonEnd < jsonStart) {
|
|
73945
|
+
return;
|
|
73946
|
+
}
|
|
73947
|
+
const seiContent = JSON.parse(rawSEI.slice(jsonStart, jsonEnd + 1));
|
|
73948
|
+
const delaySEI = seiContent == null ? void 0 : seiContent.video_e2e_delay;
|
|
73949
|
+
if (!delaySEI || typeof delaySEI !== "object") {
|
|
73950
|
+
return;
|
|
73951
|
+
}
|
|
73952
|
+
const push3 = getTimestamp(delaySEI, "push_edge_ts", "push_node");
|
|
73953
|
+
const source = getTimestamp(delaySEI, "source_ts", "source_node");
|
|
73954
|
+
const cmafSource = getTimestamp(
|
|
73955
|
+
delaySEI,
|
|
73956
|
+
"cmaf_source_ts",
|
|
73957
|
+
"cmaf_source_node"
|
|
73958
|
+
);
|
|
73959
|
+
const hlsSource = getTimestamp(
|
|
73960
|
+
delaySEI,
|
|
73961
|
+
"hls_source_ts",
|
|
73962
|
+
"hls_source_node"
|
|
73963
|
+
);
|
|
73964
|
+
const pull = getTimestamp(delaySEI, "pull_edge_ts", "pull_node");
|
|
73965
|
+
const start = push3 ?? source;
|
|
73966
|
+
const end = pull ?? hlsSource ?? cmafSource;
|
|
73967
|
+
if (!isNumber(start) || !isNumber(end)) {
|
|
73968
|
+
return;
|
|
73969
|
+
}
|
|
73970
|
+
const delayS2S = end - start;
|
|
73971
|
+
const safeBufferTime = isNumber(bufferTime) ? Math.max(0, bufferTime) : 0;
|
|
73972
|
+
return {
|
|
73973
|
+
delay_s2s: delayS2S,
|
|
73974
|
+
delay_s2e: delayS2S + Math.max(0, now3 - end) + safeBufferTime
|
|
73975
|
+
};
|
|
73976
|
+
} catch (e2) {
|
|
73977
|
+
return;
|
|
73978
|
+
}
|
|
73979
|
+
};
|
|
73905
73980
|
VeI18n.extend([
|
|
73906
73981
|
{
|
|
73907
73982
|
LANG: "zh-cn",
|
|
@@ -73940,6 +74015,22 @@ class VePlayerLive extends VePlayerBase {
|
|
|
73940
74015
|
* @hidden
|
|
73941
74016
|
*/
|
|
73942
74017
|
__publicField(this, "_protocolManager");
|
|
74018
|
+
__publicField(this, "_seiDelayStats", {});
|
|
74019
|
+
__publicField(this, "_resetSEIDelayStats", () => {
|
|
74020
|
+
this._seiDelayStats = {};
|
|
74021
|
+
});
|
|
74022
|
+
__publicField(this, "_handleSEI", (data2) => {
|
|
74023
|
+
const stats = getSEIDelayStats(data2 == null ? void 0 : data2.sei, this._getPlayerBufferTime());
|
|
74024
|
+
if (stats) {
|
|
74025
|
+
this._seiDelayStats = stats;
|
|
74026
|
+
}
|
|
74027
|
+
});
|
|
74028
|
+
this.on(Events.SEI, this._handleSEI);
|
|
74029
|
+
this.on(Events.URL_CHANGE, this._resetSEIDelayStats);
|
|
74030
|
+
this.on(Events.SOURCE_CHANGE, this._resetSEIDelayStats);
|
|
74031
|
+
this.on(Events.DEFINITION_CHANGE, this._resetSEIDelayStats);
|
|
74032
|
+
this.on(Events.REPLAY, this._resetSEIDelayStats);
|
|
74033
|
+
this.on(Events.FALLBACK, this._resetSEIDelayStats);
|
|
73943
74034
|
}
|
|
73944
74035
|
/** {zh}
|
|
73945
74036
|
* @brief 获取已经播放的时长,不包含暂停和等待时间,单位为秒。
|
|
@@ -73981,6 +74072,22 @@ class VePlayerLive extends VePlayerBase {
|
|
|
73981
74072
|
var _a, _b;
|
|
73982
74073
|
return (_b = (_a = this._player.plugins) == null ? void 0 : _a.hls) == null ? void 0 : _b.hls;
|
|
73983
74074
|
}
|
|
74075
|
+
/** {zh}
|
|
74076
|
+
* @hidden
|
|
74077
|
+
*/
|
|
74078
|
+
/** {en}
|
|
74079
|
+
* @hidden
|
|
74080
|
+
*/
|
|
74081
|
+
destroy() {
|
|
74082
|
+
this.off(Events.SEI, this._handleSEI);
|
|
74083
|
+
this.off(Events.URL_CHANGE, this._resetSEIDelayStats);
|
|
74084
|
+
this.off(Events.SOURCE_CHANGE, this._resetSEIDelayStats);
|
|
74085
|
+
this.off(Events.DEFINITION_CHANGE, this._resetSEIDelayStats);
|
|
74086
|
+
this.off(Events.REPLAY, this._resetSEIDelayStats);
|
|
74087
|
+
this.off(Events.FALLBACK, this._resetSEIDelayStats);
|
|
74088
|
+
this._resetSEIDelayStats();
|
|
74089
|
+
super.destroy();
|
|
74090
|
+
}
|
|
73984
74091
|
/** {zh}
|
|
73985
74092
|
* @brief 调用此方法开启直播日志上报。
|
|
73986
74093
|
*/
|
|
@@ -74117,7 +74224,8 @@ class VePlayerLive extends VePlayerBase {
|
|
|
74117
74224
|
*/
|
|
74118
74225
|
async getRTMStats() {
|
|
74119
74226
|
var _a, _b, _c;
|
|
74120
|
-
|
|
74227
|
+
const stats = await ((_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.rts) == null ? void 0 : _c.getStatsSnapshoot());
|
|
74228
|
+
return this._mergeSEIDelayStats(stats);
|
|
74121
74229
|
}
|
|
74122
74230
|
/** {zh}
|
|
74123
74231
|
* @brief 获取 FLV 拉流的播放信息。
|
|
@@ -74128,7 +74236,8 @@ class VePlayerLive extends VePlayerBase {
|
|
|
74128
74236
|
*/
|
|
74129
74237
|
getFLVStats() {
|
|
74130
74238
|
var _a, _b, _c;
|
|
74131
|
-
|
|
74239
|
+
const stats = (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.flv) == null ? void 0 : _c.getStats();
|
|
74240
|
+
return this._mergeSEIDelayStats(stats);
|
|
74132
74241
|
}
|
|
74133
74242
|
/** {zh}
|
|
74134
74243
|
* @brief 获取 HLS 拉流的播放信息。
|
|
@@ -74140,8 +74249,9 @@ class VePlayerLive extends VePlayerBase {
|
|
|
74140
74249
|
* @hidden
|
|
74141
74250
|
*/
|
|
74142
74251
|
getHLSStats() {
|
|
74143
|
-
var _a, _b, _c;
|
|
74144
|
-
|
|
74252
|
+
var _a, _b, _c, _d;
|
|
74253
|
+
const stats = ((_d = (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.hls) == null ? void 0 : _c.getStats) == null ? void 0 : _d.call(_c)) ?? {};
|
|
74254
|
+
return this._mergeSEIDelayStats(stats);
|
|
74145
74255
|
}
|
|
74146
74256
|
/** {en}
|
|
74147
74257
|
* @brief This method is used to update the playlist, supporting updates to source, resolution, and related information.
|
|
@@ -74169,6 +74279,40 @@ class VePlayerLive extends VePlayerBase {
|
|
|
74169
74279
|
}
|
|
74170
74280
|
return super.updatePlaylist(playlist, target);
|
|
74171
74281
|
}
|
|
74282
|
+
_getPlayerBufferTime() {
|
|
74283
|
+
var _a, _b, _c, _d, _e2;
|
|
74284
|
+
try {
|
|
74285
|
+
const rtm = ((_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.rts) ?? ((_d = (_c = this._player) == null ? void 0 : _c.plugins) == null ? void 0 : _d.rtm);
|
|
74286
|
+
if (rtm) {
|
|
74287
|
+
const jitterBufferDelay = rtm.jitterBufferDelay;
|
|
74288
|
+
if (Number.isFinite(jitterBufferDelay) && jitterBufferDelay >= 0) {
|
|
74289
|
+
return jitterBufferDelay;
|
|
74290
|
+
}
|
|
74291
|
+
}
|
|
74292
|
+
} catch (e2) {
|
|
74293
|
+
}
|
|
74294
|
+
const video = (_e2 = this._player) == null ? void 0 : _e2.video;
|
|
74295
|
+
const buffered = video == null ? void 0 : video.buffered;
|
|
74296
|
+
if (!video || !(buffered == null ? void 0 : buffered.length)) {
|
|
74297
|
+
return 0;
|
|
74298
|
+
}
|
|
74299
|
+
try {
|
|
74300
|
+
return Math.trunc(
|
|
74301
|
+
(buffered.end(buffered.length - 1) - video.currentTime) * 1e3
|
|
74302
|
+
);
|
|
74303
|
+
} catch (e2) {
|
|
74304
|
+
return 0;
|
|
74305
|
+
}
|
|
74306
|
+
}
|
|
74307
|
+
_mergeSEIDelayStats(stats) {
|
|
74308
|
+
if (!stats) {
|
|
74309
|
+
return stats;
|
|
74310
|
+
}
|
|
74311
|
+
return {
|
|
74312
|
+
...stats,
|
|
74313
|
+
...this._seiDelayStats
|
|
74314
|
+
};
|
|
74315
|
+
}
|
|
74172
74316
|
}
|
|
74173
74317
|
async function createLivePlayer(options) {
|
|
74174
74318
|
var _a, _b, _c, _d, _e2, _f, _g, _h, _i2, _j, _k;
|
|
@@ -74201,6 +74345,10 @@ async function createLivePlayer(options) {
|
|
|
74201
74345
|
playerOptions,
|
|
74202
74346
|
recommendation
|
|
74203
74347
|
);
|
|
74348
|
+
finalOptions.rtm = {
|
|
74349
|
+
enableSei: true,
|
|
74350
|
+
...finalOptions.rtm
|
|
74351
|
+
};
|
|
74204
74352
|
await liveLicenseManager.create();
|
|
74205
74353
|
const licenseFatalError = liveLicenseManager.getLicenseFatalError();
|
|
74206
74354
|
const protocolManager = await ProtocolManager.create(finalOptions);
|
|
@@ -74304,7 +74452,7 @@ async function prepare(options) {
|
|
|
74304
74452
|
}
|
|
74305
74453
|
await ((_a = liveVeStrategy.veStrategyManager) == null ? void 0 : _a.init({
|
|
74306
74454
|
...options,
|
|
74307
|
-
playerVersion: "2.
|
|
74455
|
+
playerVersion: "2.13.1-rc.0",
|
|
74308
74456
|
type: "LIVE"
|
|
74309
74457
|
}));
|
|
74310
74458
|
return liveVeStrategy.veStrategyManager;
|
package/esm/veplayer.live.d.ts
CHANGED
|
@@ -6217,6 +6217,7 @@ interface PrepareOptions {
|
|
|
6217
6217
|
logger?: LoggerConfig;
|
|
6218
6218
|
}
|
|
6219
6219
|
interface LiveEN {
|
|
6220
|
+
INVALID_PARAMETER: string;
|
|
6220
6221
|
ERROR_TYPES?: any;
|
|
6221
6222
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
6222
6223
|
[key: string]: string | unknown;
|
|
@@ -7058,9 +7059,11 @@ interface Rtm {
|
|
|
7058
7059
|
checkStatsErrorDelay?: number;
|
|
7059
7060
|
/** {zh}
|
|
7060
7061
|
* @brief 是否打开 RTM SEI
|
|
7062
|
+
* @default true
|
|
7061
7063
|
*/
|
|
7062
7064
|
/** {en}
|
|
7063
7065
|
* @brief enable RTM SEI data.
|
|
7066
|
+
* @default true
|
|
7064
7067
|
*/
|
|
7065
7068
|
enableSei?: boolean;
|
|
7066
7069
|
}
|
|
@@ -7305,6 +7308,32 @@ interface RTMNetWorkInfo {
|
|
|
7305
7308
|
*/
|
|
7306
7309
|
avgLostRate?: number;
|
|
7307
7310
|
}
|
|
7311
|
+
/** {zh}
|
|
7312
|
+
* @list option
|
|
7313
|
+
* @kind property
|
|
7314
|
+
* @brief 服务端 SEI 延迟统计。
|
|
7315
|
+
*/
|
|
7316
|
+
/** {en}
|
|
7317
|
+
* @list option
|
|
7318
|
+
* @kind property
|
|
7319
|
+
* @brief Server SEI delay statistics.
|
|
7320
|
+
*/
|
|
7321
|
+
interface SEIDelayStats {
|
|
7322
|
+
/** {zh}
|
|
7323
|
+
* @brief 服务端链路延迟,单位为毫秒。没有有效的服务端 SEI 数据时为空。
|
|
7324
|
+
*/
|
|
7325
|
+
/** {en}
|
|
7326
|
+
* @brief Server-side transfer delay in milliseconds. Empty when valid server SEI data is unavailable.
|
|
7327
|
+
*/
|
|
7328
|
+
delay_s2s?: number;
|
|
7329
|
+
/** {zh}
|
|
7330
|
+
* @brief 推流端到播放端的延迟,单位为毫秒。没有有效的服务端 SEI 数据时为空。
|
|
7331
|
+
*/
|
|
7332
|
+
/** {en}
|
|
7333
|
+
* @brief Stream-to-end playback delay in milliseconds. Empty when valid server SEI data is unavailable.
|
|
7334
|
+
*/
|
|
7335
|
+
delay_s2e?: number;
|
|
7336
|
+
}
|
|
7308
7337
|
/** {zh}
|
|
7309
7338
|
* @list option
|
|
7310
7339
|
* @kind property
|
|
@@ -7315,7 +7344,7 @@ interface RTMNetWorkInfo {
|
|
|
7315
7344
|
* @kind property
|
|
7316
7345
|
* @brief RTM live stream information.
|
|
7317
7346
|
*/
|
|
7318
|
-
interface StatsSnapShoot {
|
|
7347
|
+
interface StatsSnapShoot extends SEIDelayStats {
|
|
7319
7348
|
/** {en}
|
|
7320
7349
|
* @brief Video information.
|
|
7321
7350
|
*/
|
|
@@ -7546,7 +7575,7 @@ interface StatsSnapShoot {
|
|
|
7546
7575
|
* @kind property
|
|
7547
7576
|
* @brief Basic information for live stream playback.
|
|
7548
7577
|
*/
|
|
7549
|
-
interface Stats$0 {
|
|
7578
|
+
interface Stats$0 extends SEIDelayStats {
|
|
7550
7579
|
/** {zh}
|
|
7551
7580
|
* @brief 音频格式。
|
|
7552
7581
|
* @hidden
|
|
@@ -7704,6 +7733,7 @@ declare class VePlayerLive extends VePlayerBase {
|
|
|
7704
7733
|
* @hidden
|
|
7705
7734
|
*/
|
|
7706
7735
|
_protocolManager?: ProtocolManager;
|
|
7736
|
+
private _seiDelayStats;
|
|
7707
7737
|
/** {zh}
|
|
7708
7738
|
* @hidden
|
|
7709
7739
|
* @param options
|
|
@@ -7734,6 +7764,13 @@ declare class VePlayerLive extends VePlayerBase {
|
|
|
7734
7764
|
* @hidden
|
|
7735
7765
|
*/
|
|
7736
7766
|
get hls(): any;
|
|
7767
|
+
/** {zh}
|
|
7768
|
+
* @hidden
|
|
7769
|
+
*/
|
|
7770
|
+
/** {en}
|
|
7771
|
+
* @hidden
|
|
7772
|
+
*/
|
|
7773
|
+
destroy(): void;
|
|
7737
7774
|
/** {zh}
|
|
7738
7775
|
* @brief 调用此方法开启直播日志上报。
|
|
7739
7776
|
*/
|
|
@@ -7886,6 +7923,10 @@ declare class VePlayerLive extends VePlayerBase {
|
|
|
7886
7923
|
*/
|
|
7887
7924
|
source?: string;
|
|
7888
7925
|
}, needUpdateProtocol?: boolean): Promise<void>;
|
|
7926
|
+
private _resetSEIDelayStats;
|
|
7927
|
+
private _handleSEI;
|
|
7928
|
+
private _getPlayerBufferTime;
|
|
7929
|
+
private _mergeSEIDelayStats;
|
|
7889
7930
|
}
|
|
7890
7931
|
/** {zh}
|
|
7891
7932
|
* @detail api
|
|
@@ -11539,6 +11580,7 @@ declare namespace live {
|
|
|
11539
11580
|
logger?: LoggerConfig;
|
|
11540
11581
|
}
|
|
11541
11582
|
interface LiveEN {
|
|
11583
|
+
INVALID_PARAMETER: string;
|
|
11542
11584
|
ERROR_TYPES?: any;
|
|
11543
11585
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
11544
11586
|
[key: string]: string | unknown;
|
|
@@ -12390,9 +12432,11 @@ declare namespace live {
|
|
|
12390
12432
|
checkStatsErrorDelay?: number;
|
|
12391
12433
|
/** {zh}
|
|
12392
12434
|
* @brief 是否打开 RTM SEI
|
|
12435
|
+
* @default true
|
|
12393
12436
|
*/
|
|
12394
12437
|
/** {en}
|
|
12395
12438
|
* @brief enable RTM SEI data.
|
|
12439
|
+
* @default true
|
|
12396
12440
|
*/
|
|
12397
12441
|
enableSei?: boolean;
|
|
12398
12442
|
}
|
|
@@ -12637,6 +12681,32 @@ declare namespace live {
|
|
|
12637
12681
|
*/
|
|
12638
12682
|
avgLostRate?: number;
|
|
12639
12683
|
}
|
|
12684
|
+
/** {zh}
|
|
12685
|
+
* @list option
|
|
12686
|
+
* @kind property
|
|
12687
|
+
* @brief 服务端 SEI 延迟统计。
|
|
12688
|
+
*/
|
|
12689
|
+
/** {en}
|
|
12690
|
+
* @list option
|
|
12691
|
+
* @kind property
|
|
12692
|
+
* @brief Server SEI delay statistics.
|
|
12693
|
+
*/
|
|
12694
|
+
interface SEIDelayStats {
|
|
12695
|
+
/** {zh}
|
|
12696
|
+
* @brief 服务端链路延迟,单位为毫秒。没有有效的服务端 SEI 数据时为空。
|
|
12697
|
+
*/
|
|
12698
|
+
/** {en}
|
|
12699
|
+
* @brief Server-side transfer delay in milliseconds. Empty when valid server SEI data is unavailable.
|
|
12700
|
+
*/
|
|
12701
|
+
delay_s2s?: number;
|
|
12702
|
+
/** {zh}
|
|
12703
|
+
* @brief 推流端到播放端的延迟,单位为毫秒。没有有效的服务端 SEI 数据时为空。
|
|
12704
|
+
*/
|
|
12705
|
+
/** {en}
|
|
12706
|
+
* @brief Stream-to-end playback delay in milliseconds. Empty when valid server SEI data is unavailable.
|
|
12707
|
+
*/
|
|
12708
|
+
delay_s2e?: number;
|
|
12709
|
+
}
|
|
12640
12710
|
/** {zh}
|
|
12641
12711
|
* @list option
|
|
12642
12712
|
* @kind property
|
|
@@ -12647,7 +12717,7 @@ declare namespace live {
|
|
|
12647
12717
|
* @kind property
|
|
12648
12718
|
* @brief RTM live stream information.
|
|
12649
12719
|
*/
|
|
12650
|
-
interface StatsSnapShoot {
|
|
12720
|
+
interface StatsSnapShoot extends SEIDelayStats {
|
|
12651
12721
|
/** {en}
|
|
12652
12722
|
* @brief Video information.
|
|
12653
12723
|
*/
|
|
@@ -12878,7 +12948,7 @@ declare namespace live {
|
|
|
12878
12948
|
* @kind property
|
|
12879
12949
|
* @brief Basic information for live stream playback.
|
|
12880
12950
|
*/
|
|
12881
|
-
interface Stats$0 {
|
|
12951
|
+
interface Stats$0 extends SEIDelayStats {
|
|
12882
12952
|
/** {zh}
|
|
12883
12953
|
* @brief 音频格式。
|
|
12884
12954
|
* @hidden
|
|
@@ -13036,6 +13106,7 @@ declare namespace live {
|
|
|
13036
13106
|
* @hidden
|
|
13037
13107
|
*/
|
|
13038
13108
|
_protocolManager?: ProtocolManager;
|
|
13109
|
+
private _seiDelayStats;
|
|
13039
13110
|
/** {zh}
|
|
13040
13111
|
* @hidden
|
|
13041
13112
|
* @param options
|
|
@@ -13066,6 +13137,13 @@ declare namespace live {
|
|
|
13066
13137
|
* @hidden
|
|
13067
13138
|
*/
|
|
13068
13139
|
get hls(): any;
|
|
13140
|
+
/** {zh}
|
|
13141
|
+
* @hidden
|
|
13142
|
+
*/
|
|
13143
|
+
/** {en}
|
|
13144
|
+
* @hidden
|
|
13145
|
+
*/
|
|
13146
|
+
destroy(): void;
|
|
13069
13147
|
/** {zh}
|
|
13070
13148
|
* @brief 调用此方法开启直播日志上报。
|
|
13071
13149
|
*/
|
|
@@ -13218,6 +13296,10 @@ declare namespace live {
|
|
|
13218
13296
|
*/
|
|
13219
13297
|
source?: string;
|
|
13220
13298
|
}, needUpdateProtocol?: boolean): Promise<void>;
|
|
13299
|
+
private _resetSEIDelayStats;
|
|
13300
|
+
private _handleSEI;
|
|
13301
|
+
private _getPlayerBufferTime;
|
|
13302
|
+
private _mergeSEIDelayStats;
|
|
13221
13303
|
}
|
|
13222
13304
|
/** {zh}
|
|
13223
13305
|
* @detail api
|