@volcengine/veplayer-plugin 2.12.0-rc.1 → 2.12.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/index.development.js +24327 -22451
- package/esm/index.production.js +6 -6
- package/esm/veplayer.plugin.abr.production.js +1 -1
- package/esm/veplayer.plugin.drm.production.js +1 -1
- package/esm/veplayer.plugin.flv.development.js +2 -2
- package/esm/veplayer.plugin.flv.production.js +1 -1
- package/esm/veplayer.plugin.hls.development.js +1 -1
- package/esm/veplayer.plugin.hls.production.js +1 -1
- package/esm/veplayer.plugin.hlsjs.production.js +1 -1
- package/esm/veplayer.plugin.mp4.development.js +1 -1
- package/esm/veplayer.plugin.mp4.production.js +1 -1
- package/esm/veplayer.plugin.rtm.development.js +290 -150
- package/esm/veplayer.plugin.rtm.production.js +1 -1
- package/esm/veplayer.plugin.shaka.production.js +1 -1
- package/package.json +1 -1
- package/umd/veplayer.plugin.abr.production.js +1 -1
- package/umd/veplayer.plugin.drm.production.js +1 -1
- package/umd/veplayer.plugin.flv.development.js +2 -2
- package/umd/veplayer.plugin.flv.production.js +1 -1
- package/umd/veplayer.plugin.hls.development.js +1 -1
- package/umd/veplayer.plugin.hls.production.js +1 -1
- package/umd/veplayer.plugin.hlsjs.production.js +1 -1
- package/umd/veplayer.plugin.mp4.development.js +1 -1
- package/umd/veplayer.plugin.mp4.production.js +1 -1
- package/umd/veplayer.plugin.rtm.development.js +290 -150
- package/umd/veplayer.plugin.rtm.production.js +1 -1
- package/umd/veplayer.plugin.shaka.production.js +1 -1
|
@@ -1690,7 +1690,7 @@
|
|
|
1690
1690
|
}
|
|
1691
1691
|
return offsetTime;
|
|
1692
1692
|
};
|
|
1693
|
-
var version = "3.0.24-rc.
|
|
1693
|
+
var version = "3.0.24-rc.6";
|
|
1694
1694
|
var ERROR_MAP = {
|
|
1695
1695
|
1: 5101,
|
|
1696
1696
|
2: 5102,
|
|
@@ -5083,9 +5083,9 @@
|
|
|
5083
5083
|
lib.parseRemoteCandidates = parser.parseRemoteCandidates;
|
|
5084
5084
|
lib.parseImageAttributes = parser.parseImageAttributes;
|
|
5085
5085
|
lib.parseSimulcastStreamList = parser.parseSimulcastStreamList;
|
|
5086
|
-
var _excluded = ["adaptiveJitterBuffer"];
|
|
5086
|
+
var _excluded = ["adaptiveJitterBuffer", "standardizeKillSwitch"];
|
|
5087
5087
|
function getOption(options) {
|
|
5088
|
-
var _ref = options || {}, _ref$adaptiveJitterBu = _ref.adaptiveJitterBuffer, adaptiveJitterBuffer = _ref$adaptiveJitterBu === void 0 ? {} : _ref$adaptiveJitterBu, opts = _objectWithoutProperties$1(_ref, _excluded);
|
|
5088
|
+
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);
|
|
5089
5089
|
return _objectSpread2$2({
|
|
5090
5090
|
retryCount: 0,
|
|
5091
5091
|
retryDelay: 1e3,
|
|
@@ -5156,7 +5156,12 @@
|
|
|
5156
5156
|
5: {
|
|
5157
5157
|
jitterBuffer: 3
|
|
5158
5158
|
}
|
|
5159
|
-
}
|
|
5159
|
+
},
|
|
5160
|
+
standardizeKillSwitch: _objectSpread2$2({
|
|
5161
|
+
sld_fmtp_opus: true,
|
|
5162
|
+
sld_rtcpfb_opus_nack: true,
|
|
5163
|
+
sld_fmtp_sps_pps: true
|
|
5164
|
+
}, standardizeKillSwitch)
|
|
5160
5165
|
}, opts);
|
|
5161
5166
|
}
|
|
5162
5167
|
function _getStats(stats) {
|
|
@@ -5498,7 +5503,7 @@
|
|
|
5498
5503
|
});
|
|
5499
5504
|
}
|
|
5500
5505
|
var isEncodedTransformSupported = function isEncodedTransformSupported2() {
|
|
5501
|
-
return typeof TransformStream !== "undefined" && typeof RTCRtpSender !== "undefined" && typeof RTCRtpReceiver !== "undefined" && typeof RTCRtpScriptTransform !== "undefined" && "transform" in RTCRtpSender.prototype && "transform" in RTCRtpReceiver.prototype && isWorkerSupported() && isMessageChannelSupported();
|
|
5506
|
+
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();
|
|
5502
5507
|
};
|
|
5503
5508
|
var isWorkerSupported = function isWorkerSupported2() {
|
|
5504
5509
|
return typeof window !== "undefined" && window.Worker;
|
|
@@ -5507,7 +5512,7 @@
|
|
|
5507
5512
|
return typeof MessageChannel !== "undefined";
|
|
5508
5513
|
};
|
|
5509
5514
|
var isLegacyEncodedTransformSupported = function isLegacyEncodedTransformSupported2() {
|
|
5510
|
-
return typeof TransformStream !== "undefined" && typeof RTCRtpSender !== "undefined" && typeof RTCRtpReceiver !== "undefined" && typeof RTCRtpSender.prototype.createEncodedStreams !== "undefined" && typeof RTCRtpReceiver.prototype.createEncodedStreams !== "undefined";
|
|
5515
|
+
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";
|
|
5511
5516
|
};
|
|
5512
5517
|
var Nalunit = {
|
|
5513
5518
|
getNALUnits: function getNALUnits(buffer) {
|
|
@@ -6685,6 +6690,8 @@
|
|
|
6685
6690
|
currentStats.firCount = stat.firCount;
|
|
6686
6691
|
currentStats.nackCount = stat.nackCount;
|
|
6687
6692
|
currentStats.pliCount = stat.pliCount;
|
|
6693
|
+
currentStats.fecPacketsReceived = stat.fecPacketsReceived;
|
|
6694
|
+
currentStats.fecSsrc = stat.fecSsrc;
|
|
6688
6695
|
if (stat.jitterBufferDelay !== void 0) {
|
|
6689
6696
|
currentStats.jitterBufferEmittedCount = stat.jitterBufferEmittedCount;
|
|
6690
6697
|
currentStats.jitterBufferDelay = stat.jitterBufferDelay;
|
|
@@ -6749,12 +6756,14 @@
|
|
|
6749
6756
|
nackCount,
|
|
6750
6757
|
pliCount: diffNumber(oldStats, newStats, "pliCount"),
|
|
6751
6758
|
e2eDelay: Math.round((newStats.rtt || 0) + jitterBufferDelay),
|
|
6752
|
-
retransmittedRate: +(nackCount / (packetsReceived + packetsLostDiff)).toFixed(2)
|
|
6759
|
+
retransmittedRate: +(nackCount / (packetsReceived + packetsLostDiff)).toFixed(2),
|
|
6760
|
+
fecPacketsReceived: diffNumber(oldStats, newStats, "fecPacketsReceived"),
|
|
6761
|
+
fecSsrc: newStats.fecSsrc
|
|
6753
6762
|
};
|
|
6754
6763
|
}
|
|
6755
6764
|
function diffNumber(oldValue, newValue, key) {
|
|
6756
|
-
var oldV = Number.
|
|
6757
|
-
var newV = Number.
|
|
6765
|
+
var oldV = !Number.isFinite(oldValue[key]) ? 0 : +oldValue[key];
|
|
6766
|
+
var newV = !Number.isFinite(newValue[key]) ? 0 : +newValue[key];
|
|
6758
6767
|
return Math.max(0, newV - oldV);
|
|
6759
6768
|
}
|
|
6760
6769
|
var QoELevel = {
|
|
@@ -6885,6 +6894,63 @@
|
|
|
6885
6894
|
}]);
|
|
6886
6895
|
return NetworkQuality2;
|
|
6887
6896
|
}();
|
|
6897
|
+
var gpuInfo;
|
|
6898
|
+
function getGpuInfo() {
|
|
6899
|
+
if (!gpuInfo) {
|
|
6900
|
+
gpuInfo = _getGpuInfo();
|
|
6901
|
+
}
|
|
6902
|
+
return gpuInfo;
|
|
6903
|
+
}
|
|
6904
|
+
function _getGpuInfo() {
|
|
6905
|
+
var canvas = document.createElement("canvas");
|
|
6906
|
+
var gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
|
|
6907
|
+
if (!gl) {
|
|
6908
|
+
return {
|
|
6909
|
+
renderer: "unknown(WebGLRenderingContext not existed)",
|
|
6910
|
+
vendor: "unknown(WebGLRenderingContext not existed)"
|
|
6911
|
+
};
|
|
6912
|
+
}
|
|
6913
|
+
var info = gl.getExtension("WEBGL_debug_renderer_info");
|
|
6914
|
+
if (!info) {
|
|
6915
|
+
return {
|
|
6916
|
+
renderer: "unknown(info not existed)",
|
|
6917
|
+
vendor: "unknown(info not existed)"
|
|
6918
|
+
};
|
|
6919
|
+
}
|
|
6920
|
+
var renderer = gl.getParameter(info.UNMASKED_RENDERER_WEBGL);
|
|
6921
|
+
var vendor = gl.getParameter(info.UNMASKED_VENDOR_WEBGL);
|
|
6922
|
+
if (canvas && canvas.parentNode) {
|
|
6923
|
+
canvas.parentNode.removeChild(canvas);
|
|
6924
|
+
}
|
|
6925
|
+
canvas = void 0;
|
|
6926
|
+
gl = void 0;
|
|
6927
|
+
return {
|
|
6928
|
+
renderer,
|
|
6929
|
+
vendor
|
|
6930
|
+
};
|
|
6931
|
+
}
|
|
6932
|
+
function extractProfileInfo(sdpFmtpLine) {
|
|
6933
|
+
var profileLevelId = "";
|
|
6934
|
+
if (!sdpFmtpLine) {
|
|
6935
|
+
return profileLevelId;
|
|
6936
|
+
}
|
|
6937
|
+
var paramArray = sdpFmtpLine.split(";");
|
|
6938
|
+
var _iterator = _createForOfIteratorHelper$1(paramArray), _step;
|
|
6939
|
+
try {
|
|
6940
|
+
for (_iterator.s(); !(_step = _iterator.n()).done; ) {
|
|
6941
|
+
var param = _step.value;
|
|
6942
|
+
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];
|
|
6943
|
+
if (key === "profile-level-id") {
|
|
6944
|
+
profileLevelId = value;
|
|
6945
|
+
}
|
|
6946
|
+
}
|
|
6947
|
+
} catch (err) {
|
|
6948
|
+
_iterator.e(err);
|
|
6949
|
+
} finally {
|
|
6950
|
+
_iterator.f();
|
|
6951
|
+
}
|
|
6952
|
+
return profileLevelId;
|
|
6953
|
+
}
|
|
6888
6954
|
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];
|
|
6889
6955
|
var FirstFrameObserver = /* @__PURE__ */ function() {
|
|
6890
6956
|
function FirstFrameObserver2(_emitFirstFrameState) {
|
|
@@ -6898,6 +6964,7 @@
|
|
|
6898
6964
|
this._pc = null;
|
|
6899
6965
|
this._video = null;
|
|
6900
6966
|
this._videoTransceiver = null;
|
|
6967
|
+
this._audioTransceiver = null;
|
|
6901
6968
|
this._extraInfo = {
|
|
6902
6969
|
is_preload: false
|
|
6903
6970
|
};
|
|
@@ -6970,11 +7037,12 @@
|
|
|
6970
7037
|
}
|
|
6971
7038
|
}, {
|
|
6972
7039
|
key: "bindEvents",
|
|
6973
|
-
value: function bindEvents(pc, videoTransceiver, video) {
|
|
7040
|
+
value: function bindEvents(pc, videoTransceiver, audioTransceiver, video) {
|
|
6974
7041
|
var _this3 = this;
|
|
6975
7042
|
this._pc = pc;
|
|
6976
7043
|
this._video = video;
|
|
6977
7044
|
this._videoTransceiver = videoTransceiver;
|
|
7045
|
+
this._audioTransceiver = audioTransceiver;
|
|
6978
7046
|
pc.addEventListener("connectionstatechange", this._handleConnectionStateChange);
|
|
6979
7047
|
pc.addEventListener("iceconnectionstatechange", this._handleICEConnectionStateChange);
|
|
6980
7048
|
var _ref2 = (videoTransceiver === null || videoTransceiver === void 0 ? void 0 : videoTransceiver.receiver) || {}, transport = _ref2.transport;
|
|
@@ -7048,7 +7116,9 @@
|
|
|
7048
7116
|
if (Object.keys(this._state).length > 0) {
|
|
7049
7117
|
var state = _objectSpread2$2({}, this._state);
|
|
7050
7118
|
var extraInfo = _objectSpread2$2({}, this._extraInfo);
|
|
7051
|
-
getTransportInfo(this._videoTransceiver, extraInfo).
|
|
7119
|
+
Promise.all([getTransportInfo(this._videoTransceiver, extraInfo), getAudioCodecInfo(this._audioTransceiver, extraInfo)]).catch(function(e) {
|
|
7120
|
+
extraInfo.failure_reason = e.message;
|
|
7121
|
+
}).finally(function() {
|
|
7052
7122
|
_this5._emitFirstFrameState(state, extraInfo);
|
|
7053
7123
|
});
|
|
7054
7124
|
}
|
|
@@ -7067,6 +7137,7 @@
|
|
|
7067
7137
|
this._pc = null;
|
|
7068
7138
|
this._video = null;
|
|
7069
7139
|
this._videoTransceiver = null;
|
|
7140
|
+
this._audioTransceiver = null;
|
|
7070
7141
|
}
|
|
7071
7142
|
}]);
|
|
7072
7143
|
return FirstFrameObserver2;
|
|
@@ -7074,7 +7145,7 @@
|
|
|
7074
7145
|
var getTransportInfo = /* @__PURE__ */ function() {
|
|
7075
7146
|
var _ref4 = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee2(videoTransceiver, extraInfo) {
|
|
7076
7147
|
var _videoTransceiver$rec;
|
|
7077
|
-
var reports, candidatePairStats, localCandidateStats, remoteCandidateStats;
|
|
7148
|
+
var reports, candidatePairStats, localCandidateStats, remoteCandidateStats, inboundRtpStats, codecStats, _inboundRtpStats4;
|
|
7078
7149
|
return _regeneratorRuntime$1().wrap(function _callee2$(_context2) {
|
|
7079
7150
|
while (1)
|
|
7080
7151
|
switch (_context2.prev = _context2.next) {
|
|
@@ -7089,6 +7160,9 @@
|
|
|
7089
7160
|
candidatePairStats = report;
|
|
7090
7161
|
localCandidateStats = reports.get(report.localCandidateId);
|
|
7091
7162
|
remoteCandidateStats = reports.get(report.remoteCandidateId);
|
|
7163
|
+
} else if (report.type === "inbound-rtp") {
|
|
7164
|
+
inboundRtpStats = report;
|
|
7165
|
+
codecStats = reports.get(report.codecId);
|
|
7092
7166
|
}
|
|
7093
7167
|
});
|
|
7094
7168
|
if (remoteCandidateStats) {
|
|
@@ -7109,7 +7183,20 @@
|
|
|
7109
7183
|
extraInfo.stun_responses_sent = candidatePairStats.responsesSent;
|
|
7110
7184
|
extraInfo.stun_responses_received = candidatePairStats.responsesReceived;
|
|
7111
7185
|
}
|
|
7112
|
-
|
|
7186
|
+
if (codecStats) {
|
|
7187
|
+
extraInfo.video_codec = codecStats.mimeType;
|
|
7188
|
+
extraInfo.video_fmtp = codecStats.sdpFmtpLine;
|
|
7189
|
+
extraInfo.video_profile_level_id = extractProfileInfo(codecStats.sdpFmtpLine);
|
|
7190
|
+
}
|
|
7191
|
+
if (inboundRtpStats) {
|
|
7192
|
+
extraInfo.video_width = inboundRtpStats.frameWidth;
|
|
7193
|
+
extraInfo.video_height = inboundRtpStats.frameHeight;
|
|
7194
|
+
extraInfo.video_framerate = inboundRtpStats.framesPerSecond;
|
|
7195
|
+
extraInfo.video_decoder_name = inboundRtpStats.decoderImplementation;
|
|
7196
|
+
extraInfo.video_result = ((_inboundRtpStats4 = inboundRtpStats) === null || _inboundRtpStats4 === void 0 ? void 0 : _inboundRtpStats4.framesDecoded) > 0 ? true : false;
|
|
7197
|
+
}
|
|
7198
|
+
extraInfo.gpu_info = getGpuInfo().renderer;
|
|
7199
|
+
case 10:
|
|
7113
7200
|
case "end":
|
|
7114
7201
|
return _context2.stop();
|
|
7115
7202
|
}
|
|
@@ -7119,6 +7206,43 @@
|
|
|
7119
7206
|
return _ref4.apply(this, arguments);
|
|
7120
7207
|
};
|
|
7121
7208
|
}();
|
|
7209
|
+
var getAudioCodecInfo = /* @__PURE__ */ function() {
|
|
7210
|
+
var _ref5 = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee3(audioTransceiver, extraInfo) {
|
|
7211
|
+
var _audioTransceiver$rec;
|
|
7212
|
+
var reports, inboundRtpStats, codecStats, _inboundRtpStats5, _inboundRtpStats6, _inboundRtpStats7, _inboundRtpStats8, _inboundRtpStats9, _inboundRtpStats10;
|
|
7213
|
+
return _regeneratorRuntime$1().wrap(function _callee3$(_context3) {
|
|
7214
|
+
while (1)
|
|
7215
|
+
switch (_context3.prev = _context3.next) {
|
|
7216
|
+
case 0:
|
|
7217
|
+
_context3.next = 2;
|
|
7218
|
+
return audioTransceiver === null || audioTransceiver === void 0 ? void 0 : (_audioTransceiver$rec = audioTransceiver.receiver) === null || _audioTransceiver$rec === void 0 ? void 0 : _audioTransceiver$rec.getStats().catch(function() {
|
|
7219
|
+
});
|
|
7220
|
+
case 2:
|
|
7221
|
+
reports = _context3.sent;
|
|
7222
|
+
reports === null || reports === void 0 ? void 0 : reports.forEach(function(report) {
|
|
7223
|
+
if (report.type === "inbound-rtp") {
|
|
7224
|
+
inboundRtpStats = report;
|
|
7225
|
+
codecStats = reports.get(report.codecId);
|
|
7226
|
+
}
|
|
7227
|
+
});
|
|
7228
|
+
if (codecStats) {
|
|
7229
|
+
extraInfo.audio_codec = codecStats.mimeType;
|
|
7230
|
+
extraInfo.audio_fmtp = codecStats.sdpFmtpLine;
|
|
7231
|
+
}
|
|
7232
|
+
if (inboundRtpStats) {
|
|
7233
|
+
extraInfo.audio_packet_received = ((_inboundRtpStats5 = inboundRtpStats) === null || _inboundRtpStats5 === void 0 ? void 0 : _inboundRtpStats5.packetsReceived) > 0;
|
|
7234
|
+
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;
|
|
7235
|
+
}
|
|
7236
|
+
case 6:
|
|
7237
|
+
case "end":
|
|
7238
|
+
return _context3.stop();
|
|
7239
|
+
}
|
|
7240
|
+
}, _callee3);
|
|
7241
|
+
}));
|
|
7242
|
+
return function getAudioCodecInfo2(_x3, _x4) {
|
|
7243
|
+
return _ref5.apply(this, arguments);
|
|
7244
|
+
};
|
|
7245
|
+
}();
|
|
7122
7246
|
function changeNumberInRange(source, min, max, delta) {
|
|
7123
7247
|
var target = source + delta;
|
|
7124
7248
|
if (target > max) {
|
|
@@ -7399,13 +7523,13 @@
|
|
|
7399
7523
|
_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;
|
|
7400
7524
|
avDiffTooMuchCount = 0;
|
|
7401
7525
|
_this._setDelayTimer = setInterval(/* @__PURE__ */ _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee3() {
|
|
7402
|
-
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;
|
|
7526
|
+
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;
|
|
7403
7527
|
return _regeneratorRuntime$1().wrap(function _callee3$(_context3) {
|
|
7404
7528
|
while (1)
|
|
7405
7529
|
switch (_context3.prev = _context3.next) {
|
|
7406
7530
|
case 0:
|
|
7407
7531
|
_context3.prev = 0;
|
|
7408
|
-
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))) {
|
|
7532
|
+
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))) {
|
|
7409
7533
|
_context3.next = 5;
|
|
7410
7534
|
break;
|
|
7411
7535
|
}
|
|
@@ -7496,20 +7620,19 @@
|
|
|
7496
7620
|
}();
|
|
7497
7621
|
_this._getDelay = function() {
|
|
7498
7622
|
try {
|
|
7499
|
-
var _this$
|
|
7623
|
+
var _this$_audioTransceic7;
|
|
7500
7624
|
var key = ["playoutDelayHint", "jitterBufferDelayHint", "jitterBufferTarget"].find(function(key2) {
|
|
7501
|
-
var _this$
|
|
7502
|
-
return key2 in (((_this$
|
|
7625
|
+
var _this$_videoTransceic5, _this$_audioTransceic6;
|
|
7626
|
+
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) || {});
|
|
7503
7627
|
});
|
|
7504
7628
|
if (!key)
|
|
7505
7629
|
return;
|
|
7506
|
-
return (_this$
|
|
7630
|
+
return (_this$_audioTransceic7 = _this._audioTransceicer) === null || _this$_audioTransceic7 === void 0 ? void 0 : _this$_audioTransceic7.receiver[key];
|
|
7507
7631
|
} catch (error) {
|
|
7508
7632
|
logger.error("get delay error");
|
|
7509
7633
|
}
|
|
7510
7634
|
};
|
|
7511
7635
|
_this._onLoaderRetry = function(error, retryTime) {
|
|
7512
|
-
console.log(error, "retryTime", retryTime);
|
|
7513
7636
|
_this.emit(EVENT.LOAD_RETRY, {
|
|
7514
7637
|
error: StreamingError.network(error),
|
|
7515
7638
|
retryTime
|
|
@@ -7601,7 +7724,7 @@
|
|
|
7601
7724
|
value: function() {
|
|
7602
7725
|
var _load = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee6(url, failureReason) {
|
|
7603
7726
|
var _this2 = this;
|
|
7604
|
-
var lastPc, answerSdp, errorStr, preloadPromise, info, encodedTransformSupported;
|
|
7727
|
+
var lastPc, pc, answerSdp, errorStr, preloadPromise, info, encodedTransformSupported;
|
|
7605
7728
|
return _regeneratorRuntime$1().wrap(function _callee6$(_context6) {
|
|
7606
7729
|
while (1)
|
|
7607
7730
|
switch (_context6.prev = _context6.next) {
|
|
@@ -7609,44 +7732,47 @@
|
|
|
7609
7732
|
logger.log("load()", 'invoked, url: "'.concat(url, '"'));
|
|
7610
7733
|
this._disconnect(failureReason || "invoke load");
|
|
7611
7734
|
this._url = url;
|
|
7735
|
+
this._retry = this._opts.retryCount || 0;
|
|
7612
7736
|
lastPc = this._pc;
|
|
7737
|
+
pc = null;
|
|
7613
7738
|
if (!this._opts.hackCreateOfferIssue) {
|
|
7614
|
-
_context6.next =
|
|
7739
|
+
_context6.next = 9;
|
|
7615
7740
|
break;
|
|
7616
7741
|
}
|
|
7617
|
-
_context6.next =
|
|
7742
|
+
_context6.next = 9;
|
|
7618
7743
|
return this._createEmptyPeer();
|
|
7619
|
-
case
|
|
7620
|
-
_context6.prev =
|
|
7744
|
+
case 9:
|
|
7745
|
+
_context6.prev = 9;
|
|
7621
7746
|
this._firstFrameObserver.start();
|
|
7622
7747
|
if (!this._preloadPromise) {
|
|
7623
|
-
_context6.next =
|
|
7748
|
+
_context6.next = 41;
|
|
7624
7749
|
break;
|
|
7625
7750
|
}
|
|
7626
7751
|
logger.log("load()", "in preload process...");
|
|
7627
|
-
_context6.prev =
|
|
7752
|
+
_context6.prev = 13;
|
|
7628
7753
|
this._firstFrameObserver.setIsPreload(true);
|
|
7629
7754
|
if (compareURL(this._url, this._preloadPromise.url, ["tabr_start_bitrate"])) {
|
|
7630
|
-
_context6.next =
|
|
7755
|
+
_context6.next = 19;
|
|
7631
7756
|
break;
|
|
7632
7757
|
}
|
|
7633
7758
|
errorStr = "preload url not match, current url: ".concat(this._url, ", preload url: ").concat(this._preloadPromise.url);
|
|
7634
7759
|
delete this._preloadPromise;
|
|
7635
7760
|
throw new Error(errorStr);
|
|
7636
|
-
case
|
|
7761
|
+
case 19:
|
|
7762
|
+
this._loader && (this._loader.finnalUrl = this._preloadPromise.url);
|
|
7637
7763
|
preloadPromise = this._preloadPromise.promise;
|
|
7638
7764
|
delete this._preloadPromise;
|
|
7639
|
-
_context6.next =
|
|
7765
|
+
_context6.next = 24;
|
|
7640
7766
|
return preloadPromise;
|
|
7641
|
-
case
|
|
7767
|
+
case 24:
|
|
7642
7768
|
info = _context6.sent;
|
|
7643
7769
|
if (!(info.pc.signalingState !== "have-local-offer")) {
|
|
7644
|
-
_context6.next =
|
|
7770
|
+
_context6.next = 27;
|
|
7645
7771
|
break;
|
|
7646
7772
|
}
|
|
7647
7773
|
throw new Error('pc.signalingState not equal "have-local-offer", current state is '.concat(info.pc.signalingState));
|
|
7648
|
-
case
|
|
7649
|
-
|
|
7774
|
+
case 27:
|
|
7775
|
+
pc = info.pc;
|
|
7650
7776
|
answerSdp = info.answerSdp;
|
|
7651
7777
|
this._videoTransceicer = info.videoTransceiver;
|
|
7652
7778
|
this._audioTransceicer = info.audioTransceiver;
|
|
@@ -7654,48 +7780,49 @@
|
|
|
7654
7780
|
this.initVideoEncodedTransform();
|
|
7655
7781
|
this.initAudioEncodedTransform();
|
|
7656
7782
|
}
|
|
7657
|
-
_context6.next =
|
|
7783
|
+
_context6.next = 39;
|
|
7658
7784
|
break;
|
|
7659
|
-
case
|
|
7660
|
-
_context6.prev =
|
|
7661
|
-
_context6.t0 = _context6["catch"](
|
|
7785
|
+
case 34:
|
|
7786
|
+
_context6.prev = 34;
|
|
7787
|
+
_context6.t0 = _context6["catch"](13);
|
|
7662
7788
|
logger.warn("load()", "preload failed, ".concat(_context6.t0.message || _context6.t0.toString()));
|
|
7663
7789
|
this.load(url, _context6.t0.message || _context6.t0.toString());
|
|
7664
7790
|
return _context6.abrupt("return");
|
|
7665
|
-
case
|
|
7666
|
-
_context6.next =
|
|
7791
|
+
case 39:
|
|
7792
|
+
_context6.next = 47;
|
|
7667
7793
|
break;
|
|
7668
|
-
case
|
|
7794
|
+
case 41:
|
|
7669
7795
|
encodedTransformSupported = isLegacyEncodedTransformSupported();
|
|
7670
7796
|
logger.log("load()", "isLegacyEncodedTransformSupported: ".concat(encodedTransformSupported));
|
|
7671
|
-
|
|
7797
|
+
pc = new RTCPeerConnection({
|
|
7672
7798
|
encodedInsertableStreams: encodedTransformSupported && this._opts.enableSei ? true : void 0
|
|
7673
7799
|
});
|
|
7674
|
-
_context6.next =
|
|
7675
|
-
return this._getAnswerSdp(
|
|
7676
|
-
case
|
|
7800
|
+
_context6.next = 46;
|
|
7801
|
+
return this._getAnswerSdp(pc);
|
|
7802
|
+
case 46:
|
|
7677
7803
|
answerSdp = _context6.sent;
|
|
7678
|
-
case 44:
|
|
7679
|
-
this._bindRTCEvents(this._pc);
|
|
7680
|
-
_context6.next = 47;
|
|
7681
|
-
return this._handleAnswerSdp(this._pc, answerSdp);
|
|
7682
7804
|
case 47:
|
|
7805
|
+
this._bindRTCEvents(pc);
|
|
7806
|
+
_context6.next = 50;
|
|
7807
|
+
return this._handleAnswerSdp(pc, answerSdp);
|
|
7808
|
+
case 50:
|
|
7683
7809
|
if (lastPc) {
|
|
7684
7810
|
lastPc.close();
|
|
7685
7811
|
}
|
|
7686
|
-
|
|
7812
|
+
this._pc = pc;
|
|
7813
|
+
_context6.next = 57;
|
|
7687
7814
|
break;
|
|
7688
|
-
case
|
|
7689
|
-
_context6.prev =
|
|
7690
|
-
_context6.t1 = _context6["catch"](
|
|
7815
|
+
case 54:
|
|
7816
|
+
_context6.prev = 54;
|
|
7817
|
+
_context6.t1 = _context6["catch"](9);
|
|
7691
7818
|
setTimeout(function() {
|
|
7692
7819
|
return _this2._emitError(StreamingError.create(ERR.OTHER, null, _context6.t1));
|
|
7693
7820
|
});
|
|
7694
|
-
case
|
|
7821
|
+
case 57:
|
|
7695
7822
|
case "end":
|
|
7696
7823
|
return _context6.stop();
|
|
7697
7824
|
}
|
|
7698
|
-
}, _callee6, this, [[
|
|
7825
|
+
}, _callee6, this, [[9, 54], [13, 34]]);
|
|
7699
7826
|
}));
|
|
7700
7827
|
function load(_x2, _x3) {
|
|
7701
7828
|
return _load.apply(this, arguments);
|
|
@@ -7838,6 +7965,7 @@
|
|
|
7838
7965
|
key: "_getAnswerSdp",
|
|
7839
7966
|
value: function() {
|
|
7840
7967
|
var _getAnswerSdp2 = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee7(pc) {
|
|
7968
|
+
var _this6 = this, _this$_opts$standardi;
|
|
7841
7969
|
var offer, answerSdp, parsed, finnalUrl, _this$_opts, _this$_loader, _this$_opts2, _parsed$media, parseSession, sessionId, reqStart, res, answer, err;
|
|
7842
7970
|
return _regeneratorRuntime$1().wrap(function _callee7$(_context7) {
|
|
7843
7971
|
while (1)
|
|
@@ -7889,31 +8017,38 @@
|
|
|
7889
8017
|
parsed.media.filter(function(x) {
|
|
7890
8018
|
return x.type === "audio";
|
|
7891
8019
|
}).forEach(function(x) {
|
|
7892
|
-
var _x$rtp$filter$,
|
|
8020
|
+
var _x$rtp$filter$, _this6$_opts$standard, _this6$_opts$standard2;
|
|
7893
8021
|
var opusPayload = (_x$rtp$filter$ = x.rtp.filter(function(rtp) {
|
|
7894
8022
|
return rtp.codec === "opus";
|
|
7895
8023
|
})[0]) === null || _x$rtp$filter$ === void 0 ? void 0 : _x$rtp$filter$.payload;
|
|
7896
8024
|
if (!opusPayload)
|
|
7897
8025
|
return;
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
|
|
8026
|
+
if ((_this6$_opts$standard = _this6._opts.standardizeKillSwitch) !== null && _this6$_opts$standard !== void 0 && _this6$_opts$standard.sld_fmtp_opus) {
|
|
8027
|
+
x.fmtp.forEach(function(fmtp) {
|
|
8028
|
+
if (fmtp.payload !== opusPayload)
|
|
8029
|
+
return;
|
|
8030
|
+
fmtp.config = "minptime=10;stereo=1;useinbandfec=1";
|
|
8031
|
+
});
|
|
8032
|
+
}
|
|
8033
|
+
if ((_this6$_opts$standard2 = _this6._opts.standardizeKillSwitch) !== null && _this6$_opts$standard2 !== void 0 && _this6$_opts$standard2.sld_rtcpfb_opus_nack) {
|
|
8034
|
+
var _x$rtcpFb;
|
|
8035
|
+
(_x$rtcpFb = x.rtcpFb) === null || _x$rtcpFb === void 0 ? void 0 : _x$rtcpFb.push({
|
|
8036
|
+
payload: opusPayload,
|
|
8037
|
+
type: "nack"
|
|
8038
|
+
});
|
|
8039
|
+
}
|
|
7907
8040
|
});
|
|
7908
|
-
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
x2.config
|
|
7914
|
-
|
|
8041
|
+
if ((_this$_opts$standardi = this._opts.standardizeKillSwitch) !== null && _this$_opts$standardi !== void 0 && _this$_opts$standardi.sld_fmtp_sps_pps) {
|
|
8042
|
+
parsed.media.filter(function(x) {
|
|
8043
|
+
return x.type === "video";
|
|
8044
|
+
}).forEach(function(x) {
|
|
8045
|
+
x.fmtp.forEach(function(x2) {
|
|
8046
|
+
if (x2.config.indexOf("profile-level-id") !== -1) {
|
|
8047
|
+
x2.config = "".concat(x2.config, ";sps-pps-idr-in-keyframe=1");
|
|
8048
|
+
}
|
|
8049
|
+
});
|
|
7915
8050
|
});
|
|
7916
|
-
}
|
|
8051
|
+
}
|
|
7917
8052
|
offer.sdp = lib.write(parsed);
|
|
7918
8053
|
logger.log("local offer modified:\n", offer);
|
|
7919
8054
|
_context7.next = 25;
|
|
@@ -8048,7 +8183,7 @@
|
|
|
8048
8183
|
this._firstFrameObserver.changeFirstFrameState(RTC_FIRST_FRAME_STATE.ANSWER_SDP_READY);
|
|
8049
8184
|
this._networkEvaluate = new NetworkEvaluate(pc, this._opts.networkEvaluateInterval);
|
|
8050
8185
|
this._listenPeerStateTimeout();
|
|
8051
|
-
this._firstFrameObserver.bindEvents(pc, this._videoTransceicer, this._media);
|
|
8186
|
+
this._firstFrameObserver.bindEvents(pc, this._videoTransceicer, this._audioTransceicer, this._media);
|
|
8052
8187
|
case 17:
|
|
8053
8188
|
case "end":
|
|
8054
8189
|
return _context8.stop();
|
|
@@ -8063,11 +8198,11 @@
|
|
|
8063
8198
|
}, {
|
|
8064
8199
|
key: "_listenPeerStateTimeout",
|
|
8065
8200
|
value: function _listenPeerStateTimeout() {
|
|
8066
|
-
var
|
|
8201
|
+
var _this7 = this;
|
|
8067
8202
|
this._clearPeerStateTimeout();
|
|
8068
8203
|
if (this._opts.connectionStateChangeTimeout) {
|
|
8069
8204
|
this._peerStateTimer = setTimeout(function() {
|
|
8070
|
-
|
|
8205
|
+
_this7._emitError(StreamingError.create(ERR.MEDIA, ERR.SUB_TYPES.MEDIA_ERR_SRC_NOT_SUPPORTED, {
|
|
8071
8206
|
message: "listen connectionstatechange timeout"
|
|
8072
8207
|
}));
|
|
8073
8208
|
}, this._opts.connectionStateChangeTimeout);
|
|
@@ -8084,59 +8219,59 @@
|
|
|
8084
8219
|
}, {
|
|
8085
8220
|
key: "_startRtcReport",
|
|
8086
8221
|
value: function _startRtcReport() {
|
|
8087
|
-
var
|
|
8222
|
+
var _this8 = this;
|
|
8088
8223
|
this._stopRtcReport();
|
|
8089
8224
|
var report = /* @__PURE__ */ function() {
|
|
8090
8225
|
var _ref5 = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee9() {
|
|
8091
|
-
var
|
|
8092
|
-
var
|
|
8226
|
+
var _this8$_audioTranscei, _this8$_audioTranscei2, _this8$_videoTranscei, _this8$_videoTranscei2;
|
|
8227
|
+
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;
|
|
8093
8228
|
return _regeneratorRuntime$1().wrap(function _callee9$(_context9) {
|
|
8094
8229
|
while (1)
|
|
8095
8230
|
switch (_context9.prev = _context9.next) {
|
|
8096
8231
|
case 0:
|
|
8097
|
-
if (!(!((
|
|
8232
|
+
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))) {
|
|
8098
8233
|
_context9.next = 4;
|
|
8099
8234
|
break;
|
|
8100
8235
|
}
|
|
8101
|
-
|
|
8102
|
-
|
|
8236
|
+
_this8._preAudioStats = null;
|
|
8237
|
+
_this8._preVideoStats = null;
|
|
8103
8238
|
return _context9.abrupt("return");
|
|
8104
8239
|
case 4:
|
|
8105
|
-
if (!
|
|
8106
|
-
|
|
8107
|
-
|
|
8240
|
+
if (!_this8._audioStallObserver && _this8._audioTransceicer) {
|
|
8241
|
+
_this8._audioStallObserver = new AudioStallObserver();
|
|
8242
|
+
_this8._audioStallObserver.start(_this8._audioTransceicer);
|
|
8108
8243
|
}
|
|
8109
|
-
if (!
|
|
8110
|
-
|
|
8111
|
-
|
|
8244
|
+
if (!_this8._videoStallObserver && _this8._video && _this8._media) {
|
|
8245
|
+
_this8._videoStallObserver = new VideoStallObserver();
|
|
8246
|
+
_this8._videoStallObserver.start(_this8._media);
|
|
8112
8247
|
}
|
|
8113
|
-
if (!
|
|
8114
|
-
|
|
8115
|
-
(
|
|
8248
|
+
if (!_this8._frameRecvCallback && _this8._media) {
|
|
8249
|
+
_this8._frameRecvCallback = new VideoFrameRecvCallback();
|
|
8250
|
+
(_this8$_frameRecvCall = _this8._frameRecvCallback) === null || _this8$_frameRecvCall === void 0 ? void 0 : _this8$_frameRecvCall.start(_this8._media);
|
|
8116
8251
|
}
|
|
8117
|
-
if (
|
|
8118
|
-
|
|
8252
|
+
if (_this8._pc && !_this8._networkQuality && _this8._opts.enableNetworkQuality && _this8._opts.networkQuality) {
|
|
8253
|
+
_this8._networkQuality = new NetworkQuality(_this8._pc, _this8._opts.networkQuality);
|
|
8119
8254
|
}
|
|
8120
8255
|
_context9.next = 10;
|
|
8121
|
-
return Promise.all([getRecvAudioStats(
|
|
8256
|
+
return Promise.all([getRecvAudioStats(_this8._audioTransceicer.receiver.getStats()), getRecvVideoStats(_this8._videoTransceicer.receiver.getStats())]);
|
|
8122
8257
|
case 10:
|
|
8123
8258
|
_yield$Promise$all3 = _context9.sent;
|
|
8124
8259
|
_yield$Promise$all4 = _slicedToArray(_yield$Promise$all3, 2);
|
|
8125
8260
|
curAudioStats = _yield$Promise$all4[0];
|
|
8126
8261
|
curVideoStats = _yield$Promise$all4[1];
|
|
8127
|
-
if (!(
|
|
8262
|
+
if (!(_this8._preAudioStats && _this8._preVideoStats)) {
|
|
8128
8263
|
_context9.next = 28;
|
|
8129
8264
|
break;
|
|
8130
8265
|
}
|
|
8131
|
-
audioStats = diffRecvAudioStats(
|
|
8132
|
-
videoStats = diffRecvVideoStats(
|
|
8133
|
-
|
|
8266
|
+
audioStats = diffRecvAudioStats(_this8._preAudioStats, curAudioStats);
|
|
8267
|
+
videoStats = diffRecvVideoStats(_this8._preVideoStats, curVideoStats);
|
|
8268
|
+
_this8._videoJitterBufferDelay = videoStats.jitterBufferDelay;
|
|
8134
8269
|
_context9.next = 20;
|
|
8135
|
-
return (
|
|
8270
|
+
return (_this8$_audioStallObs = _this8._audioStallObserver) === null || _this8$_audioStallObs === void 0 ? void 0 : _this8$_audioStallObs.getAudioStallInfo();
|
|
8136
8271
|
case 20:
|
|
8137
8272
|
audioStallInfo = _context9.sent;
|
|
8138
8273
|
_context9.next = 23;
|
|
8139
|
-
return (
|
|
8274
|
+
return (_this8$_videoStallObs = _this8._videoStallObserver) === null || _this8$_videoStallObs === void 0 ? void 0 : _this8$_videoStallObs.getStallInfo({
|
|
8140
8275
|
interval: videoStats.statsInterval,
|
|
8141
8276
|
frameRateReceived: videoStats.receivedFrameRate,
|
|
8142
8277
|
frameRateDecoded: videoStats.decoderOutputFrameRate,
|
|
@@ -8144,18 +8279,18 @@
|
|
|
8144
8279
|
});
|
|
8145
8280
|
case 23:
|
|
8146
8281
|
videoStallInfo = _context9.sent;
|
|
8147
|
-
_ref6 = (
|
|
8282
|
+
_ref6 = (_this8$_networkQualit = (_this8$_networkQualit2 = _this8._networkQuality) === null || _this8$_networkQualit2 === void 0 ? void 0 : _this8$_networkQualit2.getDownlinkQuality(_objectSpread2$2(_objectSpread2$2({}, audioStats), {}, {
|
|
8148
8283
|
stallDuration: (audioStallInfo === null || audioStallInfo === void 0 ? void 0 : audioStallInfo.stallDuration) || 0
|
|
8149
8284
|
}), _objectSpread2$2(_objectSpread2$2({}, videoStats), {}, {
|
|
8150
8285
|
stallDuration: (videoStallInfo === null || videoStallInfo === void 0 ? void 0 : videoStallInfo.stall.stallDuration100ms) || (videoStallInfo === null || videoStallInfo === void 0 ? void 0 : videoStallInfo.stall.stallDuration500ms) || 0
|
|
8151
|
-
}))) !== null &&
|
|
8152
|
-
if (
|
|
8153
|
-
|
|
8286
|
+
}))) !== null && _this8$_networkQualit !== void 0 ? _this8$_networkQualit : [], _ref7 = _slicedToArray(_ref6, 2), quality = _ref7[0], qualityInfo = _ref7[1];
|
|
8287
|
+
if (_this8._opts.enableAdaptiveJitterBuffer) {
|
|
8288
|
+
_this8._handleJitterBuffer(qualityInfo === null || qualityInfo === void 0 ? void 0 : qualityInfo.qualityQos, _this8._opts.adaptiveJitterBuffer, _this8._opts.networkStrategy);
|
|
8154
8289
|
}
|
|
8155
8290
|
if (videoStats.estimatedPlayoutTimestamp && audioStats.estimatedPlayoutTimestamp) {
|
|
8156
8291
|
av_sync_diff = videoStats.estimatedPlayoutTimestamp - audioStats.estimatedPlayoutTimestamp;
|
|
8157
8292
|
}
|
|
8158
|
-
|
|
8293
|
+
_this8.emit(EXTEND_EVENTS.RTC_NETWORK, _objectSpread2$2({
|
|
8159
8294
|
interval: videoStats.statsInterval,
|
|
8160
8295
|
network_quality: quality,
|
|
8161
8296
|
audio_stall_duration: audioStallInfo === null || audioStallInfo === void 0 ? void 0 : audioStallInfo.stallDuration,
|
|
@@ -8181,13 +8316,13 @@
|
|
|
8181
8316
|
quality_qos: qualityInfo === null || qualityInfo === void 0 ? void 0 : qualityInfo.qualityQos,
|
|
8182
8317
|
quality_audio_qoe: qualityInfo === null || qualityInfo === void 0 ? void 0 : qualityInfo.audioQoe,
|
|
8183
8318
|
quality_video_qoe: qualityInfo === null || qualityInfo === void 0 ? void 0 : qualityInfo.videoQoe,
|
|
8184
|
-
current_delay:
|
|
8319
|
+
current_delay: _this8._getDelay(),
|
|
8185
8320
|
visibility_state: document.visibilityState,
|
|
8186
|
-
target_delay:
|
|
8321
|
+
target_delay: _this8._targetDelayHint,
|
|
8187
8322
|
av_sync_diff,
|
|
8188
|
-
set_delay_error:
|
|
8189
|
-
video_width: ((
|
|
8190
|
-
video_height: ((
|
|
8323
|
+
set_delay_error: _this8._setDelayError || null,
|
|
8324
|
+
video_width: ((_this8$_media = _this8._media) === null || _this8$_media === void 0 ? void 0 : _this8$_media.videoWidth) || 0,
|
|
8325
|
+
video_height: ((_this8$_media2 = _this8._media) === null || _this8$_media2 === void 0 ? void 0 : _this8$_media2.videoHeight) || 0,
|
|
8191
8326
|
abr_state: videoStats.abrState || "none",
|
|
8192
8327
|
recv_frame_rate: videoStats.receivedFrameRate,
|
|
8193
8328
|
decode_frame_rate: videoStats.decoderOutputFrameRate,
|
|
@@ -8195,15 +8330,19 @@
|
|
|
8195
8330
|
drop_frame_rate: videoStats.framesDropped,
|
|
8196
8331
|
audio_packets_received: audioStats.packetsReceived,
|
|
8197
8332
|
video_packets_received: videoStats.packetsReceived,
|
|
8198
|
-
video_muted: (
|
|
8199
|
-
video_paused: (
|
|
8200
|
-
video_volume: (
|
|
8201
|
-
video_current_time: (
|
|
8202
|
-
|
|
8333
|
+
video_muted: (_this8$_media3 = _this8._media) === null || _this8$_media3 === void 0 ? void 0 : _this8$_media3.muted,
|
|
8334
|
+
video_paused: (_this8$_media4 = _this8._media) === null || _this8$_media4 === void 0 ? void 0 : _this8$_media4.paused,
|
|
8335
|
+
video_volume: (_this8$_media5 = _this8._media) === null || _this8$_media5 === void 0 ? void 0 : _this8$_media5.volume,
|
|
8336
|
+
video_current_time: (_this8$_media6 = _this8._media) === null || _this8$_media6 === void 0 ? void 0 : _this8$_media6.currentTime,
|
|
8337
|
+
fec_packets_received: videoStats.fecPacketsReceived,
|
|
8338
|
+
video_kbps: videoStats.receivedKBitrate,
|
|
8339
|
+
audio_kbps: audioStats.receivedKBitrate,
|
|
8340
|
+
fec_ssrc: videoStats.fecSsrc
|
|
8341
|
+
}, ((_this8$_frameRecvCall2 = _this8._frameRecvCallback) === null || _this8$_frameRecvCall2 === void 0 ? void 0 : _this8$_frameRecvCall2.getRecentRenderInfo4Report()) || {}));
|
|
8203
8342
|
case 28:
|
|
8204
|
-
|
|
8205
|
-
|
|
8206
|
-
|
|
8343
|
+
_this8._preAudioStats = curAudioStats;
|
|
8344
|
+
_this8._preVideoStats = curVideoStats;
|
|
8345
|
+
_this8._setDelayError = null;
|
|
8207
8346
|
case 31:
|
|
8208
8347
|
case "end":
|
|
8209
8348
|
return _context9.stop();
|
|
@@ -8358,7 +8497,7 @@
|
|
|
8358
8497
|
}, {
|
|
8359
8498
|
key: "_changeVolumeInHarmonyWorkaround",
|
|
8360
8499
|
value: function _changeVolumeInHarmonyWorkaround() {
|
|
8361
|
-
var
|
|
8500
|
+
var _this9 = this;
|
|
8362
8501
|
if (isHarmonyOS()) {
|
|
8363
8502
|
var originalDescriptor = Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, "muted");
|
|
8364
8503
|
if (this._media && originalDescriptor) {
|
|
@@ -8377,9 +8516,9 @@
|
|
|
8377
8516
|
}
|
|
8378
8517
|
});
|
|
8379
8518
|
this._revertVolumeWorkaround = function() {
|
|
8380
|
-
logger.log("revert HarmonyOS muted workaround. video dom:",
|
|
8381
|
-
if (
|
|
8382
|
-
Object.defineProperty(
|
|
8519
|
+
logger.log("revert HarmonyOS muted workaround. video dom:", _this9._media);
|
|
8520
|
+
if (_this9._media) {
|
|
8521
|
+
Object.defineProperty(_this9._media, "muted", originalDescriptor);
|
|
8383
8522
|
}
|
|
8384
8523
|
};
|
|
8385
8524
|
}
|
|
@@ -8388,7 +8527,7 @@
|
|
|
8388
8527
|
}, {
|
|
8389
8528
|
key: "_mutedBeforePlayingWorkaround",
|
|
8390
8529
|
value: function _mutedBeforePlayingWorkaround() {
|
|
8391
|
-
var
|
|
8530
|
+
var _this10 = this;
|
|
8392
8531
|
if (isHeyTapBrowser() || isVivoBrowser()) {
|
|
8393
8532
|
var originalDescriptor = Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, "muted");
|
|
8394
8533
|
if (this._media && originalDescriptor) {
|
|
@@ -8408,12 +8547,13 @@
|
|
|
8408
8547
|
});
|
|
8409
8548
|
var revertMutedProxy = function revertMutedProxy2() {
|
|
8410
8549
|
logger.log("revert muted workaround. muted:", originalMuted);
|
|
8411
|
-
if (
|
|
8412
|
-
Object.defineProperty(
|
|
8413
|
-
|
|
8414
|
-
|
|
8550
|
+
if (_this10._media) {
|
|
8551
|
+
Object.defineProperty(_this10._media, "muted", originalDescriptor);
|
|
8552
|
+
_this10._media.muted = originalMuted;
|
|
8553
|
+
_this10._media.removeEventListener("playing", revertMutedProxy2);
|
|
8415
8554
|
}
|
|
8416
8555
|
};
|
|
8556
|
+
this._revertMutedWorkaround = revertMutedProxy;
|
|
8417
8557
|
this._media.addEventListener("playing", revertMutedProxy);
|
|
8418
8558
|
}
|
|
8419
8559
|
}
|
|
@@ -8421,8 +8561,10 @@
|
|
|
8421
8561
|
}, {
|
|
8422
8562
|
key: "destroy",
|
|
8423
8563
|
value: function destroy(keepClearMediaStream) {
|
|
8424
|
-
var _this$_revertVolumeWo, _this$_media3;
|
|
8564
|
+
var _this$_revertMutedWor, _this$_revertVolumeWo, _this$_media3;
|
|
8425
8565
|
this._disconnect("invoke destroy");
|
|
8566
|
+
(_this$_revertMutedWor = this._revertMutedWorkaround) === null || _this$_revertMutedWor === void 0 ? void 0 : _this$_revertMutedWor.call(this);
|
|
8567
|
+
delete this._revertMutedWorkaround;
|
|
8426
8568
|
(_this$_revertVolumeWo = this._revertVolumeWorkaround) === null || _this$_revertVolumeWo === void 0 ? void 0 : _this$_revertVolumeWo.call(this);
|
|
8427
8569
|
delete this._revertVolumeWorkaround;
|
|
8428
8570
|
(_this$_media3 = this._media) === null || _this$_media3 === void 0 ? void 0 : _this$_media3.removeEventListener("timeupdate", this._mockWaitingByTimeupdate);
|
|
@@ -8521,15 +8663,19 @@
|
|
|
8521
8663
|
_this.__retry = function() {
|
|
8522
8664
|
_this.player.removeClass(STATE_CLASS.ERROR);
|
|
8523
8665
|
_this.player.addClass(STATE_CLASS.LOADING);
|
|
8524
|
-
runHooks(_assertThisInitialized$1(_this), "retry", function() {
|
|
8666
|
+
_this.player.runHooks(_assertThisInitialized$1(_this), "retry", function() {
|
|
8525
8667
|
_this.player.src = "";
|
|
8526
8668
|
_this.player.once(CANPLAY, function() {
|
|
8527
|
-
|
|
8669
|
+
var _assertThisInitialize, _assertThisInitialize2;
|
|
8670
|
+
(_assertThisInitialize = _assertThisInitialized$1(_this)) === null || _assertThisInitialize === void 0 ? void 0 : (_assertThisInitialize2 = _assertThisInitialize.player) === null || _assertThisInitialize2 === void 0 ? void 0 : _assertThisInitialize2.mediaPlay();
|
|
8528
8671
|
});
|
|
8529
8672
|
});
|
|
8530
8673
|
};
|
|
8531
8674
|
_this.destroy = function() {
|
|
8532
8675
|
var _this$_rts3;
|
|
8676
|
+
if (typeof _this._originHandleSource === "boolean") {
|
|
8677
|
+
_this.player.handleSource = _this._originHandleSource;
|
|
8678
|
+
}
|
|
8533
8679
|
_this.player.switchURL = _this._originSwitchFn;
|
|
8534
8680
|
_this.player.retry = _this._originRetry;
|
|
8535
8681
|
_this._clearDisconnectTimer();
|
|
@@ -8576,12 +8722,16 @@
|
|
|
8576
8722
|
}, {
|
|
8577
8723
|
key: "version",
|
|
8578
8724
|
get: function get() {
|
|
8579
|
-
return "0.2.1-alpha.
|
|
8725
|
+
return "0.2.1-alpha.64";
|
|
8580
8726
|
}
|
|
8581
8727
|
}, {
|
|
8582
8728
|
key: "beforePlayerInit",
|
|
8583
8729
|
value: function beforePlayerInit() {
|
|
8584
|
-
var _this$player2, _this$player$config, _this$player$config$r, _this2 = this;
|
|
8730
|
+
var _this$player$video, _this$player2, _this$player$config, _this$player$config$r, _this2 = this;
|
|
8731
|
+
var pl = this.player;
|
|
8732
|
+
this._originHandleSource = pl.handleSource;
|
|
8733
|
+
pl.handleSource = false;
|
|
8734
|
+
(_this$player$video = this.player.video) === null || _this$player$video === void 0 ? void 0 : _this$player$video.removeAttribute("src");
|
|
8585
8735
|
this._init();
|
|
8586
8736
|
if (!this._originSwitchFn) {
|
|
8587
8737
|
var _this$player$switchUR;
|
|
@@ -8611,24 +8761,6 @@
|
|
|
8611
8761
|
});
|
|
8612
8762
|
}
|
|
8613
8763
|
this._bindRtsEvents();
|
|
8614
|
-
try {
|
|
8615
|
-
BasePlugin.defineGetterOrSetter(this.player, {
|
|
8616
|
-
__url: {
|
|
8617
|
-
get: function get() {
|
|
8618
|
-
try {
|
|
8619
|
-
return URL.createObjectURL(new MediaSource());
|
|
8620
|
-
} catch (e) {
|
|
8621
|
-
var _this2$player, _this2$player$video;
|
|
8622
|
-
if (!((_this2$player = _this2.player) !== null && _this2$player !== void 0 && (_this2$player$video = _this2$player.video) !== null && _this2$player$video !== void 0 && _this2$player$video.srcObject)) {
|
|
8623
|
-
_this2.player.video.srcObject = new MediaStream();
|
|
8624
|
-
}
|
|
8625
|
-
return "";
|
|
8626
|
-
}
|
|
8627
|
-
}
|
|
8628
|
-
}
|
|
8629
|
-
});
|
|
8630
|
-
} catch (e) {
|
|
8631
|
-
}
|
|
8632
8764
|
}
|
|
8633
8765
|
}, {
|
|
8634
8766
|
key: "getStats",
|
|
@@ -8718,6 +8850,9 @@
|
|
|
8718
8850
|
player.unRegisterPlugin("rts");
|
|
8719
8851
|
player.switchURL = _this3._originSwitchFn;
|
|
8720
8852
|
player.retry = _this3._originRetry;
|
|
8853
|
+
if (typeof _this3._originHandleSource === "boolean") {
|
|
8854
|
+
player.handleSource = _this3._originHandleSource;
|
|
8855
|
+
}
|
|
8721
8856
|
_this3._rts = null;
|
|
8722
8857
|
player.rts = null;
|
|
8723
8858
|
if ((_player$video = player.video) !== null && _player$video !== void 0 && _player$video.srcObject) {
|
|
@@ -8813,6 +8948,11 @@
|
|
|
8813
8948
|
}
|
|
8814
8949
|
return isSupportedH264;
|
|
8815
8950
|
}()
|
|
8951
|
+
}, {
|
|
8952
|
+
key: "isEncodedTransformSupported",
|
|
8953
|
+
value: function isEncodedTransformSupported$1() {
|
|
8954
|
+
return isEncodedTransformSupported() || isLegacyEncodedTransformSupported();
|
|
8955
|
+
}
|
|
8816
8956
|
}]);
|
|
8817
8957
|
return RtsPlugin2;
|
|
8818
8958
|
}(BasePlugin);
|