@byteplus/veplayer-plugin 2.10.3 → 2.10.4-rc.1
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.development.js +2004 -2120
- package/esm/index.production.js +7 -7
- package/esm/veplayer.plugin.flv.development.js +4 -3
- package/esm/veplayer.plugin.flv.production.js +1 -1
- package/esm/veplayer.plugin.rtm.development.js +274 -129
- package/esm/veplayer.plugin.rtm.production.js +1 -1
- package/package.json +1 -1
- package/umd/veplayer.plugin.flv.development.js +4 -3
- package/umd/veplayer.plugin.flv.production.js +1 -1
- package/umd/veplayer.plugin.rtm.development.js +274 -129
- package/umd/veplayer.plugin.rtm.production.js +1 -1
|
@@ -5081,9 +5081,9 @@
|
|
|
5081
5081
|
lib.parseRemoteCandidates = parser.parseRemoteCandidates;
|
|
5082
5082
|
lib.parseImageAttributes = parser.parseImageAttributes;
|
|
5083
5083
|
lib.parseSimulcastStreamList = parser.parseSimulcastStreamList;
|
|
5084
|
-
var _excluded = ["adaptiveJitterBuffer"];
|
|
5084
|
+
var _excluded = ["adaptiveJitterBuffer", "standardizeKillSwitch"];
|
|
5085
5085
|
function getOption(options) {
|
|
5086
|
-
var _ref = options || {}, _ref$adaptiveJitterBu = _ref.adaptiveJitterBuffer, adaptiveJitterBuffer = _ref$adaptiveJitterBu === void 0 ? {} : _ref$adaptiveJitterBu, opts = _objectWithoutProperties$1(_ref, _excluded);
|
|
5086
|
+
var _ref = options || {}, _ref$adaptiveJitterBu = _ref.adaptiveJitterBuffer, adaptiveJitterBuffer = _ref$adaptiveJitterBu === void 0 ? {} : _ref$adaptiveJitterBu, _ref$standardizeKillS = _ref.standardizeKillSwitch, standardizeKillSwitch = _ref$standardizeKillS === void 0 ? {} : _ref$standardizeKillS, opts = _objectWithoutProperties$1(_ref, _excluded);
|
|
5087
5087
|
return _objectSpread2$2({
|
|
5088
5088
|
retryCount: 0,
|
|
5089
5089
|
retryDelay: 1e3,
|
|
@@ -5154,7 +5154,12 @@
|
|
|
5154
5154
|
5: {
|
|
5155
5155
|
jitterBuffer: 3
|
|
5156
5156
|
}
|
|
5157
|
-
}
|
|
5157
|
+
},
|
|
5158
|
+
standardizeKillSwitch: _objectSpread2$2({
|
|
5159
|
+
sld_fmtp_opus: true,
|
|
5160
|
+
sld_rtcpfb_opus_nack: true,
|
|
5161
|
+
sld_fmtp_sps_pps: true
|
|
5162
|
+
}, standardizeKillSwitch)
|
|
5158
5163
|
}, opts);
|
|
5159
5164
|
}
|
|
5160
5165
|
function _getStats(stats) {
|
|
@@ -5496,7 +5501,7 @@
|
|
|
5496
5501
|
});
|
|
5497
5502
|
}
|
|
5498
5503
|
var isEncodedTransformSupported = function isEncodedTransformSupported2() {
|
|
5499
|
-
return typeof TransformStream !== "undefined" && typeof RTCRtpSender !== "undefined" && typeof RTCRtpReceiver !== "undefined" && typeof RTCRtpScriptTransform !== "undefined" && "transform" in RTCRtpSender.prototype && "transform" in RTCRtpReceiver.prototype && isWorkerSupported() && isMessageChannelSupported();
|
|
5504
|
+
return typeof window.TransformStream !== "undefined" && typeof window.RTCRtpSender !== "undefined" && typeof window.RTCRtpReceiver !== "undefined" && typeof window.RTCRtpScriptTransform !== "undefined" && "transform" in window.RTCRtpSender.prototype && "transform" in window.RTCRtpReceiver.prototype && isWorkerSupported() && isMessageChannelSupported();
|
|
5500
5505
|
};
|
|
5501
5506
|
var isWorkerSupported = function isWorkerSupported2() {
|
|
5502
5507
|
return typeof window !== "undefined" && window.Worker;
|
|
@@ -5505,7 +5510,7 @@
|
|
|
5505
5510
|
return typeof MessageChannel !== "undefined";
|
|
5506
5511
|
};
|
|
5507
5512
|
var isLegacyEncodedTransformSupported = function isLegacyEncodedTransformSupported2() {
|
|
5508
|
-
return typeof TransformStream !== "undefined" && typeof RTCRtpSender !== "undefined" && typeof RTCRtpReceiver !== "undefined" && typeof RTCRtpSender.prototype.createEncodedStreams !== "undefined" && typeof RTCRtpReceiver.prototype.createEncodedStreams !== "undefined";
|
|
5513
|
+
return typeof window.TransformStream !== "undefined" && typeof window.RTCRtpSender !== "undefined" && typeof window.RTCRtpReceiver !== "undefined" && typeof window.RTCRtpSender.prototype.createEncodedStreams !== "undefined" && typeof window.RTCRtpReceiver.prototype.createEncodedStreams !== "undefined";
|
|
5509
5514
|
};
|
|
5510
5515
|
var Nalunit = {
|
|
5511
5516
|
getNALUnits: function getNALUnits(buffer) {
|
|
@@ -6683,6 +6688,8 @@
|
|
|
6683
6688
|
currentStats.firCount = stat.firCount;
|
|
6684
6689
|
currentStats.nackCount = stat.nackCount;
|
|
6685
6690
|
currentStats.pliCount = stat.pliCount;
|
|
6691
|
+
currentStats.fecPacketsReceived = stat.fecPacketsReceived;
|
|
6692
|
+
currentStats.fecSsrc = stat.fecSsrc;
|
|
6686
6693
|
if (stat.jitterBufferDelay !== void 0) {
|
|
6687
6694
|
currentStats.jitterBufferEmittedCount = stat.jitterBufferEmittedCount;
|
|
6688
6695
|
currentStats.jitterBufferDelay = stat.jitterBufferDelay;
|
|
@@ -6747,12 +6754,14 @@
|
|
|
6747
6754
|
nackCount,
|
|
6748
6755
|
pliCount: diffNumber(oldStats, newStats, "pliCount"),
|
|
6749
6756
|
e2eDelay: Math.round((newStats.rtt || 0) + jitterBufferDelay),
|
|
6750
|
-
retransmittedRate: +(nackCount / (packetsReceived + packetsLostDiff)).toFixed(2)
|
|
6757
|
+
retransmittedRate: +(nackCount / (packetsReceived + packetsLostDiff)).toFixed(2),
|
|
6758
|
+
fecPacketsReceived: diffNumber(oldStats, newStats, "fecPacketsReceived"),
|
|
6759
|
+
fecSsrc: newStats.fecSsrc
|
|
6751
6760
|
};
|
|
6752
6761
|
}
|
|
6753
6762
|
function diffNumber(oldValue, newValue, key) {
|
|
6754
|
-
var oldV = Number.
|
|
6755
|
-
var newV = Number.
|
|
6763
|
+
var oldV = !Number.isFinite(oldValue[key]) ? 0 : +oldValue[key];
|
|
6764
|
+
var newV = !Number.isFinite(newValue[key]) ? 0 : +newValue[key];
|
|
6756
6765
|
return Math.max(0, newV - oldV);
|
|
6757
6766
|
}
|
|
6758
6767
|
var QoELevel = {
|
|
@@ -6883,6 +6892,63 @@
|
|
|
6883
6892
|
}]);
|
|
6884
6893
|
return NetworkQuality2;
|
|
6885
6894
|
}();
|
|
6895
|
+
var gpuInfo;
|
|
6896
|
+
function getGpuInfo() {
|
|
6897
|
+
if (!gpuInfo) {
|
|
6898
|
+
gpuInfo = _getGpuInfo();
|
|
6899
|
+
}
|
|
6900
|
+
return gpuInfo;
|
|
6901
|
+
}
|
|
6902
|
+
function _getGpuInfo() {
|
|
6903
|
+
var canvas = document.createElement("canvas");
|
|
6904
|
+
var gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
|
|
6905
|
+
if (!gl) {
|
|
6906
|
+
return {
|
|
6907
|
+
renderer: "unknown(WebGLRenderingContext not existed)",
|
|
6908
|
+
vendor: "unknown(WebGLRenderingContext not existed)"
|
|
6909
|
+
};
|
|
6910
|
+
}
|
|
6911
|
+
var info = gl.getExtension("WEBGL_debug_renderer_info");
|
|
6912
|
+
if (!info) {
|
|
6913
|
+
return {
|
|
6914
|
+
renderer: "unknown(info not existed)",
|
|
6915
|
+
vendor: "unknown(info not existed)"
|
|
6916
|
+
};
|
|
6917
|
+
}
|
|
6918
|
+
var renderer = gl.getParameter(info.UNMASKED_RENDERER_WEBGL);
|
|
6919
|
+
var vendor = gl.getParameter(info.UNMASKED_VENDOR_WEBGL);
|
|
6920
|
+
if (canvas && canvas.parentNode) {
|
|
6921
|
+
canvas.parentNode.removeChild(canvas);
|
|
6922
|
+
}
|
|
6923
|
+
canvas = void 0;
|
|
6924
|
+
gl = void 0;
|
|
6925
|
+
return {
|
|
6926
|
+
renderer,
|
|
6927
|
+
vendor
|
|
6928
|
+
};
|
|
6929
|
+
}
|
|
6930
|
+
function extractProfileInfo(sdpFmtpLine) {
|
|
6931
|
+
var profileLevelId = "";
|
|
6932
|
+
if (!sdpFmtpLine) {
|
|
6933
|
+
return profileLevelId;
|
|
6934
|
+
}
|
|
6935
|
+
var paramArray = sdpFmtpLine.split(";");
|
|
6936
|
+
var _iterator = _createForOfIteratorHelper$1(paramArray), _step;
|
|
6937
|
+
try {
|
|
6938
|
+
for (_iterator.s(); !(_step = _iterator.n()).done; ) {
|
|
6939
|
+
var param = _step.value;
|
|
6940
|
+
var _param$trim$split = param.trim().split("="), _param$trim$split2 = _slicedToArray(_param$trim$split, 2), key = _param$trim$split2[0], value = _param$trim$split2[1];
|
|
6941
|
+
if (key === "profile-level-id") {
|
|
6942
|
+
profileLevelId = value;
|
|
6943
|
+
}
|
|
6944
|
+
}
|
|
6945
|
+
} catch (err) {
|
|
6946
|
+
_iterator.e(err);
|
|
6947
|
+
} finally {
|
|
6948
|
+
_iterator.f();
|
|
6949
|
+
}
|
|
6950
|
+
return profileLevelId;
|
|
6951
|
+
}
|
|
6886
6952
|
var FIRST_FRAME_STATE_ORDER = [RTC_FIRST_FRAME_STATE.LOAD_START, RTC_FIRST_FRAME_STATE.OFFER_SDP_READY, RTC_FIRST_FRAME_STATE.ANSWER_SDP_RECV, RTC_FIRST_FRAME_STATE.ANSWER_SDP_READY, RTC_FIRST_FRAME_STATE.ICE_CONNECTED, RTC_FIRST_FRAME_STATE.DTLS_CONNECTED, RTC_FIRST_FRAME_STATE.PEER_CONNECTED, RTC_FIRST_FRAME_STATE.FIRST_PACKET_RECV, RTC_FIRST_FRAME_STATE.FIRST_FRAME_RECV, RTC_FIRST_FRAME_STATE.FIRST_FRAME_DECODED, RTC_FIRST_FRAME_STATE.VIDEO_LOADEDDATA, RTC_FIRST_FRAME_STATE.VIDEO_CANPLAY, RTC_FIRST_FRAME_STATE.VIDEO_PLAYING];
|
|
6887
6953
|
var FirstFrameObserver = /* @__PURE__ */ function() {
|
|
6888
6954
|
function FirstFrameObserver2(_emitFirstFrameState) {
|
|
@@ -6896,6 +6962,7 @@
|
|
|
6896
6962
|
this._pc = null;
|
|
6897
6963
|
this._video = null;
|
|
6898
6964
|
this._videoTransceiver = null;
|
|
6965
|
+
this._audioTransceiver = null;
|
|
6899
6966
|
this._extraInfo = {
|
|
6900
6967
|
is_preload: false
|
|
6901
6968
|
};
|
|
@@ -6968,11 +7035,12 @@
|
|
|
6968
7035
|
}
|
|
6969
7036
|
}, {
|
|
6970
7037
|
key: "bindEvents",
|
|
6971
|
-
value: function bindEvents(pc, videoTransceiver, video) {
|
|
7038
|
+
value: function bindEvents(pc, videoTransceiver, audioTransceiver, video) {
|
|
6972
7039
|
var _this3 = this;
|
|
6973
7040
|
this._pc = pc;
|
|
6974
7041
|
this._video = video;
|
|
6975
7042
|
this._videoTransceiver = videoTransceiver;
|
|
7043
|
+
this._audioTransceiver = audioTransceiver;
|
|
6976
7044
|
pc.addEventListener("connectionstatechange", this._handleConnectionStateChange);
|
|
6977
7045
|
pc.addEventListener("iceconnectionstatechange", this._handleICEConnectionStateChange);
|
|
6978
7046
|
var _ref2 = (videoTransceiver === null || videoTransceiver === void 0 ? void 0 : videoTransceiver.receiver) || {}, transport = _ref2.transport;
|
|
@@ -7046,7 +7114,9 @@
|
|
|
7046
7114
|
if (Object.keys(this._state).length > 0) {
|
|
7047
7115
|
var state = _objectSpread2$2({}, this._state);
|
|
7048
7116
|
var extraInfo = _objectSpread2$2({}, this._extraInfo);
|
|
7049
|
-
getTransportInfo(this._videoTransceiver, extraInfo).
|
|
7117
|
+
Promise.all([getTransportInfo(this._videoTransceiver, extraInfo), getAudioCodecInfo(this._audioTransceiver, extraInfo)]).catch(function(e) {
|
|
7118
|
+
extraInfo.failure_reason = e.message;
|
|
7119
|
+
}).finally(function() {
|
|
7050
7120
|
_this5._emitFirstFrameState(state, extraInfo);
|
|
7051
7121
|
});
|
|
7052
7122
|
}
|
|
@@ -7065,6 +7135,7 @@
|
|
|
7065
7135
|
this._pc = null;
|
|
7066
7136
|
this._video = null;
|
|
7067
7137
|
this._videoTransceiver = null;
|
|
7138
|
+
this._audioTransceiver = null;
|
|
7068
7139
|
}
|
|
7069
7140
|
}]);
|
|
7070
7141
|
return FirstFrameObserver2;
|
|
@@ -7072,7 +7143,7 @@
|
|
|
7072
7143
|
var getTransportInfo = /* @__PURE__ */ function() {
|
|
7073
7144
|
var _ref4 = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee2(videoTransceiver, extraInfo) {
|
|
7074
7145
|
var _videoTransceiver$rec;
|
|
7075
|
-
var reports, candidatePairStats, localCandidateStats, remoteCandidateStats;
|
|
7146
|
+
var reports, candidatePairStats, localCandidateStats, remoteCandidateStats, inboundRtpStats, codecStats, _inboundRtpStats4;
|
|
7076
7147
|
return _regeneratorRuntime$1().wrap(function _callee2$(_context2) {
|
|
7077
7148
|
while (1)
|
|
7078
7149
|
switch (_context2.prev = _context2.next) {
|
|
@@ -7087,6 +7158,9 @@
|
|
|
7087
7158
|
candidatePairStats = report;
|
|
7088
7159
|
localCandidateStats = reports.get(report.localCandidateId);
|
|
7089
7160
|
remoteCandidateStats = reports.get(report.remoteCandidateId);
|
|
7161
|
+
} else if (report.type === "inbound-rtp") {
|
|
7162
|
+
inboundRtpStats = report;
|
|
7163
|
+
codecStats = reports.get(report.codecId);
|
|
7090
7164
|
}
|
|
7091
7165
|
});
|
|
7092
7166
|
if (remoteCandidateStats) {
|
|
@@ -7107,7 +7181,20 @@
|
|
|
7107
7181
|
extraInfo.stun_responses_sent = candidatePairStats.responsesSent;
|
|
7108
7182
|
extraInfo.stun_responses_received = candidatePairStats.responsesReceived;
|
|
7109
7183
|
}
|
|
7110
|
-
|
|
7184
|
+
if (codecStats) {
|
|
7185
|
+
extraInfo.video_codec = codecStats.mimeType;
|
|
7186
|
+
extraInfo.video_fmtp = codecStats.sdpFmtpLine;
|
|
7187
|
+
extraInfo.video_profile_level_id = extractProfileInfo(codecStats.sdpFmtpLine);
|
|
7188
|
+
}
|
|
7189
|
+
if (inboundRtpStats) {
|
|
7190
|
+
extraInfo.video_width = inboundRtpStats.frameWidth;
|
|
7191
|
+
extraInfo.video_height = inboundRtpStats.frameHeight;
|
|
7192
|
+
extraInfo.video_framerate = inboundRtpStats.framesPerSecond;
|
|
7193
|
+
extraInfo.video_decoder_name = inboundRtpStats.decoderImplementation;
|
|
7194
|
+
extraInfo.video_result = ((_inboundRtpStats4 = inboundRtpStats) === null || _inboundRtpStats4 === void 0 ? void 0 : _inboundRtpStats4.framesDecoded) > 0 ? true : false;
|
|
7195
|
+
}
|
|
7196
|
+
extraInfo.gpu_info = getGpuInfo().renderer;
|
|
7197
|
+
case 10:
|
|
7111
7198
|
case "end":
|
|
7112
7199
|
return _context2.stop();
|
|
7113
7200
|
}
|
|
@@ -7117,6 +7204,43 @@
|
|
|
7117
7204
|
return _ref4.apply(this, arguments);
|
|
7118
7205
|
};
|
|
7119
7206
|
}();
|
|
7207
|
+
var getAudioCodecInfo = /* @__PURE__ */ function() {
|
|
7208
|
+
var _ref5 = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee3(audioTransceiver, extraInfo) {
|
|
7209
|
+
var _audioTransceiver$rec;
|
|
7210
|
+
var reports, inboundRtpStats, codecStats, _inboundRtpStats5, _inboundRtpStats6, _inboundRtpStats7, _inboundRtpStats8, _inboundRtpStats9, _inboundRtpStats10;
|
|
7211
|
+
return _regeneratorRuntime$1().wrap(function _callee3$(_context3) {
|
|
7212
|
+
while (1)
|
|
7213
|
+
switch (_context3.prev = _context3.next) {
|
|
7214
|
+
case 0:
|
|
7215
|
+
_context3.next = 2;
|
|
7216
|
+
return audioTransceiver === null || audioTransceiver === void 0 ? void 0 : (_audioTransceiver$rec = audioTransceiver.receiver) === null || _audioTransceiver$rec === void 0 ? void 0 : _audioTransceiver$rec.getStats().catch(function() {
|
|
7217
|
+
});
|
|
7218
|
+
case 2:
|
|
7219
|
+
reports = _context3.sent;
|
|
7220
|
+
reports === null || reports === void 0 ? void 0 : reports.forEach(function(report) {
|
|
7221
|
+
if (report.type === "inbound-rtp") {
|
|
7222
|
+
inboundRtpStats = report;
|
|
7223
|
+
codecStats = reports.get(report.codecId);
|
|
7224
|
+
}
|
|
7225
|
+
});
|
|
7226
|
+
if (codecStats) {
|
|
7227
|
+
extraInfo.audio_codec = codecStats.mimeType;
|
|
7228
|
+
extraInfo.audio_fmtp = codecStats.sdpFmtpLine;
|
|
7229
|
+
}
|
|
7230
|
+
if (inboundRtpStats) {
|
|
7231
|
+
extraInfo.audio_packet_received = ((_inboundRtpStats5 = inboundRtpStats) === null || _inboundRtpStats5 === void 0 ? void 0 : _inboundRtpStats5.packetsReceived) > 0;
|
|
7232
|
+
extraInfo.audio_result = ((_inboundRtpStats6 = inboundRtpStats) === null || _inboundRtpStats6 === void 0 ? void 0 : _inboundRtpStats6.audioLevel) !== 0 || ((_inboundRtpStats7 = inboundRtpStats) === null || _inboundRtpStats7 === void 0 ? void 0 : _inboundRtpStats7.totalAudioEnergy) !== 0 || ((_inboundRtpStats8 = inboundRtpStats) === null || _inboundRtpStats8 === void 0 ? void 0 : _inboundRtpStats8.totalSamplesReceived) > 0 && ((_inboundRtpStats9 = inboundRtpStats) === null || _inboundRtpStats9 === void 0 ? void 0 : _inboundRtpStats9.totalSamplesReceived) !== ((_inboundRtpStats10 = inboundRtpStats) === null || _inboundRtpStats10 === void 0 ? void 0 : _inboundRtpStats10.concealedSamples) ? true : false;
|
|
7233
|
+
}
|
|
7234
|
+
case 6:
|
|
7235
|
+
case "end":
|
|
7236
|
+
return _context3.stop();
|
|
7237
|
+
}
|
|
7238
|
+
}, _callee3);
|
|
7239
|
+
}));
|
|
7240
|
+
return function getAudioCodecInfo2(_x3, _x4) {
|
|
7241
|
+
return _ref5.apply(this, arguments);
|
|
7242
|
+
};
|
|
7243
|
+
}();
|
|
7120
7244
|
function changeNumberInRange(source, min, max, delta) {
|
|
7121
7245
|
var target = source + delta;
|
|
7122
7246
|
if (target > max) {
|
|
@@ -7397,13 +7521,13 @@
|
|
|
7397
7521
|
_this$_opts$adaptiveJ = _this._opts.adaptiveJitterBuffer, loopInterval = _this$_opts$adaptiveJ.loopInterval, maxAvSyncDelay = _this$_opts$adaptiveJ.maxAvSyncDelay, maxJitterBufferDiff = _this$_opts$adaptiveJ.maxJitterBufferDiff, maxStep = _this$_opts$adaptiveJ.maxStep;
|
|
7398
7522
|
avDiffTooMuchCount = 0;
|
|
7399
7523
|
_this._setDelayTimer = setInterval(/* @__PURE__ */ _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee3() {
|
|
7400
|
-
var _this$_audioTransceic4, _this$_videoTransceic3, currentTargetDelay, targetDelayMs, currentTargetDelayMs, _yield$Promise$all, _yield$Promise$all2, curAudioStats, curVideoStats, audioStats, videoStats, av_sync_diff, currentAudioDelay, currentVideoDelay, addOrReduce, nextJitterBufferDelay;
|
|
7524
|
+
var _this$_audioTransceic4, _this$_audioTransceic5, _this$_videoTransceic3, _this$_videoTransceic4, currentTargetDelay, targetDelayMs, currentTargetDelayMs, _yield$Promise$all, _yield$Promise$all2, curAudioStats, curVideoStats, audioStats, videoStats, av_sync_diff, currentAudioDelay, currentVideoDelay, addOrReduce, nextJitterBufferDelay;
|
|
7401
7525
|
return _regeneratorRuntime$1().wrap(function _callee3$(_context3) {
|
|
7402
7526
|
while (1)
|
|
7403
7527
|
switch (_context3.prev = _context3.next) {
|
|
7404
7528
|
case 0:
|
|
7405
7529
|
_context3.prev = 0;
|
|
7406
|
-
if (!(!((_this$_audioTransceic4 = _this._audioTransceicer) !== null && _this$_audioTransceic4 !== void 0 && _this$_audioTransceic4.receiver) || !((_this$_videoTransceic3 = _this._videoTransceicer) !== null && _this$_videoTransceic3 !== void 0 && _this$_videoTransceic3.receiver))) {
|
|
7530
|
+
if (!(!((_this$_audioTransceic4 = _this._audioTransceicer) !== null && _this$_audioTransceic4 !== void 0 && (_this$_audioTransceic5 = _this$_audioTransceic4.receiver) !== null && _this$_audioTransceic5 !== void 0 && _this$_audioTransceic5.getStats) || !((_this$_videoTransceic3 = _this._videoTransceicer) !== null && _this$_videoTransceic3 !== void 0 && (_this$_videoTransceic4 = _this$_videoTransceic3.receiver) !== null && _this$_videoTransceic4 !== void 0 && _this$_videoTransceic4.getStats))) {
|
|
7407
7531
|
_context3.next = 5;
|
|
7408
7532
|
break;
|
|
7409
7533
|
}
|
|
@@ -7494,20 +7618,19 @@
|
|
|
7494
7618
|
}();
|
|
7495
7619
|
_this._getDelay = function() {
|
|
7496
7620
|
try {
|
|
7497
|
-
var _this$
|
|
7621
|
+
var _this$_audioTransceic7;
|
|
7498
7622
|
var key = ["playoutDelayHint", "jitterBufferDelayHint", "jitterBufferTarget"].find(function(key2) {
|
|
7499
|
-
var _this$
|
|
7500
|
-
return key2 in (((_this$
|
|
7623
|
+
var _this$_videoTransceic5, _this$_audioTransceic6;
|
|
7624
|
+
return key2 in (((_this$_videoTransceic5 = _this._videoTransceicer) === null || _this$_videoTransceic5 === void 0 ? void 0 : _this$_videoTransceic5.receiver) || {}) && key2 in (((_this$_audioTransceic6 = _this._audioTransceicer) === null || _this$_audioTransceic6 === void 0 ? void 0 : _this$_audioTransceic6.receiver) || {});
|
|
7501
7625
|
});
|
|
7502
7626
|
if (!key)
|
|
7503
7627
|
return;
|
|
7504
|
-
return (_this$
|
|
7628
|
+
return (_this$_audioTransceic7 = _this._audioTransceicer) === null || _this$_audioTransceic7 === void 0 ? void 0 : _this$_audioTransceic7.receiver[key];
|
|
7505
7629
|
} catch (error) {
|
|
7506
7630
|
logger.error("get delay error");
|
|
7507
7631
|
}
|
|
7508
7632
|
};
|
|
7509
7633
|
_this._onLoaderRetry = function(error, retryTime) {
|
|
7510
|
-
console.log(error, "retryTime", retryTime);
|
|
7511
7634
|
_this.emit(EVENT.LOAD_RETRY, {
|
|
7512
7635
|
error: StreamingError.network(error),
|
|
7513
7636
|
retryTime
|
|
@@ -7599,7 +7722,7 @@
|
|
|
7599
7722
|
value: function() {
|
|
7600
7723
|
var _load = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee6(url, failureReason) {
|
|
7601
7724
|
var _this2 = this;
|
|
7602
|
-
var lastPc, answerSdp, errorStr, preloadPromise, info, encodedTransformSupported;
|
|
7725
|
+
var lastPc, pc, answerSdp, errorStr, preloadPromise, info, encodedTransformSupported;
|
|
7603
7726
|
return _regeneratorRuntime$1().wrap(function _callee6$(_context6) {
|
|
7604
7727
|
while (1)
|
|
7605
7728
|
switch (_context6.prev = _context6.next) {
|
|
@@ -7607,44 +7730,47 @@
|
|
|
7607
7730
|
logger.log("load()", 'invoked, url: "'.concat(url, '"'));
|
|
7608
7731
|
this._disconnect(failureReason || "invoke load");
|
|
7609
7732
|
this._url = url;
|
|
7733
|
+
this._retry = this._opts.retryCount || 0;
|
|
7610
7734
|
lastPc = this._pc;
|
|
7735
|
+
pc = null;
|
|
7611
7736
|
if (!this._opts.hackCreateOfferIssue) {
|
|
7612
|
-
_context6.next =
|
|
7737
|
+
_context6.next = 9;
|
|
7613
7738
|
break;
|
|
7614
7739
|
}
|
|
7615
|
-
_context6.next =
|
|
7740
|
+
_context6.next = 9;
|
|
7616
7741
|
return this._createEmptyPeer();
|
|
7617
|
-
case
|
|
7618
|
-
_context6.prev =
|
|
7742
|
+
case 9:
|
|
7743
|
+
_context6.prev = 9;
|
|
7619
7744
|
this._firstFrameObserver.start();
|
|
7620
7745
|
if (!this._preloadPromise) {
|
|
7621
|
-
_context6.next =
|
|
7746
|
+
_context6.next = 41;
|
|
7622
7747
|
break;
|
|
7623
7748
|
}
|
|
7624
7749
|
logger.log("load()", "in preload process...");
|
|
7625
|
-
_context6.prev =
|
|
7750
|
+
_context6.prev = 13;
|
|
7626
7751
|
this._firstFrameObserver.setIsPreload(true);
|
|
7627
7752
|
if (compareURL(this._url, this._preloadPromise.url, ["tabr_start_bitrate"])) {
|
|
7628
|
-
_context6.next =
|
|
7753
|
+
_context6.next = 19;
|
|
7629
7754
|
break;
|
|
7630
7755
|
}
|
|
7631
7756
|
errorStr = "preload url not match, current url: ".concat(this._url, ", preload url: ").concat(this._preloadPromise.url);
|
|
7632
7757
|
delete this._preloadPromise;
|
|
7633
7758
|
throw new Error(errorStr);
|
|
7634
|
-
case
|
|
7759
|
+
case 19:
|
|
7760
|
+
this._loader && (this._loader.finnalUrl = this._preloadPromise.url);
|
|
7635
7761
|
preloadPromise = this._preloadPromise.promise;
|
|
7636
7762
|
delete this._preloadPromise;
|
|
7637
|
-
_context6.next =
|
|
7763
|
+
_context6.next = 24;
|
|
7638
7764
|
return preloadPromise;
|
|
7639
|
-
case
|
|
7765
|
+
case 24:
|
|
7640
7766
|
info = _context6.sent;
|
|
7641
7767
|
if (!(info.pc.signalingState !== "have-local-offer")) {
|
|
7642
|
-
_context6.next =
|
|
7768
|
+
_context6.next = 27;
|
|
7643
7769
|
break;
|
|
7644
7770
|
}
|
|
7645
7771
|
throw new Error('pc.signalingState not equal "have-local-offer", current state is '.concat(info.pc.signalingState));
|
|
7646
|
-
case
|
|
7647
|
-
|
|
7772
|
+
case 27:
|
|
7773
|
+
pc = info.pc;
|
|
7648
7774
|
answerSdp = info.answerSdp;
|
|
7649
7775
|
this._videoTransceicer = info.videoTransceiver;
|
|
7650
7776
|
this._audioTransceicer = info.audioTransceiver;
|
|
@@ -7652,48 +7778,49 @@
|
|
|
7652
7778
|
this.initVideoEncodedTransform();
|
|
7653
7779
|
this.initAudioEncodedTransform();
|
|
7654
7780
|
}
|
|
7655
|
-
_context6.next =
|
|
7781
|
+
_context6.next = 39;
|
|
7656
7782
|
break;
|
|
7657
|
-
case
|
|
7658
|
-
_context6.prev =
|
|
7659
|
-
_context6.t0 = _context6["catch"](
|
|
7783
|
+
case 34:
|
|
7784
|
+
_context6.prev = 34;
|
|
7785
|
+
_context6.t0 = _context6["catch"](13);
|
|
7660
7786
|
logger.warn("load()", "preload failed, ".concat(_context6.t0.message || _context6.t0.toString()));
|
|
7661
7787
|
this.load(url, _context6.t0.message || _context6.t0.toString());
|
|
7662
7788
|
return _context6.abrupt("return");
|
|
7663
|
-
case
|
|
7664
|
-
_context6.next =
|
|
7789
|
+
case 39:
|
|
7790
|
+
_context6.next = 47;
|
|
7665
7791
|
break;
|
|
7666
|
-
case
|
|
7792
|
+
case 41:
|
|
7667
7793
|
encodedTransformSupported = isLegacyEncodedTransformSupported();
|
|
7668
7794
|
logger.log("load()", "isLegacyEncodedTransformSupported: ".concat(encodedTransformSupported));
|
|
7669
|
-
|
|
7795
|
+
pc = new RTCPeerConnection({
|
|
7670
7796
|
encodedInsertableStreams: encodedTransformSupported && this._opts.enableSei ? true : void 0
|
|
7671
7797
|
});
|
|
7672
|
-
_context6.next =
|
|
7673
|
-
return this._getAnswerSdp(
|
|
7674
|
-
case
|
|
7798
|
+
_context6.next = 46;
|
|
7799
|
+
return this._getAnswerSdp(pc);
|
|
7800
|
+
case 46:
|
|
7675
7801
|
answerSdp = _context6.sent;
|
|
7676
|
-
case 44:
|
|
7677
|
-
this._bindRTCEvents(this._pc);
|
|
7678
|
-
_context6.next = 47;
|
|
7679
|
-
return this._handleAnswerSdp(this._pc, answerSdp);
|
|
7680
7802
|
case 47:
|
|
7803
|
+
this._bindRTCEvents(pc);
|
|
7804
|
+
_context6.next = 50;
|
|
7805
|
+
return this._handleAnswerSdp(pc, answerSdp);
|
|
7806
|
+
case 50:
|
|
7681
7807
|
if (lastPc) {
|
|
7682
7808
|
lastPc.close();
|
|
7683
7809
|
}
|
|
7684
|
-
|
|
7810
|
+
this._pc = pc;
|
|
7811
|
+
_context6.next = 57;
|
|
7685
7812
|
break;
|
|
7686
|
-
case
|
|
7687
|
-
_context6.prev =
|
|
7688
|
-
_context6.t1 = _context6["catch"](
|
|
7813
|
+
case 54:
|
|
7814
|
+
_context6.prev = 54;
|
|
7815
|
+
_context6.t1 = _context6["catch"](9);
|
|
7689
7816
|
setTimeout(function() {
|
|
7690
7817
|
return _this2._emitError(StreamingError.create(ERR.OTHER, null, _context6.t1));
|
|
7691
7818
|
});
|
|
7692
|
-
case
|
|
7819
|
+
case 57:
|
|
7693
7820
|
case "end":
|
|
7694
7821
|
return _context6.stop();
|
|
7695
7822
|
}
|
|
7696
|
-
}, _callee6, this, [[
|
|
7823
|
+
}, _callee6, this, [[9, 54], [13, 34]]);
|
|
7697
7824
|
}));
|
|
7698
7825
|
function load(_x2, _x3) {
|
|
7699
7826
|
return _load.apply(this, arguments);
|
|
@@ -7836,6 +7963,7 @@
|
|
|
7836
7963
|
key: "_getAnswerSdp",
|
|
7837
7964
|
value: function() {
|
|
7838
7965
|
var _getAnswerSdp2 = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee7(pc) {
|
|
7966
|
+
var _this6 = this, _this$_opts$standardi;
|
|
7839
7967
|
var offer, answerSdp, parsed, finnalUrl, _this$_opts, _this$_loader, _this$_opts2, _parsed$media, parseSession, sessionId, reqStart, res, answer, err;
|
|
7840
7968
|
return _regeneratorRuntime$1().wrap(function _callee7$(_context7) {
|
|
7841
7969
|
while (1)
|
|
@@ -7887,31 +8015,38 @@
|
|
|
7887
8015
|
parsed.media.filter(function(x) {
|
|
7888
8016
|
return x.type === "audio";
|
|
7889
8017
|
}).forEach(function(x) {
|
|
7890
|
-
var _x$rtp$filter$,
|
|
8018
|
+
var _x$rtp$filter$, _this6$_opts$standard, _this6$_opts$standard2;
|
|
7891
8019
|
var opusPayload = (_x$rtp$filter$ = x.rtp.filter(function(rtp) {
|
|
7892
8020
|
return rtp.codec === "opus";
|
|
7893
8021
|
})[0]) === null || _x$rtp$filter$ === void 0 ? void 0 : _x$rtp$filter$.payload;
|
|
7894
8022
|
if (!opusPayload)
|
|
7895
8023
|
return;
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
8024
|
+
if ((_this6$_opts$standard = _this6._opts.standardizeKillSwitch) !== null && _this6$_opts$standard !== void 0 && _this6$_opts$standard.sld_fmtp_opus) {
|
|
8025
|
+
x.fmtp.forEach(function(fmtp) {
|
|
8026
|
+
if (fmtp.payload !== opusPayload)
|
|
8027
|
+
return;
|
|
8028
|
+
fmtp.config = "minptime=10;stereo=1;useinbandfec=1";
|
|
8029
|
+
});
|
|
8030
|
+
}
|
|
8031
|
+
if ((_this6$_opts$standard2 = _this6._opts.standardizeKillSwitch) !== null && _this6$_opts$standard2 !== void 0 && _this6$_opts$standard2.sld_rtcpfb_opus_nack) {
|
|
8032
|
+
var _x$rtcpFb;
|
|
8033
|
+
(_x$rtcpFb = x.rtcpFb) === null || _x$rtcpFb === void 0 ? void 0 : _x$rtcpFb.push({
|
|
8034
|
+
payload: opusPayload,
|
|
8035
|
+
type: "nack"
|
|
8036
|
+
});
|
|
8037
|
+
}
|
|
7905
8038
|
});
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
x2.config
|
|
7912
|
-
|
|
8039
|
+
if ((_this$_opts$standardi = this._opts.standardizeKillSwitch) !== null && _this$_opts$standardi !== void 0 && _this$_opts$standardi.sld_fmtp_sps_pps) {
|
|
8040
|
+
parsed.media.filter(function(x) {
|
|
8041
|
+
return x.type === "video";
|
|
8042
|
+
}).forEach(function(x) {
|
|
8043
|
+
x.fmtp.forEach(function(x2) {
|
|
8044
|
+
if (x2.config.indexOf("profile-level-id") !== -1) {
|
|
8045
|
+
x2.config = "".concat(x2.config, ";sps-pps-idr-in-keyframe=1");
|
|
8046
|
+
}
|
|
8047
|
+
});
|
|
7913
8048
|
});
|
|
7914
|
-
}
|
|
8049
|
+
}
|
|
7915
8050
|
offer.sdp = lib.write(parsed);
|
|
7916
8051
|
logger.log("local offer modified:\n", offer);
|
|
7917
8052
|
_context7.next = 25;
|
|
@@ -8046,7 +8181,7 @@
|
|
|
8046
8181
|
this._firstFrameObserver.changeFirstFrameState(RTC_FIRST_FRAME_STATE.ANSWER_SDP_READY);
|
|
8047
8182
|
this._networkEvaluate = new NetworkEvaluate(pc, this._opts.networkEvaluateInterval);
|
|
8048
8183
|
this._listenPeerStateTimeout();
|
|
8049
|
-
this._firstFrameObserver.bindEvents(pc, this._videoTransceicer, this._media);
|
|
8184
|
+
this._firstFrameObserver.bindEvents(pc, this._videoTransceicer, this._audioTransceicer, this._media);
|
|
8050
8185
|
case 17:
|
|
8051
8186
|
case "end":
|
|
8052
8187
|
return _context8.stop();
|
|
@@ -8061,11 +8196,11 @@
|
|
|
8061
8196
|
}, {
|
|
8062
8197
|
key: "_listenPeerStateTimeout",
|
|
8063
8198
|
value: function _listenPeerStateTimeout() {
|
|
8064
|
-
var
|
|
8199
|
+
var _this7 = this;
|
|
8065
8200
|
this._clearPeerStateTimeout();
|
|
8066
8201
|
if (this._opts.connectionStateChangeTimeout) {
|
|
8067
8202
|
this._peerStateTimer = setTimeout(function() {
|
|
8068
|
-
|
|
8203
|
+
_this7._emitError(StreamingError.create(ERR.MEDIA, ERR.SUB_TYPES.MEDIA_ERR_SRC_NOT_SUPPORTED, {
|
|
8069
8204
|
message: "listen connectionstatechange timeout"
|
|
8070
8205
|
}));
|
|
8071
8206
|
}, this._opts.connectionStateChangeTimeout);
|
|
@@ -8082,59 +8217,59 @@
|
|
|
8082
8217
|
}, {
|
|
8083
8218
|
key: "_startRtcReport",
|
|
8084
8219
|
value: function _startRtcReport() {
|
|
8085
|
-
var
|
|
8220
|
+
var _this8 = this;
|
|
8086
8221
|
this._stopRtcReport();
|
|
8087
8222
|
var report = /* @__PURE__ */ function() {
|
|
8088
8223
|
var _ref5 = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee9() {
|
|
8089
|
-
var
|
|
8090
|
-
var
|
|
8224
|
+
var _this8$_audioTranscei, _this8$_audioTranscei2, _this8$_videoTranscei, _this8$_videoTranscei2;
|
|
8225
|
+
var _this8$_frameRecvCall, _yield$Promise$all3, _yield$Promise$all4, curAudioStats, curVideoStats, _this8$_audioStallObs, _this8$_videoStallObs, _this8$_networkQualit, _this8$_networkQualit2, _this8$_media, _this8$_media2, _this8$_media3, _this8$_media4, _this8$_media5, _this8$_media6, _this8$_frameRecvCall2, audioStats, videoStats, audioStallInfo, videoStallInfo, _ref6, _ref7, quality, qualityInfo, av_sync_diff;
|
|
8091
8226
|
return _regeneratorRuntime$1().wrap(function _callee9$(_context9) {
|
|
8092
8227
|
while (1)
|
|
8093
8228
|
switch (_context9.prev = _context9.next) {
|
|
8094
8229
|
case 0:
|
|
8095
|
-
if (!(!((
|
|
8230
|
+
if (!(!((_this8$_audioTranscei = _this8._audioTransceicer) !== null && _this8$_audioTranscei !== void 0 && (_this8$_audioTranscei2 = _this8$_audioTranscei.receiver) !== null && _this8$_audioTranscei2 !== void 0 && _this8$_audioTranscei2.getStats) || !((_this8$_videoTranscei = _this8._videoTransceicer) !== null && _this8$_videoTranscei !== void 0 && (_this8$_videoTranscei2 = _this8$_videoTranscei.receiver) !== null && _this8$_videoTranscei2 !== void 0 && _this8$_videoTranscei2.getStats))) {
|
|
8096
8231
|
_context9.next = 4;
|
|
8097
8232
|
break;
|
|
8098
8233
|
}
|
|
8099
|
-
|
|
8100
|
-
|
|
8234
|
+
_this8._preAudioStats = null;
|
|
8235
|
+
_this8._preVideoStats = null;
|
|
8101
8236
|
return _context9.abrupt("return");
|
|
8102
8237
|
case 4:
|
|
8103
|
-
if (!
|
|
8104
|
-
|
|
8105
|
-
|
|
8238
|
+
if (!_this8._audioStallObserver && _this8._audioTransceicer) {
|
|
8239
|
+
_this8._audioStallObserver = new AudioStallObserver();
|
|
8240
|
+
_this8._audioStallObserver.start(_this8._audioTransceicer);
|
|
8106
8241
|
}
|
|
8107
|
-
if (!
|
|
8108
|
-
|
|
8109
|
-
|
|
8242
|
+
if (!_this8._videoStallObserver && _this8._video && _this8._media) {
|
|
8243
|
+
_this8._videoStallObserver = new VideoStallObserver();
|
|
8244
|
+
_this8._videoStallObserver.start(_this8._media);
|
|
8110
8245
|
}
|
|
8111
|
-
if (!
|
|
8112
|
-
|
|
8113
|
-
(
|
|
8246
|
+
if (!_this8._frameRecvCallback && _this8._media) {
|
|
8247
|
+
_this8._frameRecvCallback = new VideoFrameRecvCallback();
|
|
8248
|
+
(_this8$_frameRecvCall = _this8._frameRecvCallback) === null || _this8$_frameRecvCall === void 0 ? void 0 : _this8$_frameRecvCall.start(_this8._media);
|
|
8114
8249
|
}
|
|
8115
|
-
if (
|
|
8116
|
-
|
|
8250
|
+
if (_this8._pc && !_this8._networkQuality && _this8._opts.enableNetworkQuality && _this8._opts.networkQuality) {
|
|
8251
|
+
_this8._networkQuality = new NetworkQuality(_this8._pc, _this8._opts.networkQuality);
|
|
8117
8252
|
}
|
|
8118
8253
|
_context9.next = 10;
|
|
8119
|
-
return Promise.all([getRecvAudioStats(
|
|
8254
|
+
return Promise.all([getRecvAudioStats(_this8._audioTransceicer.receiver.getStats()), getRecvVideoStats(_this8._videoTransceicer.receiver.getStats())]);
|
|
8120
8255
|
case 10:
|
|
8121
8256
|
_yield$Promise$all3 = _context9.sent;
|
|
8122
8257
|
_yield$Promise$all4 = _slicedToArray(_yield$Promise$all3, 2);
|
|
8123
8258
|
curAudioStats = _yield$Promise$all4[0];
|
|
8124
8259
|
curVideoStats = _yield$Promise$all4[1];
|
|
8125
|
-
if (!(
|
|
8260
|
+
if (!(_this8._preAudioStats && _this8._preVideoStats)) {
|
|
8126
8261
|
_context9.next = 28;
|
|
8127
8262
|
break;
|
|
8128
8263
|
}
|
|
8129
|
-
audioStats = diffRecvAudioStats(
|
|
8130
|
-
videoStats = diffRecvVideoStats(
|
|
8131
|
-
|
|
8264
|
+
audioStats = diffRecvAudioStats(_this8._preAudioStats, curAudioStats);
|
|
8265
|
+
videoStats = diffRecvVideoStats(_this8._preVideoStats, curVideoStats);
|
|
8266
|
+
_this8._videoJitterBufferDelay = videoStats.jitterBufferDelay;
|
|
8132
8267
|
_context9.next = 20;
|
|
8133
|
-
return (
|
|
8268
|
+
return (_this8$_audioStallObs = _this8._audioStallObserver) === null || _this8$_audioStallObs === void 0 ? void 0 : _this8$_audioStallObs.getAudioStallInfo();
|
|
8134
8269
|
case 20:
|
|
8135
8270
|
audioStallInfo = _context9.sent;
|
|
8136
8271
|
_context9.next = 23;
|
|
8137
|
-
return (
|
|
8272
|
+
return (_this8$_videoStallObs = _this8._videoStallObserver) === null || _this8$_videoStallObs === void 0 ? void 0 : _this8$_videoStallObs.getStallInfo({
|
|
8138
8273
|
interval: videoStats.statsInterval,
|
|
8139
8274
|
frameRateReceived: videoStats.receivedFrameRate,
|
|
8140
8275
|
frameRateDecoded: videoStats.decoderOutputFrameRate,
|
|
@@ -8142,18 +8277,18 @@
|
|
|
8142
8277
|
});
|
|
8143
8278
|
case 23:
|
|
8144
8279
|
videoStallInfo = _context9.sent;
|
|
8145
|
-
_ref6 = (
|
|
8280
|
+
_ref6 = (_this8$_networkQualit = (_this8$_networkQualit2 = _this8._networkQuality) === null || _this8$_networkQualit2 === void 0 ? void 0 : _this8$_networkQualit2.getDownlinkQuality(_objectSpread2$2(_objectSpread2$2({}, audioStats), {}, {
|
|
8146
8281
|
stallDuration: (audioStallInfo === null || audioStallInfo === void 0 ? void 0 : audioStallInfo.stallDuration) || 0
|
|
8147
8282
|
}), _objectSpread2$2(_objectSpread2$2({}, videoStats), {}, {
|
|
8148
8283
|
stallDuration: (videoStallInfo === null || videoStallInfo === void 0 ? void 0 : videoStallInfo.stall.stallDuration100ms) || (videoStallInfo === null || videoStallInfo === void 0 ? void 0 : videoStallInfo.stall.stallDuration500ms) || 0
|
|
8149
|
-
}))) !== null &&
|
|
8150
|
-
if (
|
|
8151
|
-
|
|
8284
|
+
}))) !== null && _this8$_networkQualit !== void 0 ? _this8$_networkQualit : [], _ref7 = _slicedToArray(_ref6, 2), quality = _ref7[0], qualityInfo = _ref7[1];
|
|
8285
|
+
if (_this8._opts.enableAdaptiveJitterBuffer) {
|
|
8286
|
+
_this8._handleJitterBuffer(qualityInfo === null || qualityInfo === void 0 ? void 0 : qualityInfo.qualityQos, _this8._opts.adaptiveJitterBuffer, _this8._opts.networkStrategy);
|
|
8152
8287
|
}
|
|
8153
8288
|
if (videoStats.estimatedPlayoutTimestamp && audioStats.estimatedPlayoutTimestamp) {
|
|
8154
8289
|
av_sync_diff = videoStats.estimatedPlayoutTimestamp - audioStats.estimatedPlayoutTimestamp;
|
|
8155
8290
|
}
|
|
8156
|
-
|
|
8291
|
+
_this8.emit(EXTEND_EVENTS.RTC_NETWORK, _objectSpread2$2({
|
|
8157
8292
|
interval: videoStats.statsInterval,
|
|
8158
8293
|
network_quality: quality,
|
|
8159
8294
|
audio_stall_duration: audioStallInfo === null || audioStallInfo === void 0 ? void 0 : audioStallInfo.stallDuration,
|
|
@@ -8179,13 +8314,13 @@
|
|
|
8179
8314
|
quality_qos: qualityInfo === null || qualityInfo === void 0 ? void 0 : qualityInfo.qualityQos,
|
|
8180
8315
|
quality_audio_qoe: qualityInfo === null || qualityInfo === void 0 ? void 0 : qualityInfo.audioQoe,
|
|
8181
8316
|
quality_video_qoe: qualityInfo === null || qualityInfo === void 0 ? void 0 : qualityInfo.videoQoe,
|
|
8182
|
-
current_delay:
|
|
8317
|
+
current_delay: _this8._getDelay(),
|
|
8183
8318
|
visibility_state: document.visibilityState,
|
|
8184
|
-
target_delay:
|
|
8319
|
+
target_delay: _this8._targetDelayHint,
|
|
8185
8320
|
av_sync_diff,
|
|
8186
|
-
set_delay_error:
|
|
8187
|
-
video_width: ((
|
|
8188
|
-
video_height: ((
|
|
8321
|
+
set_delay_error: _this8._setDelayError || null,
|
|
8322
|
+
video_width: ((_this8$_media = _this8._media) === null || _this8$_media === void 0 ? void 0 : _this8$_media.videoWidth) || 0,
|
|
8323
|
+
video_height: ((_this8$_media2 = _this8._media) === null || _this8$_media2 === void 0 ? void 0 : _this8$_media2.videoHeight) || 0,
|
|
8189
8324
|
abr_state: videoStats.abrState || "none",
|
|
8190
8325
|
recv_frame_rate: videoStats.receivedFrameRate,
|
|
8191
8326
|
decode_frame_rate: videoStats.decoderOutputFrameRate,
|
|
@@ -8193,15 +8328,19 @@
|
|
|
8193
8328
|
drop_frame_rate: videoStats.framesDropped,
|
|
8194
8329
|
audio_packets_received: audioStats.packetsReceived,
|
|
8195
8330
|
video_packets_received: videoStats.packetsReceived,
|
|
8196
|
-
video_muted: (
|
|
8197
|
-
video_paused: (
|
|
8198
|
-
video_volume: (
|
|
8199
|
-
video_current_time: (
|
|
8200
|
-
|
|
8331
|
+
video_muted: (_this8$_media3 = _this8._media) === null || _this8$_media3 === void 0 ? void 0 : _this8$_media3.muted,
|
|
8332
|
+
video_paused: (_this8$_media4 = _this8._media) === null || _this8$_media4 === void 0 ? void 0 : _this8$_media4.paused,
|
|
8333
|
+
video_volume: (_this8$_media5 = _this8._media) === null || _this8$_media5 === void 0 ? void 0 : _this8$_media5.volume,
|
|
8334
|
+
video_current_time: (_this8$_media6 = _this8._media) === null || _this8$_media6 === void 0 ? void 0 : _this8$_media6.currentTime,
|
|
8335
|
+
fec_packets_received: videoStats.fecPacketsReceived,
|
|
8336
|
+
video_kbps: videoStats.receivedKBitrate,
|
|
8337
|
+
audio_kbps: audioStats.receivedKBitrate,
|
|
8338
|
+
fec_ssrc: videoStats.fecSsrc
|
|
8339
|
+
}, ((_this8$_frameRecvCall2 = _this8._frameRecvCallback) === null || _this8$_frameRecvCall2 === void 0 ? void 0 : _this8$_frameRecvCall2.getRecentRenderInfo4Report()) || {}));
|
|
8201
8340
|
case 28:
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
|
|
8341
|
+
_this8._preAudioStats = curAudioStats;
|
|
8342
|
+
_this8._preVideoStats = curVideoStats;
|
|
8343
|
+
_this8._setDelayError = null;
|
|
8205
8344
|
case 31:
|
|
8206
8345
|
case "end":
|
|
8207
8346
|
return _context9.stop();
|
|
@@ -8356,7 +8495,7 @@
|
|
|
8356
8495
|
}, {
|
|
8357
8496
|
key: "_changeVolumeInHarmonyWorkaround",
|
|
8358
8497
|
value: function _changeVolumeInHarmonyWorkaround() {
|
|
8359
|
-
var
|
|
8498
|
+
var _this9 = this;
|
|
8360
8499
|
if (isHarmonyOS()) {
|
|
8361
8500
|
var originalDescriptor = Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, "muted");
|
|
8362
8501
|
if (this._media && originalDescriptor) {
|
|
@@ -8375,9 +8514,9 @@
|
|
|
8375
8514
|
}
|
|
8376
8515
|
});
|
|
8377
8516
|
this._revertVolumeWorkaround = function() {
|
|
8378
|
-
logger.log("revert HarmonyOS muted workaround. video dom:",
|
|
8379
|
-
if (
|
|
8380
|
-
Object.defineProperty(
|
|
8517
|
+
logger.log("revert HarmonyOS muted workaround. video dom:", _this9._media);
|
|
8518
|
+
if (_this9._media) {
|
|
8519
|
+
Object.defineProperty(_this9._media, "muted", originalDescriptor);
|
|
8381
8520
|
}
|
|
8382
8521
|
};
|
|
8383
8522
|
}
|
|
@@ -8386,7 +8525,7 @@
|
|
|
8386
8525
|
}, {
|
|
8387
8526
|
key: "_mutedBeforePlayingWorkaround",
|
|
8388
8527
|
value: function _mutedBeforePlayingWorkaround() {
|
|
8389
|
-
var
|
|
8528
|
+
var _this10 = this;
|
|
8390
8529
|
if (isHeyTapBrowser() || isVivoBrowser()) {
|
|
8391
8530
|
var originalDescriptor = Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, "muted");
|
|
8392
8531
|
if (this._media && originalDescriptor) {
|
|
@@ -8406,10 +8545,10 @@
|
|
|
8406
8545
|
});
|
|
8407
8546
|
var revertMutedProxy = function revertMutedProxy2() {
|
|
8408
8547
|
logger.log("revert muted workaround. muted:", originalMuted);
|
|
8409
|
-
if (
|
|
8410
|
-
Object.defineProperty(
|
|
8411
|
-
|
|
8412
|
-
|
|
8548
|
+
if (_this10._media) {
|
|
8549
|
+
Object.defineProperty(_this10._media, "muted", originalDescriptor);
|
|
8550
|
+
_this10._media.muted = originalMuted;
|
|
8551
|
+
_this10._media.removeEventListener("playing", revertMutedProxy2);
|
|
8413
8552
|
}
|
|
8414
8553
|
};
|
|
8415
8554
|
this._media.addEventListener("playing", revertMutedProxy);
|
|
@@ -8519,10 +8658,11 @@
|
|
|
8519
8658
|
_this.__retry = function() {
|
|
8520
8659
|
_this.player.removeClass(STATE_CLASS.ERROR);
|
|
8521
8660
|
_this.player.addClass(STATE_CLASS.LOADING);
|
|
8522
|
-
runHooks(_assertThisInitialized$1(_this), "retry", function() {
|
|
8661
|
+
_this.player.runHooks(_assertThisInitialized$1(_this), "retry", function() {
|
|
8523
8662
|
_this.player.src = "";
|
|
8524
8663
|
_this.player.once(CANPLAY, function() {
|
|
8525
|
-
|
|
8664
|
+
var _assertThisInitialize, _assertThisInitialize2;
|
|
8665
|
+
(_assertThisInitialize = _assertThisInitialized$1(_this)) === null || _assertThisInitialize === void 0 ? void 0 : (_assertThisInitialize2 = _assertThisInitialize.player) === null || _assertThisInitialize2 === void 0 ? void 0 : _assertThisInitialize2.mediaPlay();
|
|
8526
8666
|
});
|
|
8527
8667
|
});
|
|
8528
8668
|
};
|
|
@@ -8574,7 +8714,7 @@
|
|
|
8574
8714
|
}, {
|
|
8575
8715
|
key: "version",
|
|
8576
8716
|
get: function get() {
|
|
8577
|
-
return "0.2.1-alpha.
|
|
8717
|
+
return "0.2.1-alpha.62";
|
|
8578
8718
|
}
|
|
8579
8719
|
}, {
|
|
8580
8720
|
key: "beforePlayerInit",
|
|
@@ -8811,6 +8951,11 @@
|
|
|
8811
8951
|
}
|
|
8812
8952
|
return isSupportedH264;
|
|
8813
8953
|
}()
|
|
8954
|
+
}, {
|
|
8955
|
+
key: "isEncodedTransformSupported",
|
|
8956
|
+
value: function isEncodedTransformSupported$1() {
|
|
8957
|
+
return isEncodedTransformSupported() || isLegacyEncodedTransformSupported();
|
|
8958
|
+
}
|
|
8814
8959
|
}]);
|
|
8815
8960
|
return RtsPlugin2;
|
|
8816
8961
|
}(BasePlugin);
|