@volcengine/veplayer 2.7.1-rc.0 → 2.7.1-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 +155 -121
- package/esm/veplayer.biz.live.development.js +376 -232
- package/esm/veplayer.biz.live.production.js +1 -1
- package/esm/veplayer.d.ts +531 -214
- package/esm/veplayer.development.js +378 -236
- package/esm/veplayer.live.d.ts +531 -214
- package/esm/veplayer.live.development.js +378 -236
- package/esm/veplayer.live.production.js +3 -3
- package/esm/veplayer.production.js +3 -3
- package/esm/veplayer.vod.d.ts +155 -121
- package/esm/veplayer.vod.development.js +3 -5
- package/esm/veplayer.vod.production.js +1 -1
- package/package.json +1 -1
- package/umd/index.d.ts +155 -121
- package/umd/veplayer.biz.live.development.js +376 -232
- package/umd/veplayer.biz.live.production.js +1 -1
- package/umd/veplayer.d.ts +531 -214
- package/umd/veplayer.development.js +378 -236
- package/umd/veplayer.live.d.ts +531 -214
- package/umd/veplayer.live.development.js +378 -236
- package/umd/veplayer.live.production.js +1 -1
- package/umd/veplayer.production.js +1 -1
- package/umd/veplayer.vod.d.ts +155 -121
- package/umd/veplayer.vod.development.js +3 -5
- package/umd/veplayer.vod.production.js +1 -1
- package/veplayer.d.ts +531 -214
- package/veplayer.live.d.ts +531 -214
- package/veplayer.vod.d.ts +155 -121
|
@@ -14453,7 +14453,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14453
14453
|
* @brief Retrieve the player SDK version number.
|
|
14454
14454
|
*/
|
|
14455
14455
|
get playerVersion() {
|
|
14456
|
-
return "2.7.1-rc.
|
|
14456
|
+
return "2.7.1-rc.2";
|
|
14457
14457
|
}
|
|
14458
14458
|
/** {zh}
|
|
14459
14459
|
* @brief 获取当前播放视频的清晰度唯一标识(definition)。
|
|
@@ -14728,7 +14728,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14728
14728
|
}
|
|
14729
14729
|
}
|
|
14730
14730
|
/** {zh}
|
|
14731
|
-
* @brief
|
|
14731
|
+
* @brief 调用此方法开始播放。
|
|
14732
14732
|
*/
|
|
14733
14733
|
/** {en}
|
|
14734
14734
|
* @brief Starts playback.
|
|
@@ -14974,9 +14974,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14974
14974
|
if (!url) {
|
|
14975
14975
|
const transformedError = transform$1(err, this._i18nManager);
|
|
14976
14976
|
try {
|
|
14977
|
-
const { canEmitError } = await this._beforeFallbackError(
|
|
14978
|
-
transformedError
|
|
14979
|
-
);
|
|
14977
|
+
const { canEmitError } = await this._beforeFallbackError(transformedError);
|
|
14980
14978
|
if (!canEmitError) {
|
|
14981
14979
|
return;
|
|
14982
14980
|
}
|
|
@@ -20049,6 +20047,19 @@ var __publicField = (obj, key, value) => {
|
|
|
20049
20047
|
}
|
|
20050
20048
|
return target;
|
|
20051
20049
|
}
|
|
20050
|
+
typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = /* @__PURE__ */ Symbol("Symbol.iterator")) : "@@iterator";
|
|
20051
|
+
typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = /* @__PURE__ */ Symbol("Symbol.asyncIterator")) : "@@asyncIterator";
|
|
20052
|
+
function _catch(body, recover) {
|
|
20053
|
+
try {
|
|
20054
|
+
var result = body();
|
|
20055
|
+
} catch (e2) {
|
|
20056
|
+
return recover(e2);
|
|
20057
|
+
}
|
|
20058
|
+
if (result && result.then) {
|
|
20059
|
+
return result.then(void 0, recover);
|
|
20060
|
+
}
|
|
20061
|
+
return result;
|
|
20062
|
+
}
|
|
20052
20063
|
var device_id_key = "xgplayer_device_id";
|
|
20053
20064
|
var user_id_key = "xgplayer_user_id";
|
|
20054
20065
|
var getCookie = function getCookie2(key) {
|
|
@@ -20252,17 +20263,25 @@ var __publicField = (obj, key, value) => {
|
|
|
20252
20263
|
return player.plugins.hls;
|
|
20253
20264
|
} else if (player.plugins.rts) {
|
|
20254
20265
|
return player.plugins.rts;
|
|
20255
|
-
} else if (player.plugins.
|
|
20256
|
-
return player.plugins.
|
|
20266
|
+
} else if (player.plugins.flvlive) {
|
|
20267
|
+
return player.plugins.flvlive;
|
|
20268
|
+
} else if (player.plugins.hlslive) {
|
|
20269
|
+
return player.plugins.hlslive;
|
|
20270
|
+
} else if (player.plugins.hlsvod) {
|
|
20271
|
+
return player.plugins.hlsvod;
|
|
20272
|
+
} else if (player.plugins.hlslivemobile) {
|
|
20273
|
+
return player.plugins.hlslivemobile;
|
|
20274
|
+
} else if (player.plugins.flvlivemobile) {
|
|
20275
|
+
return player.plugins.flvlivemobile;
|
|
20257
20276
|
}
|
|
20258
20277
|
}
|
|
20259
|
-
return
|
|
20278
|
+
return player.newHls || player.newFlv || player.__core__ || player.flv;
|
|
20260
20279
|
}
|
|
20261
20280
|
function getDefaultOptions(options) {
|
|
20262
20281
|
return {
|
|
20263
20282
|
device_id: options.device_id || getDeviceID$1(),
|
|
20264
20283
|
user_id: options.user_id || getUserId$1(),
|
|
20265
|
-
error_report_stop:
|
|
20284
|
+
error_report_stop: typeof options.error_report_stop === "boolean" ? options.error_report_stop : true,
|
|
20266
20285
|
project_key: options.project_key || "live",
|
|
20267
20286
|
product_line: options.product_line || "live",
|
|
20268
20287
|
onReport: options.onReport || function() {
|
|
@@ -20485,9 +20504,8 @@ var __publicField = (obj, key, value) => {
|
|
|
20485
20504
|
live_sdk_version: getPlayerCore(player) || player.hlsOps ? "2" : "-1",
|
|
20486
20505
|
player_sdk_version: player.version,
|
|
20487
20506
|
// eslint-disable-next-line no-undef
|
|
20488
|
-
logger_version: "1.1.0-alpha.
|
|
20507
|
+
logger_version: "1.1.0-alpha.17",
|
|
20489
20508
|
// 由rollup 在编译时注入
|
|
20490
|
-
report_version: "5",
|
|
20491
20509
|
product_line: options.product_line,
|
|
20492
20510
|
user_id: options.user_id,
|
|
20493
20511
|
device_id: options.device_id,
|
|
@@ -20496,6 +20514,7 @@ var __publicField = (obj, key, value) => {
|
|
|
20496
20514
|
cdn_ip: options.cdn_ip,
|
|
20497
20515
|
is_wasm: +(!!mediaType && mediaType !== "video"),
|
|
20498
20516
|
review_is_live: player.config.isLive ? 2 : 1,
|
|
20517
|
+
isSupportedH265: isCodecSupport("hev1.1.6.L93.B0,mp4a.40.2"),
|
|
20499
20518
|
aid: options.aid,
|
|
20500
20519
|
live_id: options.live_id || options.aid + "-" + options.user_id + "-" + Date.now(),
|
|
20501
20520
|
is_preview: options.is_preview ? 1 : 0,
|
|
@@ -20621,6 +20640,7 @@ var __publicField = (obj, key, value) => {
|
|
|
20621
20640
|
log.cpu_core_number = cpu_core_number;
|
|
20622
20641
|
log.memory_usage = memory_usage;
|
|
20623
20642
|
log.network_downlink = network_downlink;
|
|
20643
|
+
log.muted = +this._player.muted;
|
|
20624
20644
|
Object.assign(log, _objectSpread2({}, this.videoSize));
|
|
20625
20645
|
this.send(log);
|
|
20626
20646
|
};
|
|
@@ -20651,14 +20671,29 @@ var __publicField = (obj, key, value) => {
|
|
|
20651
20671
|
}
|
|
20652
20672
|
return "unknown";
|
|
20653
20673
|
};
|
|
20654
|
-
var videoEvts = [
|
|
20674
|
+
var videoEvts = [
|
|
20675
|
+
"play",
|
|
20676
|
+
"playing",
|
|
20677
|
+
"pause",
|
|
20678
|
+
"ended",
|
|
20679
|
+
// 'error',
|
|
20680
|
+
"seeking",
|
|
20681
|
+
"seeked",
|
|
20682
|
+
"timeupdate",
|
|
20683
|
+
"waiting",
|
|
20684
|
+
"canplay",
|
|
20685
|
+
"canplaythrough",
|
|
20686
|
+
"durationchange",
|
|
20687
|
+
"ratechange",
|
|
20688
|
+
"volumechange",
|
|
20689
|
+
"loadeddata"
|
|
20690
|
+
];
|
|
20655
20691
|
var LoggerControl = /* @__PURE__ */ function() {
|
|
20656
20692
|
function LoggerControl2(options) {
|
|
20657
20693
|
this.options = options;
|
|
20658
20694
|
this.logger = new XgLiveLogger(options);
|
|
20659
20695
|
this.restart = this.restart.bind(this);
|
|
20660
20696
|
this.bindUrlChange();
|
|
20661
|
-
sniffer.browser.includes("Chrome");
|
|
20662
20697
|
}
|
|
20663
20698
|
var _proto = LoggerControl2.prototype;
|
|
20664
20699
|
_proto.restart = function restart(report_stop) {
|
|
@@ -20682,6 +20717,9 @@ var __publicField = (obj, key, value) => {
|
|
|
20682
20717
|
this.logger.updateExt(ext);
|
|
20683
20718
|
}
|
|
20684
20719
|
};
|
|
20720
|
+
_proto.sendLog = function sendLog(log) {
|
|
20721
|
+
this.logger.sendLog(log);
|
|
20722
|
+
};
|
|
20685
20723
|
_proto.destroy = function destroy(report_stop) {
|
|
20686
20724
|
this.logger.destroy(report_stop);
|
|
20687
20725
|
this.logger = null;
|
|
@@ -20743,6 +20781,7 @@ var __publicField = (obj, key, value) => {
|
|
|
20743
20781
|
this.completed = false;
|
|
20744
20782
|
this.firstFrameViewed = false;
|
|
20745
20783
|
this.cacheRtcStats = {};
|
|
20784
|
+
this.cachePlaying = {};
|
|
20746
20785
|
}
|
|
20747
20786
|
var _proto2 = XgLiveLogger2.prototype;
|
|
20748
20787
|
_proto2.setNTP = function setNTP(ntp) {
|
|
@@ -20832,6 +20871,14 @@ var __publicField = (obj, key, value) => {
|
|
|
20832
20871
|
});
|
|
20833
20872
|
}
|
|
20834
20873
|
};
|
|
20874
|
+
_proto2.sendLog = function sendLog(log) {
|
|
20875
|
+
for (var commonKey in this.commonParams) {
|
|
20876
|
+
if (log[commonKey] === void 0) {
|
|
20877
|
+
log[commonKey] = this["_" + commonKey] || this.commonParams[commonKey];
|
|
20878
|
+
}
|
|
20879
|
+
}
|
|
20880
|
+
this.logmanager.push(log);
|
|
20881
|
+
};
|
|
20835
20882
|
_proto2.updateExt = function updateExt(ext) {
|
|
20836
20883
|
for (var logKey in this.log) {
|
|
20837
20884
|
for (var extKey in ext) {
|
|
@@ -20970,9 +21017,11 @@ var __publicField = (obj, key, value) => {
|
|
|
20970
21017
|
};
|
|
20971
21018
|
};
|
|
20972
21019
|
_proto2.handleTTFB = function handleTTFB(params) {
|
|
20973
|
-
var _ref = params || {}, end = _ref.end, elapsed = _ref.elapsed;
|
|
21020
|
+
var _ref = params || {}, end = _ref.end, elapsed = _ref.elapsed, responseUrl = _ref.responseUrl, url = _ref.url;
|
|
20974
21021
|
this.log.first_frame.ttfb = elapsed || -1;
|
|
20975
21022
|
this.log.first_frame.ttfb_end = end || 0;
|
|
21023
|
+
this.log.first_frame.is_redirect = +(url !== responseUrl);
|
|
21024
|
+
this.log.play_result.is_redirect = this.log.first_frame.is_redirect;
|
|
20976
21025
|
};
|
|
20977
21026
|
_proto2.handleUrlChange = function handleUrlChange(url) {
|
|
20978
21027
|
this.logmanager.push(Object.assign(this.log.play_url_change, {
|
|
@@ -21024,11 +21073,11 @@ var __publicField = (obj, key, value) => {
|
|
|
21024
21073
|
this.clearPlayResultTimer();
|
|
21025
21074
|
this.log.play_result.reason = err.message || "first frame failed";
|
|
21026
21075
|
this.log.play_result.code = this.log.play_error.code;
|
|
21027
|
-
this.logmanager.push(this.log.play_result
|
|
21076
|
+
this.logmanager.push(this.log.play_result);
|
|
21028
21077
|
}
|
|
21029
21078
|
}
|
|
21030
21079
|
if (this.options.error_report_stop) {
|
|
21031
|
-
this.
|
|
21080
|
+
this.destroy(true);
|
|
21032
21081
|
} else {
|
|
21033
21082
|
this.updatePlayStopParams();
|
|
21034
21083
|
}
|
|
@@ -21052,22 +21101,36 @@ var __publicField = (obj, key, value) => {
|
|
|
21052
21101
|
this.logmanager.push(play_stream_loaded);
|
|
21053
21102
|
};
|
|
21054
21103
|
_proto2.handleSEIParsed = function handleSEIParsed(sei) {
|
|
21055
|
-
|
|
21056
|
-
|
|
21057
|
-
var
|
|
21058
|
-
|
|
21059
|
-
|
|
21060
|
-
|
|
21061
|
-
|
|
21062
|
-
|
|
21063
|
-
|
|
21064
|
-
|
|
21065
|
-
|
|
21066
|
-
|
|
21067
|
-
|
|
21068
|
-
|
|
21069
|
-
|
|
21070
|
-
|
|
21104
|
+
try {
|
|
21105
|
+
var _this5 = this;
|
|
21106
|
+
var _this5$log = _this5.log, playing = _this5$log.playing, first_frame = _this5$log.first_frame;
|
|
21107
|
+
var _temp3 = function() {
|
|
21108
|
+
if (sei.code === 100) {
|
|
21109
|
+
var seiString = Utf8ArrayToStr(sei.content);
|
|
21110
|
+
seiString = seiString.slice(seiString.indexOf("{"), seiString.lastIndexOf("}") + 1);
|
|
21111
|
+
var _temp4 = _catch(function() {
|
|
21112
|
+
var seiContent = JSON.parse(seiString);
|
|
21113
|
+
return Promise.resolve(_this5.getPlayerBuffer()).then(function(bufferTime) {
|
|
21114
|
+
var seiDelay = bufferTime + _this5.ntpTime - seiContent.ts;
|
|
21115
|
+
playing.sei_delay = seiDelay;
|
|
21116
|
+
playing.sei_source = seiContent.source;
|
|
21117
|
+
playing.ntp_sync = _this5.options.ntp ? 1 : 0;
|
|
21118
|
+
playing.ntp_delta = _this5.ntp_delta;
|
|
21119
|
+
first_frame.first_sei_delay = seiDelay;
|
|
21120
|
+
first_frame.ntp_sync = _this5.options.ntp ? 1 : 0;
|
|
21121
|
+
first_frame.ntp_delta = _this5.ntp_delta;
|
|
21122
|
+
});
|
|
21123
|
+
}, function() {
|
|
21124
|
+
});
|
|
21125
|
+
if (_temp4 && _temp4.then)
|
|
21126
|
+
return _temp4.then(function() {
|
|
21127
|
+
});
|
|
21128
|
+
}
|
|
21129
|
+
}();
|
|
21130
|
+
return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(function() {
|
|
21131
|
+
}) : void 0);
|
|
21132
|
+
} catch (e2) {
|
|
21133
|
+
return Promise.reject(e2);
|
|
21071
21134
|
}
|
|
21072
21135
|
};
|
|
21073
21136
|
_proto2.handleMetaDataLoaded = function handleMetaDataLoaded(type, meta) {
|
|
@@ -21097,7 +21160,7 @@ var __publicField = (obj, key, value) => {
|
|
|
21097
21160
|
_proto2.handleAVUnsync = function handleAVUnsync(unsyncInfo) {
|
|
21098
21161
|
Object.assign(this.log.play_av_unsync, unsyncInfo || {});
|
|
21099
21162
|
this.log.play_av_unsync.timestamp = getCurrentTime();
|
|
21100
|
-
this.logmanager.push(this.log.play_av_unsync
|
|
21163
|
+
this.logmanager.push(this.log.play_av_unsync);
|
|
21101
21164
|
};
|
|
21102
21165
|
_proto2.handleStreamException = function handleStreamException(info) {
|
|
21103
21166
|
this.logmanager.push(Object.assign({}, this.log.stream_exception, info));
|
|
@@ -21117,27 +21180,58 @@ var __publicField = (obj, key, value) => {
|
|
|
21117
21180
|
}
|
|
21118
21181
|
};
|
|
21119
21182
|
_proto2.getPlayerBuffer = function getPlayerBuffer() {
|
|
21120
|
-
|
|
21121
|
-
|
|
21122
|
-
|
|
21123
|
-
|
|
21124
|
-
|
|
21125
|
-
|
|
21126
|
-
|
|
21127
|
-
|
|
21128
|
-
|
|
21129
|
-
|
|
21183
|
+
try {
|
|
21184
|
+
var _this7 = this;
|
|
21185
|
+
return Promise.resolve(_this7.getRtcStats({
|
|
21186
|
+
onlyJb: true
|
|
21187
|
+
})).then(function(rtc_stats) {
|
|
21188
|
+
if (rtc_stats.video_jb_delay !== void 0) {
|
|
21189
|
+
return rtc_stats.video_jb_delay;
|
|
21190
|
+
}
|
|
21191
|
+
var buffered = _this7.player.video.buffered;
|
|
21192
|
+
if (buffered) {
|
|
21193
|
+
var bufferIdx = Math.max(0, buffered.length - 1);
|
|
21194
|
+
try {
|
|
21195
|
+
var bufferedTime = Number.parseInt((buffered.end(bufferIdx) - _this7.player.video.currentTime) * 1e3);
|
|
21196
|
+
_this7.log.playing.audio_buffer_time = _this7.log.playing.video_buffer_time = bufferedTime;
|
|
21197
|
+
return bufferedTime;
|
|
21198
|
+
} catch (e2) {
|
|
21199
|
+
return 0;
|
|
21200
|
+
}
|
|
21201
|
+
}
|
|
21202
|
+
});
|
|
21203
|
+
} catch (e2) {
|
|
21204
|
+
return Promise.reject(e2);
|
|
21130
21205
|
}
|
|
21131
21206
|
};
|
|
21207
|
+
_proto2.getTransferCost = function getTransferCost(isFirstFrame) {
|
|
21208
|
+
var _this$core;
|
|
21209
|
+
if (!((_this$core = this.core) === null || _this$core === void 0 ? void 0 : _this$core.transferCost)) {
|
|
21210
|
+
return {};
|
|
21211
|
+
}
|
|
21212
|
+
if (isFirstFrame)
|
|
21213
|
+
return this.core.transferCost;
|
|
21214
|
+
var _this$core$transferCo = this.core.transferCost, demuxCost = _this$core$transferCo.demuxCost, remuxCost = _this$core$transferCo.remuxCost, appendCost = _this$core$transferCo.appendCost;
|
|
21215
|
+
var transferCost = {
|
|
21216
|
+
demuxCost: demuxCost - this.cachePlaying.demuxCost,
|
|
21217
|
+
remuxCost: remuxCost - this.cachePlaying.remuxCost,
|
|
21218
|
+
appendCost: appendCost - this.cachePlaying.appendCost
|
|
21219
|
+
};
|
|
21220
|
+
Object.assign(this.cachePlaying, this.core.transferCost);
|
|
21221
|
+
return transferCost;
|
|
21222
|
+
};
|
|
21132
21223
|
_proto2.getPlayerDownloadSpeed = function getPlayerDownloadSpeed() {
|
|
21133
21224
|
if (this.core && this.core.core) {
|
|
21134
21225
|
if (typeof this.core.core.speedInfo === "function") {
|
|
21135
|
-
return this.core.core.speedInfo().speed;
|
|
21226
|
+
return this.core.core.speedInfo().speed || {};
|
|
21136
21227
|
}
|
|
21137
21228
|
}
|
|
21229
|
+
return {};
|
|
21138
21230
|
};
|
|
21139
21231
|
_proto2.getPlayerQuality = function getPlayerQuality() {
|
|
21140
21232
|
var video = this.player.video;
|
|
21233
|
+
if (!video)
|
|
21234
|
+
return;
|
|
21141
21235
|
if (video.getVideoPlaybackQuality) {
|
|
21142
21236
|
var quality = video.getVideoPlaybackQuality();
|
|
21143
21237
|
this.log.playing.drop_count = quality.droppedVideoFrames - this.tempDroppedFrameCount;
|
|
@@ -21151,10 +21245,11 @@ var __publicField = (obj, key, value) => {
|
|
|
21151
21245
|
this.tempDroppedFrameCount = droppedVideoFrames;
|
|
21152
21246
|
}
|
|
21153
21247
|
};
|
|
21154
|
-
_proto2.getRtcStats = function getRtcStats(
|
|
21248
|
+
_proto2.getRtcStats = function getRtcStats(_ref2) {
|
|
21249
|
+
var _ref2$duration = _ref2.duration, duration = _ref2$duration === void 0 ? 1e3 : _ref2$duration, _ref2$onlyJb = _ref2.onlyJb, onlyJb = _ref2$onlyJb === void 0 ? false : _ref2$onlyJb;
|
|
21155
21250
|
try {
|
|
21156
|
-
var
|
|
21157
|
-
var rtm =
|
|
21251
|
+
var _this9 = this;
|
|
21252
|
+
var rtm = _this9.player.plugins.rts || _this9.player.plugins.rtm;
|
|
21158
21253
|
var pc = rtm && rtm.pc;
|
|
21159
21254
|
var rtc_stats = {};
|
|
21160
21255
|
if (!pc)
|
|
@@ -21165,53 +21260,56 @@ var __publicField = (obj, key, value) => {
|
|
|
21165
21260
|
switch (type) {
|
|
21166
21261
|
case "inbound-rtp":
|
|
21167
21262
|
if (mediaType === "audio") {
|
|
21168
|
-
rtc_stats.audio_bytes_received = bytesReceived - (
|
|
21169
|
-
|
|
21170
|
-
rtc_stats.audio_packets_lost = packetsLost - (
|
|
21171
|
-
rtc_stats.audio_packets_received = packetsReceived - (
|
|
21172
|
-
|
|
21173
|
-
|
|
21263
|
+
rtc_stats.audio_bytes_received = bytesReceived - (_this9.cacheRtcStats.audioBytesReceived || 0);
|
|
21264
|
+
_this9.cacheRtcStats.audioBytesReceived = bytesReceived;
|
|
21265
|
+
rtc_stats.audio_packets_lost = packetsLost - (_this9.cacheRtcStats.audioPacketsLost || 0);
|
|
21266
|
+
rtc_stats.audio_packets_received = packetsReceived - (_this9.cacheRtcStats.audioPacketsReceived || 0);
|
|
21267
|
+
_this9.cacheRtcStats.audioPacketsLost = packetsLost;
|
|
21268
|
+
_this9.cacheRtcStats.audioPacketsReceived = packetsReceived;
|
|
21174
21269
|
rtc_stats.audio_level = audioLevel;
|
|
21175
21270
|
rtc_stats.concealment_event = concealmentEvents;
|
|
21176
21271
|
rtc_stats.audio_fraction_lost = rtc_stats.audio_packets_lost / rtc_stats.audio_packets_received;
|
|
21177
|
-
if (
|
|
21178
|
-
rtc_stats.audio_rec_sample_rate = (totalSamplesReceived -
|
|
21272
|
+
if (_this9.cacheRtcStats.totalSamplesReceived !== void 0) {
|
|
21273
|
+
rtc_stats.audio_rec_sample_rate = (totalSamplesReceived - _this9.cacheRtcStats.totalSamplesReceived) / duration;
|
|
21179
21274
|
}
|
|
21180
|
-
|
|
21275
|
+
_this9.cacheRtcStats.totalSamplesReceived = totalSamplesReceived;
|
|
21181
21276
|
rtc_stats.concealed_samples = concealedSamples;
|
|
21182
21277
|
rtc_stats.total_samples_received = totalSamplesReceived;
|
|
21183
21278
|
} else {
|
|
21279
|
+
rtc_stats.video_jb_delay = jitterBufferDelay / jitterBufferEmittedCount * 1e3;
|
|
21280
|
+
if (onlyJb) {
|
|
21281
|
+
return rtc_stats;
|
|
21282
|
+
}
|
|
21184
21283
|
rtc_stats.frames_dropped = framesDropped;
|
|
21185
21284
|
rtc_stats.iframes_decoded = keyFramesDecoded;
|
|
21186
|
-
rtc_stats.video_bytes_received = bytesReceived - (
|
|
21187
|
-
|
|
21285
|
+
rtc_stats.video_bytes_received = bytesReceived - (_this9.cacheRtcStats.videoBytesReceived || 0);
|
|
21286
|
+
_this9.cacheRtcStats.videoBytesReceived = bytesReceived;
|
|
21188
21287
|
rtc_stats.video_dec_time = totalDecodeTime;
|
|
21189
21288
|
rtc_stats.video_decoded_delay_ms = rtc_stats.video_dec_elapse / framesDecoded;
|
|
21190
21289
|
rtc_stats.video_frame_height = frameHeight;
|
|
21191
21290
|
rtc_stats.video_frame_width = frameWidth;
|
|
21192
|
-
if (
|
|
21193
|
-
rtc_stats.video_decode_framerate = (framesDecoded -
|
|
21291
|
+
if (_this9.cacheRtcStats.framesDecoded !== void 0) {
|
|
21292
|
+
rtc_stats.video_decode_framerate = (framesDecoded - _this9.cacheRtcStats.framesDecoded) / duration;
|
|
21194
21293
|
}
|
|
21195
|
-
|
|
21196
|
-
if (
|
|
21197
|
-
rtc_stats.video_recv_framerate = (framesReceived -
|
|
21294
|
+
_this9.cacheRtcStats.framesDecoded = framesDecoded;
|
|
21295
|
+
if (_this9.cacheRtcStats.framesReceived !== void 0) {
|
|
21296
|
+
rtc_stats.video_recv_framerate = (framesReceived - _this9.cacheRtcStats.framesReceived) / duration;
|
|
21198
21297
|
}
|
|
21199
|
-
if (
|
|
21200
|
-
rtc_stats.freeze_count = freezeCount -
|
|
21201
|
-
rtc_stats.freeze_duration = totalFreezesDuration -
|
|
21298
|
+
if (_this9.cacheRtcStats.freezeCount !== void 0) {
|
|
21299
|
+
rtc_stats.freeze_count = freezeCount - _this9.cacheRtcStats.freezeCount;
|
|
21300
|
+
rtc_stats.freeze_duration = totalFreezesDuration - _this9.cacheRtcStats.totalFreezesDuration;
|
|
21202
21301
|
}
|
|
21203
|
-
|
|
21204
|
-
|
|
21205
|
-
|
|
21302
|
+
_this9.cacheRtcStats.freezeCount = freezeCount;
|
|
21303
|
+
_this9.cacheRtcStats.totalFreezesDuration = totalFreezesDuration;
|
|
21304
|
+
_this9.cacheRtcStats.framesReceived = framesReceived;
|
|
21206
21305
|
rtc_stats.total_pauses_duration = totalPausesDuration;
|
|
21207
|
-
rtc_stats.video_jb_delay = jitterBufferDelay / jitterBufferEmittedCount * 1e3;
|
|
21208
21306
|
rtc_stats.video_jitter = jitter * 1e3;
|
|
21209
21307
|
rtc_stats.video_nack_count = nackCount;
|
|
21210
|
-
rtc_stats.video_packets_lost = packetsLost - (
|
|
21211
|
-
rtc_stats.video_packets_received = packetsReceived - (
|
|
21308
|
+
rtc_stats.video_packets_lost = packetsLost - (_this9.cacheRtcStats.videoPacketsLost || 0);
|
|
21309
|
+
rtc_stats.video_packets_received = packetsReceived - (_this9.cacheRtcStats.videoPacketsReceived || 0);
|
|
21212
21310
|
rtc_stats.video_fraction_lost = rtc_stats.video_packets_lost / rtc_stats.video_packets_received;
|
|
21213
|
-
|
|
21214
|
-
|
|
21311
|
+
_this9.cacheRtcStats.videoPacketsLost = packetsLost;
|
|
21312
|
+
_this9.cacheRtcStats.videoPacketsReceived = packetsReceived;
|
|
21215
21313
|
rtc_stats.video_pli_count = pliCount;
|
|
21216
21314
|
rtc_stats.decoder_name = decoderImplementation;
|
|
21217
21315
|
}
|
|
@@ -21235,13 +21333,12 @@ var __publicField = (obj, key, value) => {
|
|
|
21235
21333
|
rtc_stats.audio_codec = mediaType;
|
|
21236
21334
|
}
|
|
21237
21335
|
}
|
|
21238
|
-
rtc_stats.total_delay = rtc_stats.e2e_delay_ms + (rtc_stats.video_decoded_delay_ms || 0) + (rtc_stats.video_jb_delay || 0);
|
|
21239
21336
|
});
|
|
21240
|
-
Object.assign(
|
|
21337
|
+
Object.assign(_this9.log.playing, {
|
|
21241
21338
|
video_download_size: rtc_stats.video_bytes_received,
|
|
21242
21339
|
decode_fps: rtc_stats.video_decode_framerate,
|
|
21243
|
-
sei_delay: rtc_stats.total_delay,
|
|
21244
|
-
sei_network_delay: rtc_stats.e2e_delay_ms,
|
|
21340
|
+
// sei_delay: rtc_stats.total_delay,
|
|
21341
|
+
// sei_network_delay: rtc_stats.e2e_delay_ms,
|
|
21245
21342
|
width: rtc_stats.video_frame_width,
|
|
21246
21343
|
height: rtc_stats.video_frame_height,
|
|
21247
21344
|
current_speed: (rtc_stats.audio_bytes_received + rtc_stats.video_bytes_received) / duration
|
|
@@ -21254,31 +21351,34 @@ var __publicField = (obj, key, value) => {
|
|
|
21254
21351
|
};
|
|
21255
21352
|
_proto2.reportPlaying = function reportPlaying(first) {
|
|
21256
21353
|
try {
|
|
21257
|
-
var
|
|
21258
|
-
if (
|
|
21259
|
-
|
|
21260
|
-
|
|
21261
|
-
|
|
21354
|
+
var _this11 = this;
|
|
21355
|
+
if (_this11.commonParams.is_wasm) {
|
|
21356
|
+
_this11.commonParams.fps = _this11.player.video.fps;
|
|
21357
|
+
_this11.log.playing.render_fps = _this11.player.video.fps;
|
|
21358
|
+
_this11.log.playing.decode_fps = _this11.player.video.decodeFps;
|
|
21262
21359
|
}
|
|
21263
|
-
|
|
21264
|
-
var lastPlayingTime =
|
|
21360
|
+
_this11.log.playing.index++;
|
|
21361
|
+
var lastPlayingTime = _this11.log.playing.timestamp;
|
|
21265
21362
|
var stallTime;
|
|
21266
|
-
if (
|
|
21267
|
-
stallTime = Math.min(
|
|
21363
|
+
if (_this11.inWaitingStart && _this11.inWaitingStart < getCurrentTime()) {
|
|
21364
|
+
stallTime = Math.min(_this11.options.playingInterval || _this11.log.playing.play_time, getCurrentTime() - Math.max(_this11.inWaitingStart, lastPlayingTime));
|
|
21268
21365
|
}
|
|
21269
|
-
|
|
21270
|
-
|
|
21271
|
-
|
|
21272
|
-
|
|
21366
|
+
_this11.getPlayerQuality();
|
|
21367
|
+
_this11.getPlayerBuffer();
|
|
21368
|
+
var transferCost = _this11.getTransferCost(false);
|
|
21369
|
+
if (!_this11.options.downloadSpeedInterval) {
|
|
21370
|
+
var _this11$getPlayerDown = _this11.getPlayerDownloadSpeed(), speed = _this11$getPlayerDown.speed, avgSpeed = _this11$getPlayerDown.avgSpeed;
|
|
21371
|
+
_this11.log.playing.current_speed = speed;
|
|
21372
|
+
_this11.log.playing.avg_speed = avgSpeed;
|
|
21273
21373
|
}
|
|
21274
21374
|
var now2 = getCurrentTime();
|
|
21275
21375
|
var playedTime = now2 - lastPlayingTime;
|
|
21276
|
-
var stall_time = (stallTime > 200 ? stallTime : 0) +
|
|
21277
|
-
var stall_count = (stallTime > 200 ? 1 : 0) +
|
|
21278
|
-
if (
|
|
21279
|
-
|
|
21376
|
+
var stall_time = (stallTime > 200 ? stallTime : 0) + _this11.log.playing.stall_time;
|
|
21377
|
+
var stall_count = (stallTime > 200 ? 1 : 0) + _this11.log.playing.stall_count;
|
|
21378
|
+
if (_this11.options.aggregationDowngradeStallTime) {
|
|
21379
|
+
_this11.log.playing.aggregation_downgrade_stall = (stallTime > _this11.options.aggregationDowngradeStallTime ? stallTime : 0) + (_this11.log.playing.aggregation_downgrade_stall || 0);
|
|
21280
21380
|
}
|
|
21281
|
-
Object.assign(
|
|
21381
|
+
Object.assign(_this11.log.playing, _objectSpread2(_objectSpread2({
|
|
21282
21382
|
timestamp: now2,
|
|
21283
21383
|
// 60s内存在多次触发playing
|
|
21284
21384
|
stop_time: now2,
|
|
@@ -21290,37 +21390,41 @@ var __publicField = (obj, key, value) => {
|
|
|
21290
21390
|
stall_count,
|
|
21291
21391
|
// playing前会有一次卡顿现处于waiting状态
|
|
21292
21392
|
stall_time,
|
|
21293
|
-
play_current_time:
|
|
21294
|
-
},
|
|
21295
|
-
return Promise.resolve(
|
|
21393
|
+
play_current_time: _this11.player.currentTime
|
|
21394
|
+
}, transferCost), _this11.videoSize));
|
|
21395
|
+
return Promise.resolve(_this11.getRtcStats({
|
|
21396
|
+
duration: playedTime,
|
|
21397
|
+
first,
|
|
21398
|
+
onlyJb: false
|
|
21399
|
+
})).then(function(stats) {
|
|
21296
21400
|
var flvStats = {};
|
|
21297
|
-
if (
|
|
21298
|
-
if (
|
|
21299
|
-
var
|
|
21401
|
+
if (_this11.core) {
|
|
21402
|
+
if (_this11.core.getStats) {
|
|
21403
|
+
var _ref3 = _this11.core.getStats() || {}, bitrate = _ref3.bitrate, _avgSpeed = _ref3.avgSpeed;
|
|
21300
21404
|
Object.assign(flvStats, {
|
|
21301
21405
|
bitrate,
|
|
21302
|
-
avg_speed:
|
|
21303
|
-
rate:
|
|
21406
|
+
avg_speed: _avgSpeed,
|
|
21407
|
+
rate: _avgSpeed / bitrate
|
|
21304
21408
|
});
|
|
21305
21409
|
}
|
|
21306
|
-
if (
|
|
21307
|
-
var
|
|
21308
|
-
var
|
|
21309
|
-
var
|
|
21410
|
+
if (_this11.core.getNetWorkInfo) {
|
|
21411
|
+
var _this11$core$core;
|
|
21412
|
+
var _ref4 = _this11.core.getNetWorkInfo() || {}, lostRate = _ref4.lostRate;
|
|
21413
|
+
var _ref5 = ((_this11$core$core = _this11.core.core) === null || _this11$core$core === void 0 ? void 0 : _this11$core$core._opts) || {}, networkEvaluateInterval = _ref5.networkEvaluateInterval;
|
|
21310
21414
|
Object.assign(flvStats, {
|
|
21311
21415
|
lostRate,
|
|
21312
21416
|
networkEvaluateInterval
|
|
21313
21417
|
});
|
|
21314
21418
|
}
|
|
21315
21419
|
}
|
|
21316
|
-
|
|
21420
|
+
_this11.logmanager.push(Object.assign({}, _this11.log.playing, _objectSpread2(_objectSpread2({
|
|
21317
21421
|
play_time: first ? 0 : playedTime
|
|
21318
21422
|
}, stats), flvStats)), true);
|
|
21319
|
-
|
|
21320
|
-
|
|
21321
|
-
|
|
21322
|
-
if (
|
|
21323
|
-
|
|
21423
|
+
_this11.log.playing.download_speed_array = [];
|
|
21424
|
+
_this11.log.playing.stall_time = 0;
|
|
21425
|
+
_this11.log.playing.stall_count = 0;
|
|
21426
|
+
if (_this11.options.aggregationDowngradeStallTime) {
|
|
21427
|
+
_this11.log.playing.aggregation_downgrade_stall = 0;
|
|
21324
21428
|
}
|
|
21325
21429
|
});
|
|
21326
21430
|
} catch (e2) {
|
|
@@ -21329,64 +21433,71 @@ var __publicField = (obj, key, value) => {
|
|
|
21329
21433
|
};
|
|
21330
21434
|
_proto2.handlePlayerPlaying = function handlePlayerPlaying() {
|
|
21331
21435
|
try {
|
|
21332
|
-
var
|
|
21333
|
-
if (
|
|
21436
|
+
var _this13 = this;
|
|
21437
|
+
if (_this13.player && _this13.player.video.readyState < 3) {
|
|
21438
|
+
return Promise.resolve();
|
|
21439
|
+
}
|
|
21440
|
+
_this13.player.off("playing", _this13.handlePlayerPlaying);
|
|
21441
|
+
_this13.player.off("timeupdate", _this13.handlePlayerPlaying);
|
|
21442
|
+
if (!_this13.player.video) {
|
|
21443
|
+
_this13.destroyFunc();
|
|
21444
|
+
return Promise.resolve();
|
|
21445
|
+
} else if (_this13.player.paused) {
|
|
21446
|
+
_this13.handleVideopause();
|
|
21334
21447
|
return Promise.resolve();
|
|
21335
21448
|
}
|
|
21336
|
-
|
|
21337
|
-
|
|
21338
|
-
|
|
21339
|
-
var _ref5 = _this9.core.getStats() || {}, fps = _ref5.fps;
|
|
21340
|
-
_this9.commonParams.fps = fps;
|
|
21449
|
+
if (_this13.core && _this13.core.getStats) {
|
|
21450
|
+
var _ref6 = _this13.core.getStats() || {}, fps = _ref6.fps;
|
|
21451
|
+
_this13.commonParams.fps = fps;
|
|
21341
21452
|
}
|
|
21342
|
-
return Promise.resolve(
|
|
21343
|
-
|
|
21344
|
-
var timer =
|
|
21345
|
-
|
|
21453
|
+
return Promise.resolve(_this13.reportPlaying(true)).then(function() {
|
|
21454
|
+
_this13.clearPlayingInterval();
|
|
21455
|
+
var timer = _this13.options.playingInterval || _this13.log.playing.play_time;
|
|
21456
|
+
_this13.intervalId = setInterval(function() {
|
|
21346
21457
|
try {
|
|
21347
|
-
var
|
|
21348
|
-
if (Math.abs(Date.now() -
|
|
21349
|
-
var
|
|
21350
|
-
if (!
|
|
21351
|
-
|
|
21458
|
+
var _temp8 = function() {
|
|
21459
|
+
if (Math.abs(Date.now() - _this13.log.playing.timestamp - timer) < 100 || Date.now() - _this13.log.playing.timestamp >= timer) {
|
|
21460
|
+
var _temp9 = function() {
|
|
21461
|
+
if (!_this13.player || !_this13.player.video) {
|
|
21462
|
+
_this13.destroyFunc();
|
|
21352
21463
|
} else {
|
|
21353
|
-
var
|
|
21354
|
-
if (
|
|
21355
|
-
|
|
21464
|
+
var _temp10 = function() {
|
|
21465
|
+
if (_this13.player.paused) {
|
|
21466
|
+
_this13.handleVideopause();
|
|
21356
21467
|
} else {
|
|
21357
|
-
return Promise.resolve(
|
|
21468
|
+
return Promise.resolve(_this13.reportPlaying()).then(function() {
|
|
21358
21469
|
});
|
|
21359
21470
|
}
|
|
21360
21471
|
}();
|
|
21361
|
-
if (
|
|
21362
|
-
return
|
|
21472
|
+
if (_temp10 && _temp10.then)
|
|
21473
|
+
return _temp10.then(function() {
|
|
21363
21474
|
});
|
|
21364
21475
|
}
|
|
21365
21476
|
}();
|
|
21366
|
-
if (
|
|
21367
|
-
return
|
|
21477
|
+
if (_temp9 && _temp9.then)
|
|
21478
|
+
return _temp9.then(function() {
|
|
21368
21479
|
});
|
|
21369
21480
|
}
|
|
21370
21481
|
}();
|
|
21371
|
-
return Promise.resolve(
|
|
21482
|
+
return Promise.resolve(_temp8 && _temp8.then ? _temp8.then(function() {
|
|
21372
21483
|
}) : void 0);
|
|
21373
21484
|
} catch (e2) {
|
|
21374
21485
|
return Promise.reject(e2);
|
|
21375
21486
|
}
|
|
21376
21487
|
}, 1e3);
|
|
21377
|
-
|
|
21378
|
-
|
|
21379
|
-
if (!
|
|
21380
|
-
|
|
21488
|
+
_this13.clearStallTimer();
|
|
21489
|
+
_this13.handleVideoplaying();
|
|
21490
|
+
if (!_this13.started) {
|
|
21491
|
+
_this13.reportStartPlay();
|
|
21381
21492
|
}
|
|
21382
|
-
|
|
21493
|
+
_this13.saveBuffered();
|
|
21383
21494
|
});
|
|
21384
21495
|
} catch (e2) {
|
|
21385
21496
|
return Promise.reject(e2);
|
|
21386
21497
|
}
|
|
21387
21498
|
};
|
|
21388
21499
|
_proto2.handlePlayerReady = function handlePlayerReady() {
|
|
21389
|
-
var
|
|
21500
|
+
var _this14 = this;
|
|
21390
21501
|
this.log.start_play.start_play_time = getCurrentTime();
|
|
21391
21502
|
if (this.player.config.autoplay) {
|
|
21392
21503
|
this.reportStartPlay();
|
|
@@ -21397,14 +21508,16 @@ var __publicField = (obj, key, value) => {
|
|
|
21397
21508
|
this.clearPlayResultTimer();
|
|
21398
21509
|
this.log.play_result.start = getCurrentTime();
|
|
21399
21510
|
this.playResultTimer = setTimeout(function() {
|
|
21400
|
-
if (
|
|
21511
|
+
if (_this14.log.play_result.timestamp >= _this14.log.play_result.start)
|
|
21512
|
+
return;
|
|
21513
|
+
if (!_this14.player || _this14.player.paused || !_this14.player.video)
|
|
21401
21514
|
return;
|
|
21402
|
-
|
|
21403
|
-
|
|
21515
|
+
_this14.log.play_result.is_threshold = 1;
|
|
21516
|
+
_this14.logmanager.push(_this14.log.play_result, true);
|
|
21404
21517
|
}, this.log.play_result.threshold);
|
|
21405
21518
|
};
|
|
21406
21519
|
_proto2.handlePlayerWaiting = function handlePlayerWaiting() {
|
|
21407
|
-
var
|
|
21520
|
+
var _this15 = this;
|
|
21408
21521
|
if (!!this.inWaitingStart || !this.log.first_frame.timestamp)
|
|
21409
21522
|
return;
|
|
21410
21523
|
this.log.stall.timestamp = this.inWaitingStart = this.log.stall.stall_start = getCurrentTime();
|
|
@@ -21416,11 +21529,13 @@ var __publicField = (obj, key, value) => {
|
|
|
21416
21529
|
this.log.stall.play_current_time = this.player.currentTime;
|
|
21417
21530
|
this.log.stall_start.buffered = this.getBuffered();
|
|
21418
21531
|
this.log.stall.buffered = this.log.stall_start.buffered;
|
|
21419
|
-
|
|
21532
|
+
var _this$getPlayerDownlo = this.getPlayerDownloadSpeed(), speed = _this$getPlayerDownlo.speed, avgSpeed = _this$getPlayerDownlo.avgSpeed;
|
|
21533
|
+
this.log.stall.current_speed = speed;
|
|
21534
|
+
this.log.stall.avg_speed = avgSpeed;
|
|
21420
21535
|
Object.assign(this.log.stall_start, this.videoSize);
|
|
21421
21536
|
this.clearStallTimer();
|
|
21422
21537
|
this.stallStartTimer = setTimeout(function() {
|
|
21423
|
-
|
|
21538
|
+
_this15.logmanager.push(_this15.log.stall_start, true);
|
|
21424
21539
|
}, 205);
|
|
21425
21540
|
};
|
|
21426
21541
|
_proto2.handleVideoseeking = function handleVideoseeking() {
|
|
@@ -21491,37 +21606,36 @@ var __publicField = (obj, key, value) => {
|
|
|
21491
21606
|
_proto2.handleVideoended = function handleVideoended() {
|
|
21492
21607
|
this.clearPlayingInterval();
|
|
21493
21608
|
this.clearStallTimer();
|
|
21494
|
-
Object.assign(this.log.playing,
|
|
21495
|
-
timestamp: getCurrentTime(),
|
|
21609
|
+
Object.assign(this.log.playing, {
|
|
21496
21610
|
is_last: 1
|
|
21497
|
-
}
|
|
21498
|
-
this.
|
|
21611
|
+
});
|
|
21612
|
+
this.reportPlaying();
|
|
21499
21613
|
};
|
|
21500
21614
|
_proto2.handleVideoerror = function handleVideoerror() {
|
|
21501
|
-
var
|
|
21615
|
+
var _this16 = this;
|
|
21502
21616
|
this.errorNumber = 1;
|
|
21503
21617
|
var error2 = this.player.video.error;
|
|
21504
21618
|
var firstframeFailed = function firstframeFailed2() {
|
|
21505
|
-
if (
|
|
21619
|
+
if (_this16.log.first_frame.first_frame_view === 0 && !_this16.log.first_frame_failed.code) {
|
|
21506
21620
|
if (error2) {
|
|
21507
|
-
|
|
21508
|
-
|
|
21509
|
-
if (
|
|
21510
|
-
|
|
21621
|
+
_this16.log.first_frame_failed.code = error2.code;
|
|
21622
|
+
_this16.log.first_frame_failed.msg = video_error[error2.code];
|
|
21623
|
+
if (_this16.log.first_frame_failed.timestamp !== void 0) {
|
|
21624
|
+
_this16.log.first_frame_failed.timestamp = getCurrentTime();
|
|
21511
21625
|
}
|
|
21512
|
-
|
|
21513
|
-
if (!
|
|
21514
|
-
|
|
21515
|
-
|
|
21516
|
-
|
|
21517
|
-
|
|
21626
|
+
_this16.logmanager.push(_this16.log.first_frame_failed, true);
|
|
21627
|
+
if (!_this16.log.play_result.is_threshold) {
|
|
21628
|
+
_this16.log.play_result.reason = video_error[error2.code] || "first frame failed";
|
|
21629
|
+
_this16.log.play_result.code = error2.code;
|
|
21630
|
+
_this16.clearPlayResultTimer();
|
|
21631
|
+
_this16.logmanager.push(_this16.log.play_result, true);
|
|
21518
21632
|
}
|
|
21519
21633
|
}
|
|
21520
21634
|
}
|
|
21521
|
-
if (
|
|
21522
|
-
|
|
21635
|
+
if (_this16.options.error_report_stop) {
|
|
21636
|
+
_this16.handleUserLeave();
|
|
21523
21637
|
} else {
|
|
21524
|
-
|
|
21638
|
+
_this16.updatePlayStopParams();
|
|
21525
21639
|
}
|
|
21526
21640
|
};
|
|
21527
21641
|
Object.assign(this.log.play_error, _objectSpread2(_objectSpread2({
|
|
@@ -21542,7 +21656,7 @@ var __publicField = (obj, key, value) => {
|
|
|
21542
21656
|
this.player.once("timeupdate", this.handlePlayerPlaying);
|
|
21543
21657
|
};
|
|
21544
21658
|
_proto2.destroyFunc = function destroyFunc(no_report_stop) {
|
|
21545
|
-
var
|
|
21659
|
+
var _this17 = this;
|
|
21546
21660
|
if (this.destroyed) {
|
|
21547
21661
|
return;
|
|
21548
21662
|
}
|
|
@@ -21556,7 +21670,7 @@ var __publicField = (obj, key, value) => {
|
|
|
21556
21670
|
window.removeEventListener("pagehide", this.handleUserLeave);
|
|
21557
21671
|
}
|
|
21558
21672
|
videoEvts.forEach(function(name) {
|
|
21559
|
-
|
|
21673
|
+
_this17.removeVideoEvt(name, _this17["handleVideo" + name + "Evt"]);
|
|
21560
21674
|
});
|
|
21561
21675
|
if (this.player) {
|
|
21562
21676
|
if (this.player._start) {
|
|
@@ -21580,26 +21694,26 @@ var __publicField = (obj, key, value) => {
|
|
|
21580
21694
|
this.player.off("bufferappend", this.handleBufferAppend);
|
|
21581
21695
|
this.player.off("core_event", this.handleCoreEvent);
|
|
21582
21696
|
this.player.off("degrade", this.handleDegrade);
|
|
21583
|
-
this._player = null;
|
|
21584
21697
|
}
|
|
21585
21698
|
this.clearPlayingInterval();
|
|
21586
21699
|
this.clearStallTimer();
|
|
21587
21700
|
this.clearPlayResultTimer();
|
|
21588
21701
|
clearTimeout(this.collectDownloadSpeedTimer);
|
|
21702
|
+
this._player = null;
|
|
21589
21703
|
};
|
|
21590
21704
|
_proto2.handleUserLeave = function handleUserLeave() {
|
|
21591
21705
|
try {
|
|
21592
|
-
var
|
|
21593
|
-
if (
|
|
21706
|
+
var _this19 = this;
|
|
21707
|
+
if (_this19.destroyed || !_this19.started) {
|
|
21594
21708
|
return Promise.resolve();
|
|
21595
21709
|
}
|
|
21596
|
-
|
|
21597
|
-
return Promise.resolve(
|
|
21598
|
-
|
|
21599
|
-
|
|
21600
|
-
|
|
21601
|
-
clearTimeout(
|
|
21602
|
-
|
|
21710
|
+
_this19.destroyed = true;
|
|
21711
|
+
return Promise.resolve(_this19.updatePlayStopParams()).then(function() {
|
|
21712
|
+
_this19.reportPlayStop();
|
|
21713
|
+
_this19.clearPlayingInterval();
|
|
21714
|
+
_this19.clearStallTimer();
|
|
21715
|
+
clearTimeout(_this19.collectDownloadSpeedTimer);
|
|
21716
|
+
_this19.removeWindowListener();
|
|
21603
21717
|
});
|
|
21604
21718
|
} catch (e2) {
|
|
21605
21719
|
return Promise.reject(e2);
|
|
@@ -21630,94 +21744,94 @@ var __publicField = (obj, key, value) => {
|
|
|
21630
21744
|
this.log.play_stop.play_current_time = this.player.currentTime || this.log.playing.play_current_time;
|
|
21631
21745
|
this.saveBuffered();
|
|
21632
21746
|
}
|
|
21633
|
-
this.logmanager.push(this.log.play_stop
|
|
21747
|
+
this.logmanager.push(this.log.play_stop);
|
|
21634
21748
|
};
|
|
21635
21749
|
_proto2.reportFirstframe = function reportFirstframe() {
|
|
21636
21750
|
if (this.firstFrameViewed) {
|
|
21637
21751
|
return;
|
|
21638
21752
|
}
|
|
21639
21753
|
if (this.core && this.core.getStats) {
|
|
21640
|
-
var
|
|
21754
|
+
var _ref7 = this.core.getStats() || {}, fps = _ref7.fps;
|
|
21641
21755
|
this.commonParams.fps = fps;
|
|
21642
21756
|
}
|
|
21757
|
+
var transferCost = this.getTransferCost(true);
|
|
21643
21758
|
this.firstFrameViewed = true;
|
|
21644
21759
|
var currentTime = getCurrentTime();
|
|
21645
|
-
Object.assign(this.log.first_frame, _objectSpread2({
|
|
21760
|
+
Object.assign(this.log.first_frame, _objectSpread2(_objectSpread2({
|
|
21646
21761
|
first_frame_view: currentTime - this.log.start_play.start_play_time || currentTime,
|
|
21647
21762
|
timestamp: currentTime
|
|
21648
|
-
}, this.videoSize));
|
|
21763
|
+
}, transferCost), this.videoSize));
|
|
21649
21764
|
if (this.log.first_frame.ttfb_end) {
|
|
21650
21765
|
this.log.first_frame.ttdb = currentTime - this.log.first_frame.ttfb_end;
|
|
21651
21766
|
}
|
|
21652
|
-
this.logmanager.push(this.log.first_frame
|
|
21767
|
+
this.logmanager.push(this.log.first_frame);
|
|
21653
21768
|
this.clearPlayResultTimer();
|
|
21654
21769
|
this.log.play_result.result = 1;
|
|
21655
|
-
this.logmanager.push(this.log.play_result
|
|
21770
|
+
this.logmanager.push(this.log.play_result);
|
|
21656
21771
|
this.log.play_stop.is_stream_received = 1;
|
|
21657
21772
|
};
|
|
21658
21773
|
_proto2.updatePlayStopParams = function updatePlayStopParams() {
|
|
21659
21774
|
try {
|
|
21660
|
-
var
|
|
21661
|
-
var
|
|
21775
|
+
var _this21$core;
|
|
21776
|
+
var _temp13 = function _temp132() {
|
|
21662
21777
|
Object.assign(play_stop, _objectSpread2({
|
|
21663
21778
|
timestamp: endTime,
|
|
21664
21779
|
stop_time: endTime,
|
|
21665
|
-
duration:
|
|
21666
|
-
play_time:
|
|
21667
|
-
},
|
|
21668
|
-
if (
|
|
21669
|
-
play_stop.play_time_on_no_frame = play_stop.stop_time -
|
|
21780
|
+
duration: _this21.playedTime / 1e3,
|
|
21781
|
+
play_time: _this21.playedTime / 1e3
|
|
21782
|
+
}, _this21.videoSize));
|
|
21783
|
+
if (_this21.errorNumber === 0) {
|
|
21784
|
+
play_stop.play_time_on_no_frame = play_stop.stop_time - _this21.log.start_play.start_play_time;
|
|
21670
21785
|
}
|
|
21671
21786
|
};
|
|
21672
|
-
var
|
|
21673
|
-
var timing = getResourceTiming(
|
|
21787
|
+
var _this21 = this;
|
|
21788
|
+
var timing = getResourceTiming(_this21._url);
|
|
21674
21789
|
var endTime = getCurrentTime();
|
|
21675
|
-
|
|
21676
|
-
var play_stop =
|
|
21790
|
+
_this21.playedTime = endTime - _this21.log.start_play.start_play_time;
|
|
21791
|
+
var play_stop = _this21.log.play_stop;
|
|
21677
21792
|
Object.assign(play_stop, _objectSpread2({}, play_stop.stall_count === 0 && {
|
|
21678
21793
|
stall_time: 0
|
|
21679
21794
|
}));
|
|
21680
|
-
if (
|
|
21681
|
-
play_stop.stall_time += endTime -
|
|
21795
|
+
if (_this21.inWaitingStart && endTime - _this21.inWaitingStart > 200) {
|
|
21796
|
+
play_stop.stall_time += endTime - _this21.inWaitingStart;
|
|
21682
21797
|
}
|
|
21683
|
-
|
|
21798
|
+
_this21.inWaitingStart = 0;
|
|
21684
21799
|
Object.assign(play_stop, _objectSpread2({
|
|
21685
|
-
stall_time_per_100sec: play_stop.stall_time /
|
|
21800
|
+
stall_time_per_100sec: play_stop.stall_time / _this21.playedTime * 100,
|
|
21686
21801
|
// 计算百秒卡顿时长
|
|
21687
|
-
stall_count_per_100sec: play_stop.stall_count * 1e3 /
|
|
21802
|
+
stall_count_per_100sec: play_stop.stall_count * 1e3 / _this21.playedTime * 100
|
|
21688
21803
|
}, timing));
|
|
21689
|
-
if (
|
|
21690
|
-
|
|
21804
|
+
if (_this21.log.play_stop.stall_count_per_100sec === 0) {
|
|
21805
|
+
_this21.log.play_stop.stall_time_per_100sec = 0;
|
|
21691
21806
|
}
|
|
21692
|
-
if (
|
|
21807
|
+
if (_this21.log.play_stop.stall_time_per_100sec > 100 || _this21.log.play_stop.stall_time_per_100sec < 0) {
|
|
21693
21808
|
return Promise.resolve();
|
|
21694
21809
|
}
|
|
21695
|
-
if (
|
|
21696
|
-
Object.assign(
|
|
21697
|
-
timestamp: getCurrentTime(),
|
|
21810
|
+
if (_this21.log.playing.index) {
|
|
21811
|
+
Object.assign(_this21.log.playing, {
|
|
21698
21812
|
is_last: 1
|
|
21699
|
-
}
|
|
21700
|
-
|
|
21813
|
+
});
|
|
21814
|
+
_this21.reportPlaying();
|
|
21701
21815
|
} else {
|
|
21702
|
-
|
|
21703
|
-
|
|
21816
|
+
_this21.log.play_stop.error_code = _this21.log.play_error.code;
|
|
21817
|
+
_this21.log.play_stop.error_info = _this21.log.play_error.info;
|
|
21704
21818
|
}
|
|
21705
21819
|
endTime = getCurrentTime();
|
|
21706
|
-
if ((
|
|
21707
|
-
var
|
|
21708
|
-
Object.assign(
|
|
21820
|
+
if ((_this21$core = _this21.core) === null || _this21$core === void 0 ? void 0 : _this21$core.getStats) {
|
|
21821
|
+
var _ref8 = _this21.core.getStats() || {}, totalReceivedByte = _ref8.totalReceivedByte, totalReceivedCost = _ref8.totalReceivedCost;
|
|
21822
|
+
Object.assign(_this21.log.play_stop, {
|
|
21709
21823
|
totalReceivedByte,
|
|
21710
21824
|
totalReceivedCost,
|
|
21711
21825
|
totalAverageSpeed: totalReceivedByte * 8 / (totalReceivedCost / 1e3)
|
|
21712
21826
|
// bps
|
|
21713
21827
|
});
|
|
21714
21828
|
}
|
|
21715
|
-
var
|
|
21716
|
-
var
|
|
21717
|
-
if ((
|
|
21718
|
-
return Promise.resolve(
|
|
21719
|
-
var video =
|
|
21720
|
-
var
|
|
21829
|
+
var _temp14 = function() {
|
|
21830
|
+
var _this21$core2;
|
|
21831
|
+
if ((_this21$core2 = _this21.core) === null || _this21$core2 === void 0 ? void 0 : _this21$core2.getStatsSnapshoot) {
|
|
21832
|
+
return Promise.resolve(_this21.core.getStatsSnapshoot()).then(function(_ref9) {
|
|
21833
|
+
var video = _ref9.video;
|
|
21834
|
+
var _ref10 = video || {}, packetsLost = _ref10.packetsLost, packetsReceived = _ref10.packetsReceived;
|
|
21721
21835
|
Object.assign(play_stop, {
|
|
21722
21836
|
packetsLost,
|
|
21723
21837
|
packetsReceived,
|
|
@@ -21726,7 +21840,7 @@ var __publicField = (obj, key, value) => {
|
|
|
21726
21840
|
});
|
|
21727
21841
|
}
|
|
21728
21842
|
}();
|
|
21729
|
-
return Promise.resolve(
|
|
21843
|
+
return Promise.resolve(_temp14 && _temp14.then ? _temp14.then(_temp13) : _temp13(_temp14));
|
|
21730
21844
|
} catch (e2) {
|
|
21731
21845
|
return Promise.reject(e2);
|
|
21732
21846
|
}
|
|
@@ -22523,8 +22637,6 @@ var __publicField = (obj, key, value) => {
|
|
|
22523
22637
|
class Logger extends Plugin {
|
|
22524
22638
|
constructor() {
|
|
22525
22639
|
super(...arguments);
|
|
22526
|
-
__publicField(this, "_userId");
|
|
22527
|
-
__publicField(this, "_deviceId");
|
|
22528
22640
|
__publicField(this, "_liveLogger");
|
|
22529
22641
|
}
|
|
22530
22642
|
static get pluginName() {
|
|
@@ -22580,8 +22692,8 @@ var __publicField = (obj, key, value) => {
|
|
|
22580
22692
|
});
|
|
22581
22693
|
q.start();
|
|
22582
22694
|
q.config({
|
|
22583
|
-
user_unique_id: this.
|
|
22584
|
-
device_id: this.
|
|
22695
|
+
user_unique_id: this.config.userId,
|
|
22696
|
+
device_id: this.config.deviceId
|
|
22585
22697
|
});
|
|
22586
22698
|
}
|
|
22587
22699
|
_start() {
|
|
@@ -22592,14 +22704,14 @@ var __publicField = (obj, key, value) => {
|
|
|
22592
22704
|
aid: this.config.appId || 654925,
|
|
22593
22705
|
project_key: this.config.appId,
|
|
22594
22706
|
app_name: this.config.appName || this.config.appId,
|
|
22595
|
-
user_id: this.
|
|
22596
|
-
device_id: this.
|
|
22707
|
+
user_id: this.config.userId,
|
|
22708
|
+
device_id: this.config.deviceId,
|
|
22597
22709
|
error_report_stop: true,
|
|
22598
22710
|
ext: {
|
|
22599
|
-
veplayer_version: "2.7.1-rc.
|
|
22711
|
+
veplayer_version: "2.7.1-rc.2",
|
|
22600
22712
|
flv_version: "3.0.21-rc.21",
|
|
22601
22713
|
hls_version: "3.0.21-rc.21",
|
|
22602
|
-
rts_version: "0.2.1-alpha.
|
|
22714
|
+
rts_version: "0.2.1-alpha.24"
|
|
22603
22715
|
}
|
|
22604
22716
|
});
|
|
22605
22717
|
}
|
|
@@ -23788,6 +23900,12 @@ var __publicField = (obj, key, value) => {
|
|
|
23788
23900
|
*/
|
|
23789
23901
|
constructor(options) {
|
|
23790
23902
|
super(options);
|
|
23903
|
+
/** {en}
|
|
23904
|
+
* @hidden
|
|
23905
|
+
*/
|
|
23906
|
+
/** {zh}
|
|
23907
|
+
* @hidden
|
|
23908
|
+
*/
|
|
23791
23909
|
__publicField(this, "_protocolManager");
|
|
23792
23910
|
}
|
|
23793
23911
|
/** {zh}
|
|
@@ -23898,10 +24016,11 @@ var __publicField = (obj, key, value) => {
|
|
|
23898
24016
|
}
|
|
23899
24017
|
/** {zh}
|
|
23900
24018
|
* @brief 调用此方法更新 DRM 配置。
|
|
24019
|
+
* @param config DRM 配置对象,包含 Fairplay DRM 的相关设置。
|
|
23901
24020
|
*/
|
|
23902
24021
|
/** {en}
|
|
23903
24022
|
* @brief Use this method to update DRM configuration.
|
|
23904
|
-
* @param config
|
|
24023
|
+
* @param config A configuration object containing settings for Fairplay DRM.
|
|
23905
24024
|
*/
|
|
23906
24025
|
updateDrmConfig(config) {
|
|
23907
24026
|
var _a, _b, _c;
|
|
@@ -23979,10 +24098,29 @@ var __publicField = (obj, key, value) => {
|
|
|
23979
24098
|
var _a, _b, _c;
|
|
23980
24099
|
return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.hls) == null ? void 0 : _c.getStats();
|
|
23981
24100
|
}
|
|
24101
|
+
/** {en}
|
|
24102
|
+
* @brief This method is used to update the playlist, supporting updates to source, resolution, and related information.
|
|
24103
|
+
* @param playlist The playlist, consisting of multiple `Source` type elements.
|
|
24104
|
+
* @param target An optional target configuration, which can specify the resolution or source. Providing this information helps update the playback source for a specific resolution or stream.
|
|
24105
|
+
* @param needUpdateProtocol Whether the protocol needs to be updated.
|
|
24106
|
+
*
|
|
24107
|
+
* - `true`: Forces the protocol update to ensure compatibility with the playback configuration or source.
|
|
24108
|
+
* - `false`: Does not update the protocol and continues to use the current configuration.
|
|
24109
|
+
*/
|
|
24110
|
+
/** {zh}
|
|
24111
|
+
* @brief 调用此方法更新播放列表,支持更新源、清晰度等相关信息。
|
|
24112
|
+
* @param playlist 播放列表,包含多个 `Source` 类型的元素。
|
|
24113
|
+
* @param target 可选的目标配置项,可以指定清晰度或源。提供这些信息可以帮助更新特定清晰度或线路的播放源。
|
|
24114
|
+
* @param needUpdateProtocol 是否需要更新协议。
|
|
24115
|
+
* - `true`:强制更新协议,以确保播放配置或源的兼容性。
|
|
24116
|
+
* - `false`:不更新协议,继续使用当前配置。
|
|
24117
|
+
*/
|
|
23982
24118
|
async updatePlaylist(playlist, target, needUpdateProtocol = true) {
|
|
23983
24119
|
var _a;
|
|
23984
24120
|
if (needUpdateProtocol) {
|
|
23985
|
-
await ((_a = this._protocolManager) == null ? void 0 : _a.update({
|
|
24121
|
+
await ((_a = this._protocolManager) == null ? void 0 : _a.update({
|
|
24122
|
+
playlist
|
|
24123
|
+
}));
|
|
23986
24124
|
}
|
|
23987
24125
|
return super.updatePlaylist(playlist, target);
|
|
23988
24126
|
}
|
|
@@ -24018,7 +24156,9 @@ var __publicField = (obj, key, value) => {
|
|
|
24018
24156
|
i18nManager: i18n,
|
|
24019
24157
|
preProcessUrl: (url) => {
|
|
24020
24158
|
if (isType(".ts", url)) {
|
|
24021
|
-
return {
|
|
24159
|
+
return {
|
|
24160
|
+
url
|
|
24161
|
+
};
|
|
24022
24162
|
}
|
|
24023
24163
|
return {
|
|
24024
24164
|
url: generateUrlWithSessionId(url)
|
|
@@ -24026,7 +24166,9 @@ var __publicField = (obj, key, value) => {
|
|
|
24026
24166
|
},
|
|
24027
24167
|
async preparePlugins(url) {
|
|
24028
24168
|
if (!protocolManager.enableSelector) {
|
|
24029
|
-
await protocolManager.update({
|
|
24169
|
+
await protocolManager.update({
|
|
24170
|
+
url
|
|
24171
|
+
});
|
|
24030
24172
|
}
|
|
24031
24173
|
return protocolManager.getStrategy(player, i18n);
|
|
24032
24174
|
}
|