@volcengine/veplayer-plugin 2.10.3 → 2.10.4-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5078,9 +5078,9 @@ lib.parsePayloads = parser.parsePayloads;
5078
5078
  lib.parseRemoteCandidates = parser.parseRemoteCandidates;
5079
5079
  lib.parseImageAttributes = parser.parseImageAttributes;
5080
5080
  lib.parseSimulcastStreamList = parser.parseSimulcastStreamList;
5081
- var _excluded = ["adaptiveJitterBuffer"];
5081
+ var _excluded = ["adaptiveJitterBuffer", "standardizeKillSwitch"];
5082
5082
  function getOption(options) {
5083
- var _ref = options || {}, _ref$adaptiveJitterBu = _ref.adaptiveJitterBuffer, adaptiveJitterBuffer = _ref$adaptiveJitterBu === void 0 ? {} : _ref$adaptiveJitterBu, opts = _objectWithoutProperties$1(_ref, _excluded);
5083
+ 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);
5084
5084
  return _objectSpread2$2({
5085
5085
  retryCount: 0,
5086
5086
  retryDelay: 1e3,
@@ -5151,7 +5151,12 @@ function getOption(options) {
5151
5151
  5: {
5152
5152
  jitterBuffer: 3
5153
5153
  }
5154
- }
5154
+ },
5155
+ standardizeKillSwitch: _objectSpread2$2({
5156
+ sld_fmtp_opus: true,
5157
+ sld_rtcpfb_opus_nack: true,
5158
+ sld_fmtp_sps_pps: true
5159
+ }, standardizeKillSwitch)
5155
5160
  }, opts);
5156
5161
  }
5157
5162
  function _getStats(stats) {
@@ -5493,7 +5498,7 @@ function getCapacity() {
5493
5498
  });
5494
5499
  }
5495
5500
  var isEncodedTransformSupported = function isEncodedTransformSupported2() {
5496
- return typeof TransformStream !== "undefined" && typeof RTCRtpSender !== "undefined" && typeof RTCRtpReceiver !== "undefined" && typeof RTCRtpScriptTransform !== "undefined" && "transform" in RTCRtpSender.prototype && "transform" in RTCRtpReceiver.prototype && isWorkerSupported() && isMessageChannelSupported();
5501
+ 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();
5497
5502
  };
5498
5503
  var isWorkerSupported = function isWorkerSupported2() {
5499
5504
  return typeof window !== "undefined" && window.Worker;
@@ -5502,7 +5507,7 @@ var isMessageChannelSupported = function isMessageChannelSupported2() {
5502
5507
  return typeof MessageChannel !== "undefined";
5503
5508
  };
5504
5509
  var isLegacyEncodedTransformSupported = function isLegacyEncodedTransformSupported2() {
5505
- return typeof TransformStream !== "undefined" && typeof RTCRtpSender !== "undefined" && typeof RTCRtpReceiver !== "undefined" && typeof RTCRtpSender.prototype.createEncodedStreams !== "undefined" && typeof RTCRtpReceiver.prototype.createEncodedStreams !== "undefined";
5510
+ 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";
5506
5511
  };
5507
5512
  var Nalunit = {
5508
5513
  getNALUnits: function getNALUnits(buffer) {
@@ -6680,6 +6685,8 @@ function _getRecvVideoStats() {
6680
6685
  currentStats.firCount = stat.firCount;
6681
6686
  currentStats.nackCount = stat.nackCount;
6682
6687
  currentStats.pliCount = stat.pliCount;
6688
+ currentStats.fecPacketsReceived = stat.fecPacketsReceived;
6689
+ currentStats.fecSsrc = stat.fecSsrc;
6683
6690
  if (stat.jitterBufferDelay !== void 0) {
6684
6691
  currentStats.jitterBufferEmittedCount = stat.jitterBufferEmittedCount;
6685
6692
  currentStats.jitterBufferDelay = stat.jitterBufferDelay;
@@ -6744,12 +6751,14 @@ function diffRecvVideoStats(oldStats, newStats) {
6744
6751
  nackCount,
6745
6752
  pliCount: diffNumber(oldStats, newStats, "pliCount"),
6746
6753
  e2eDelay: Math.round((newStats.rtt || 0) + jitterBufferDelay),
6747
- retransmittedRate: +(nackCount / (packetsReceived + packetsLostDiff)).toFixed(2)
6754
+ retransmittedRate: +(nackCount / (packetsReceived + packetsLostDiff)).toFixed(2),
6755
+ fecPacketsReceived: diffNumber(oldStats, newStats, "fecPacketsReceived"),
6756
+ fecSsrc: newStats.fecSsrc
6748
6757
  };
6749
6758
  }
6750
6759
  function diffNumber(oldValue, newValue, key) {
6751
- var oldV = Number.isNaN(oldValue[key]) ? 0 : +oldValue[key];
6752
- var newV = Number.isNaN(newValue[key]) ? 0 : +newValue[key];
6760
+ var oldV = !Number.isFinite(oldValue[key]) ? 0 : +oldValue[key];
6761
+ var newV = !Number.isFinite(newValue[key]) ? 0 : +newValue[key];
6753
6762
  return Math.max(0, newV - oldV);
6754
6763
  }
6755
6764
  var QoELevel = {
@@ -6880,6 +6889,63 @@ var NetworkQuality = /* @__PURE__ */ function() {
6880
6889
  }]);
6881
6890
  return NetworkQuality2;
6882
6891
  }();
6892
+ var gpuInfo;
6893
+ function getGpuInfo() {
6894
+ if (!gpuInfo) {
6895
+ gpuInfo = _getGpuInfo();
6896
+ }
6897
+ return gpuInfo;
6898
+ }
6899
+ function _getGpuInfo() {
6900
+ var canvas = document.createElement("canvas");
6901
+ var gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
6902
+ if (!gl) {
6903
+ return {
6904
+ renderer: "unknown(WebGLRenderingContext not existed)",
6905
+ vendor: "unknown(WebGLRenderingContext not existed)"
6906
+ };
6907
+ }
6908
+ var info = gl.getExtension("WEBGL_debug_renderer_info");
6909
+ if (!info) {
6910
+ return {
6911
+ renderer: "unknown(info not existed)",
6912
+ vendor: "unknown(info not existed)"
6913
+ };
6914
+ }
6915
+ var renderer = gl.getParameter(info.UNMASKED_RENDERER_WEBGL);
6916
+ var vendor = gl.getParameter(info.UNMASKED_VENDOR_WEBGL);
6917
+ if (canvas && canvas.parentNode) {
6918
+ canvas.parentNode.removeChild(canvas);
6919
+ }
6920
+ canvas = void 0;
6921
+ gl = void 0;
6922
+ return {
6923
+ renderer,
6924
+ vendor
6925
+ };
6926
+ }
6927
+ function extractProfileInfo(sdpFmtpLine) {
6928
+ var profileLevelId = "";
6929
+ if (!sdpFmtpLine) {
6930
+ return profileLevelId;
6931
+ }
6932
+ var paramArray = sdpFmtpLine.split(";");
6933
+ var _iterator = _createForOfIteratorHelper$1(paramArray), _step;
6934
+ try {
6935
+ for (_iterator.s(); !(_step = _iterator.n()).done; ) {
6936
+ var param = _step.value;
6937
+ 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];
6938
+ if (key === "profile-level-id") {
6939
+ profileLevelId = value;
6940
+ }
6941
+ }
6942
+ } catch (err) {
6943
+ _iterator.e(err);
6944
+ } finally {
6945
+ _iterator.f();
6946
+ }
6947
+ return profileLevelId;
6948
+ }
6883
6949
  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];
6884
6950
  var FirstFrameObserver = /* @__PURE__ */ function() {
6885
6951
  function FirstFrameObserver2(_emitFirstFrameState) {
@@ -6893,6 +6959,7 @@ var FirstFrameObserver = /* @__PURE__ */ function() {
6893
6959
  this._pc = null;
6894
6960
  this._video = null;
6895
6961
  this._videoTransceiver = null;
6962
+ this._audioTransceiver = null;
6896
6963
  this._extraInfo = {
6897
6964
  is_preload: false
6898
6965
  };
@@ -6965,11 +7032,12 @@ var FirstFrameObserver = /* @__PURE__ */ function() {
6965
7032
  }
6966
7033
  }, {
6967
7034
  key: "bindEvents",
6968
- value: function bindEvents(pc, videoTransceiver, video) {
7035
+ value: function bindEvents(pc, videoTransceiver, audioTransceiver, video) {
6969
7036
  var _this3 = this;
6970
7037
  this._pc = pc;
6971
7038
  this._video = video;
6972
7039
  this._videoTransceiver = videoTransceiver;
7040
+ this._audioTransceiver = audioTransceiver;
6973
7041
  pc.addEventListener("connectionstatechange", this._handleConnectionStateChange);
6974
7042
  pc.addEventListener("iceconnectionstatechange", this._handleICEConnectionStateChange);
6975
7043
  var _ref2 = (videoTransceiver === null || videoTransceiver === void 0 ? void 0 : videoTransceiver.receiver) || {}, transport = _ref2.transport;
@@ -7043,7 +7111,9 @@ var FirstFrameObserver = /* @__PURE__ */ function() {
7043
7111
  if (Object.keys(this._state).length > 0) {
7044
7112
  var state = _objectSpread2$2({}, this._state);
7045
7113
  var extraInfo = _objectSpread2$2({}, this._extraInfo);
7046
- getTransportInfo(this._videoTransceiver, extraInfo).then(function() {
7114
+ Promise.all([getTransportInfo(this._videoTransceiver, extraInfo), getAudioCodecInfo(this._audioTransceiver, extraInfo)]).catch(function(e) {
7115
+ extraInfo.failure_reason = e.message;
7116
+ }).finally(function() {
7047
7117
  _this5._emitFirstFrameState(state, extraInfo);
7048
7118
  });
7049
7119
  }
@@ -7062,6 +7132,7 @@ var FirstFrameObserver = /* @__PURE__ */ function() {
7062
7132
  this._pc = null;
7063
7133
  this._video = null;
7064
7134
  this._videoTransceiver = null;
7135
+ this._audioTransceiver = null;
7065
7136
  }
7066
7137
  }]);
7067
7138
  return FirstFrameObserver2;
@@ -7069,7 +7140,7 @@ var FirstFrameObserver = /* @__PURE__ */ function() {
7069
7140
  var getTransportInfo = /* @__PURE__ */ function() {
7070
7141
  var _ref4 = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee2(videoTransceiver, extraInfo) {
7071
7142
  var _videoTransceiver$rec;
7072
- var reports, candidatePairStats, localCandidateStats, remoteCandidateStats;
7143
+ var reports, candidatePairStats, localCandidateStats, remoteCandidateStats, inboundRtpStats, codecStats, _inboundRtpStats4;
7073
7144
  return _regeneratorRuntime$1().wrap(function _callee2$(_context2) {
7074
7145
  while (1)
7075
7146
  switch (_context2.prev = _context2.next) {
@@ -7084,6 +7155,9 @@ var getTransportInfo = /* @__PURE__ */ function() {
7084
7155
  candidatePairStats = report;
7085
7156
  localCandidateStats = reports.get(report.localCandidateId);
7086
7157
  remoteCandidateStats = reports.get(report.remoteCandidateId);
7158
+ } else if (report.type === "inbound-rtp") {
7159
+ inboundRtpStats = report;
7160
+ codecStats = reports.get(report.codecId);
7087
7161
  }
7088
7162
  });
7089
7163
  if (remoteCandidateStats) {
@@ -7104,7 +7178,20 @@ var getTransportInfo = /* @__PURE__ */ function() {
7104
7178
  extraInfo.stun_responses_sent = candidatePairStats.responsesSent;
7105
7179
  extraInfo.stun_responses_received = candidatePairStats.responsesReceived;
7106
7180
  }
7107
- case 7:
7181
+ if (codecStats) {
7182
+ extraInfo.video_codec = codecStats.mimeType;
7183
+ extraInfo.video_fmtp = codecStats.sdpFmtpLine;
7184
+ extraInfo.video_profile_level_id = extractProfileInfo(codecStats.sdpFmtpLine);
7185
+ }
7186
+ if (inboundRtpStats) {
7187
+ extraInfo.video_width = inboundRtpStats.frameWidth;
7188
+ extraInfo.video_height = inboundRtpStats.frameHeight;
7189
+ extraInfo.video_framerate = inboundRtpStats.framesPerSecond;
7190
+ extraInfo.video_decoder_name = inboundRtpStats.decoderImplementation;
7191
+ extraInfo.video_result = ((_inboundRtpStats4 = inboundRtpStats) === null || _inboundRtpStats4 === void 0 ? void 0 : _inboundRtpStats4.framesDecoded) > 0 ? true : false;
7192
+ }
7193
+ extraInfo.gpu_info = getGpuInfo().renderer;
7194
+ case 10:
7108
7195
  case "end":
7109
7196
  return _context2.stop();
7110
7197
  }
@@ -7114,6 +7201,43 @@ var getTransportInfo = /* @__PURE__ */ function() {
7114
7201
  return _ref4.apply(this, arguments);
7115
7202
  };
7116
7203
  }();
7204
+ var getAudioCodecInfo = /* @__PURE__ */ function() {
7205
+ var _ref5 = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee3(audioTransceiver, extraInfo) {
7206
+ var _audioTransceiver$rec;
7207
+ var reports, inboundRtpStats, codecStats, _inboundRtpStats5, _inboundRtpStats6, _inboundRtpStats7, _inboundRtpStats8, _inboundRtpStats9, _inboundRtpStats10;
7208
+ return _regeneratorRuntime$1().wrap(function _callee3$(_context3) {
7209
+ while (1)
7210
+ switch (_context3.prev = _context3.next) {
7211
+ case 0:
7212
+ _context3.next = 2;
7213
+ return audioTransceiver === null || audioTransceiver === void 0 ? void 0 : (_audioTransceiver$rec = audioTransceiver.receiver) === null || _audioTransceiver$rec === void 0 ? void 0 : _audioTransceiver$rec.getStats().catch(function() {
7214
+ });
7215
+ case 2:
7216
+ reports = _context3.sent;
7217
+ reports === null || reports === void 0 ? void 0 : reports.forEach(function(report) {
7218
+ if (report.type === "inbound-rtp") {
7219
+ inboundRtpStats = report;
7220
+ codecStats = reports.get(report.codecId);
7221
+ }
7222
+ });
7223
+ if (codecStats) {
7224
+ extraInfo.audio_codec = codecStats.mimeType;
7225
+ extraInfo.audio_fmtp = codecStats.sdpFmtpLine;
7226
+ }
7227
+ if (inboundRtpStats) {
7228
+ extraInfo.audio_packet_received = ((_inboundRtpStats5 = inboundRtpStats) === null || _inboundRtpStats5 === void 0 ? void 0 : _inboundRtpStats5.packetsReceived) > 0;
7229
+ 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;
7230
+ }
7231
+ case 6:
7232
+ case "end":
7233
+ return _context3.stop();
7234
+ }
7235
+ }, _callee3);
7236
+ }));
7237
+ return function getAudioCodecInfo2(_x3, _x4) {
7238
+ return _ref5.apply(this, arguments);
7239
+ };
7240
+ }();
7117
7241
  function changeNumberInRange(source, min, max, delta) {
7118
7242
  var target = source + delta;
7119
7243
  if (target > max) {
@@ -7394,13 +7518,13 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
7394
7518
  _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;
7395
7519
  avDiffTooMuchCount = 0;
7396
7520
  _this._setDelayTimer = setInterval(/* @__PURE__ */ _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee3() {
7397
- 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;
7521
+ 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;
7398
7522
  return _regeneratorRuntime$1().wrap(function _callee3$(_context3) {
7399
7523
  while (1)
7400
7524
  switch (_context3.prev = _context3.next) {
7401
7525
  case 0:
7402
7526
  _context3.prev = 0;
7403
- 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))) {
7527
+ 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))) {
7404
7528
  _context3.next = 5;
7405
7529
  break;
7406
7530
  }
@@ -7491,20 +7615,19 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
7491
7615
  }();
7492
7616
  _this._getDelay = function() {
7493
7617
  try {
7494
- var _this$_audioTransceic6;
7618
+ var _this$_audioTransceic7;
7495
7619
  var key = ["playoutDelayHint", "jitterBufferDelayHint", "jitterBufferTarget"].find(function(key2) {
7496
- var _this$_videoTransceic4, _this$_audioTransceic5;
7497
- return key2 in (((_this$_videoTransceic4 = _this._videoTransceicer) === null || _this$_videoTransceic4 === void 0 ? void 0 : _this$_videoTransceic4.receiver) || {}) && key2 in (((_this$_audioTransceic5 = _this._audioTransceicer) === null || _this$_audioTransceic5 === void 0 ? void 0 : _this$_audioTransceic5.receiver) || {});
7620
+ var _this$_videoTransceic5, _this$_audioTransceic6;
7621
+ 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) || {});
7498
7622
  });
7499
7623
  if (!key)
7500
7624
  return;
7501
- return (_this$_audioTransceic6 = _this._audioTransceicer) === null || _this$_audioTransceic6 === void 0 ? void 0 : _this$_audioTransceic6.receiver[key];
7625
+ return (_this$_audioTransceic7 = _this._audioTransceicer) === null || _this$_audioTransceic7 === void 0 ? void 0 : _this$_audioTransceic7.receiver[key];
7502
7626
  } catch (error) {
7503
7627
  logger.error("get delay error");
7504
7628
  }
7505
7629
  };
7506
7630
  _this._onLoaderRetry = function(error, retryTime) {
7507
- console.log(error, "retryTime", retryTime);
7508
7631
  _this.emit(EVENT.LOAD_RETRY, {
7509
7632
  error: StreamingError.network(error),
7510
7633
  retryTime
@@ -7596,7 +7719,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
7596
7719
  value: function() {
7597
7720
  var _load = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee6(url, failureReason) {
7598
7721
  var _this2 = this;
7599
- var lastPc, answerSdp, errorStr, preloadPromise, info, encodedTransformSupported;
7722
+ var lastPc, pc, answerSdp, errorStr, preloadPromise, info, encodedTransformSupported;
7600
7723
  return _regeneratorRuntime$1().wrap(function _callee6$(_context6) {
7601
7724
  while (1)
7602
7725
  switch (_context6.prev = _context6.next) {
@@ -7604,44 +7727,47 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
7604
7727
  logger.log("load()", 'invoked, url: "'.concat(url, '"'));
7605
7728
  this._disconnect(failureReason || "invoke load");
7606
7729
  this._url = url;
7730
+ this._retry = this._opts.retryCount || 0;
7607
7731
  lastPc = this._pc;
7732
+ pc = null;
7608
7733
  if (!this._opts.hackCreateOfferIssue) {
7609
- _context6.next = 7;
7734
+ _context6.next = 9;
7610
7735
  break;
7611
7736
  }
7612
- _context6.next = 7;
7737
+ _context6.next = 9;
7613
7738
  return this._createEmptyPeer();
7614
- case 7:
7615
- _context6.prev = 7;
7739
+ case 9:
7740
+ _context6.prev = 9;
7616
7741
  this._firstFrameObserver.start();
7617
7742
  if (!this._preloadPromise) {
7618
- _context6.next = 38;
7743
+ _context6.next = 41;
7619
7744
  break;
7620
7745
  }
7621
7746
  logger.log("load()", "in preload process...");
7622
- _context6.prev = 11;
7747
+ _context6.prev = 13;
7623
7748
  this._firstFrameObserver.setIsPreload(true);
7624
7749
  if (compareURL(this._url, this._preloadPromise.url, ["tabr_start_bitrate"])) {
7625
- _context6.next = 17;
7750
+ _context6.next = 19;
7626
7751
  break;
7627
7752
  }
7628
7753
  errorStr = "preload url not match, current url: ".concat(this._url, ", preload url: ").concat(this._preloadPromise.url);
7629
7754
  delete this._preloadPromise;
7630
7755
  throw new Error(errorStr);
7631
- case 17:
7756
+ case 19:
7757
+ this._loader && (this._loader.finnalUrl = this._preloadPromise.url);
7632
7758
  preloadPromise = this._preloadPromise.promise;
7633
7759
  delete this._preloadPromise;
7634
- _context6.next = 21;
7760
+ _context6.next = 24;
7635
7761
  return preloadPromise;
7636
- case 21:
7762
+ case 24:
7637
7763
  info = _context6.sent;
7638
7764
  if (!(info.pc.signalingState !== "have-local-offer")) {
7639
- _context6.next = 24;
7765
+ _context6.next = 27;
7640
7766
  break;
7641
7767
  }
7642
7768
  throw new Error('pc.signalingState not equal "have-local-offer", current state is '.concat(info.pc.signalingState));
7643
- case 24:
7644
- this._pc = info.pc;
7769
+ case 27:
7770
+ pc = info.pc;
7645
7771
  answerSdp = info.answerSdp;
7646
7772
  this._videoTransceicer = info.videoTransceiver;
7647
7773
  this._audioTransceicer = info.audioTransceiver;
@@ -7649,48 +7775,49 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
7649
7775
  this.initVideoEncodedTransform();
7650
7776
  this.initAudioEncodedTransform();
7651
7777
  }
7652
- _context6.next = 36;
7778
+ _context6.next = 39;
7653
7779
  break;
7654
- case 31:
7655
- _context6.prev = 31;
7656
- _context6.t0 = _context6["catch"](11);
7780
+ case 34:
7781
+ _context6.prev = 34;
7782
+ _context6.t0 = _context6["catch"](13);
7657
7783
  logger.warn("load()", "preload failed, ".concat(_context6.t0.message || _context6.t0.toString()));
7658
7784
  this.load(url, _context6.t0.message || _context6.t0.toString());
7659
7785
  return _context6.abrupt("return");
7660
- case 36:
7661
- _context6.next = 44;
7786
+ case 39:
7787
+ _context6.next = 47;
7662
7788
  break;
7663
- case 38:
7789
+ case 41:
7664
7790
  encodedTransformSupported = isLegacyEncodedTransformSupported();
7665
7791
  logger.log("load()", "isLegacyEncodedTransformSupported: ".concat(encodedTransformSupported));
7666
- this._pc = new RTCPeerConnection({
7792
+ pc = new RTCPeerConnection({
7667
7793
  encodedInsertableStreams: encodedTransformSupported && this._opts.enableSei ? true : void 0
7668
7794
  });
7669
- _context6.next = 43;
7670
- return this._getAnswerSdp(this._pc);
7671
- case 43:
7795
+ _context6.next = 46;
7796
+ return this._getAnswerSdp(pc);
7797
+ case 46:
7672
7798
  answerSdp = _context6.sent;
7673
- case 44:
7674
- this._bindRTCEvents(this._pc);
7675
- _context6.next = 47;
7676
- return this._handleAnswerSdp(this._pc, answerSdp);
7677
7799
  case 47:
7800
+ this._bindRTCEvents(pc);
7801
+ _context6.next = 50;
7802
+ return this._handleAnswerSdp(pc, answerSdp);
7803
+ case 50:
7678
7804
  if (lastPc) {
7679
7805
  lastPc.close();
7680
7806
  }
7681
- _context6.next = 53;
7807
+ this._pc = pc;
7808
+ _context6.next = 57;
7682
7809
  break;
7683
- case 50:
7684
- _context6.prev = 50;
7685
- _context6.t1 = _context6["catch"](7);
7810
+ case 54:
7811
+ _context6.prev = 54;
7812
+ _context6.t1 = _context6["catch"](9);
7686
7813
  setTimeout(function() {
7687
7814
  return _this2._emitError(StreamingError.create(ERR.OTHER, null, _context6.t1));
7688
7815
  });
7689
- case 53:
7816
+ case 57:
7690
7817
  case "end":
7691
7818
  return _context6.stop();
7692
7819
  }
7693
- }, _callee6, this, [[7, 50], [11, 31]]);
7820
+ }, _callee6, this, [[9, 54], [13, 34]]);
7694
7821
  }));
7695
7822
  function load(_x2, _x3) {
7696
7823
  return _load.apply(this, arguments);
@@ -7833,6 +7960,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
7833
7960
  key: "_getAnswerSdp",
7834
7961
  value: function() {
7835
7962
  var _getAnswerSdp2 = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee7(pc) {
7963
+ var _this6 = this, _this$_opts$standardi;
7836
7964
  var offer, answerSdp, parsed, finnalUrl, _this$_opts, _this$_loader, _this$_opts2, _parsed$media, parseSession, sessionId, reqStart, res, answer, err;
7837
7965
  return _regeneratorRuntime$1().wrap(function _callee7$(_context7) {
7838
7966
  while (1)
@@ -7884,31 +8012,38 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
7884
8012
  parsed.media.filter(function(x) {
7885
8013
  return x.type === "audio";
7886
8014
  }).forEach(function(x) {
7887
- var _x$rtp$filter$, _x$rtcpFb;
8015
+ var _x$rtp$filter$, _this6$_opts$standard, _this6$_opts$standard2;
7888
8016
  var opusPayload = (_x$rtp$filter$ = x.rtp.filter(function(rtp) {
7889
8017
  return rtp.codec === "opus";
7890
8018
  })[0]) === null || _x$rtp$filter$ === void 0 ? void 0 : _x$rtp$filter$.payload;
7891
8019
  if (!opusPayload)
7892
8020
  return;
7893
- x.fmtp.forEach(function(fmtp) {
7894
- if (fmtp.payload !== opusPayload)
7895
- return;
7896
- fmtp.config = "minptime=10;stereo=1;useinbandfec=1";
7897
- });
7898
- (_x$rtcpFb = x.rtcpFb) === null || _x$rtcpFb === void 0 ? void 0 : _x$rtcpFb.push({
7899
- payload: opusPayload,
7900
- type: "nack"
7901
- });
8021
+ if ((_this6$_opts$standard = _this6._opts.standardizeKillSwitch) !== null && _this6$_opts$standard !== void 0 && _this6$_opts$standard.sld_fmtp_opus) {
8022
+ x.fmtp.forEach(function(fmtp) {
8023
+ if (fmtp.payload !== opusPayload)
8024
+ return;
8025
+ fmtp.config = "minptime=10;stereo=1;useinbandfec=1";
8026
+ });
8027
+ }
8028
+ if ((_this6$_opts$standard2 = _this6._opts.standardizeKillSwitch) !== null && _this6$_opts$standard2 !== void 0 && _this6$_opts$standard2.sld_rtcpfb_opus_nack) {
8029
+ var _x$rtcpFb;
8030
+ (_x$rtcpFb = x.rtcpFb) === null || _x$rtcpFb === void 0 ? void 0 : _x$rtcpFb.push({
8031
+ payload: opusPayload,
8032
+ type: "nack"
8033
+ });
8034
+ }
7902
8035
  });
7903
- parsed.media.filter(function(x) {
7904
- return x.type === "video";
7905
- }).forEach(function(x) {
7906
- x.fmtp.forEach(function(x2) {
7907
- if (x2.config.indexOf("profile-level-id") !== -1) {
7908
- x2.config = "".concat(x2.config, ";sps-pps-idr-in-keyframe=1");
7909
- }
8036
+ if ((_this$_opts$standardi = this._opts.standardizeKillSwitch) !== null && _this$_opts$standardi !== void 0 && _this$_opts$standardi.sld_fmtp_sps_pps) {
8037
+ parsed.media.filter(function(x) {
8038
+ return x.type === "video";
8039
+ }).forEach(function(x) {
8040
+ x.fmtp.forEach(function(x2) {
8041
+ if (x2.config.indexOf("profile-level-id") !== -1) {
8042
+ x2.config = "".concat(x2.config, ";sps-pps-idr-in-keyframe=1");
8043
+ }
8044
+ });
7910
8045
  });
7911
- });
8046
+ }
7912
8047
  offer.sdp = lib.write(parsed);
7913
8048
  logger.log("local offer modified:\n", offer);
7914
8049
  _context7.next = 25;
@@ -8043,7 +8178,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
8043
8178
  this._firstFrameObserver.changeFirstFrameState(RTC_FIRST_FRAME_STATE.ANSWER_SDP_READY);
8044
8179
  this._networkEvaluate = new NetworkEvaluate(pc, this._opts.networkEvaluateInterval);
8045
8180
  this._listenPeerStateTimeout();
8046
- this._firstFrameObserver.bindEvents(pc, this._videoTransceicer, this._media);
8181
+ this._firstFrameObserver.bindEvents(pc, this._videoTransceicer, this._audioTransceicer, this._media);
8047
8182
  case 17:
8048
8183
  case "end":
8049
8184
  return _context8.stop();
@@ -8058,11 +8193,11 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
8058
8193
  }, {
8059
8194
  key: "_listenPeerStateTimeout",
8060
8195
  value: function _listenPeerStateTimeout() {
8061
- var _this6 = this;
8196
+ var _this7 = this;
8062
8197
  this._clearPeerStateTimeout();
8063
8198
  if (this._opts.connectionStateChangeTimeout) {
8064
8199
  this._peerStateTimer = setTimeout(function() {
8065
- _this6._emitError(StreamingError.create(ERR.MEDIA, ERR.SUB_TYPES.MEDIA_ERR_SRC_NOT_SUPPORTED, {
8200
+ _this7._emitError(StreamingError.create(ERR.MEDIA, ERR.SUB_TYPES.MEDIA_ERR_SRC_NOT_SUPPORTED, {
8066
8201
  message: "listen connectionstatechange timeout"
8067
8202
  }));
8068
8203
  }, this._opts.connectionStateChangeTimeout);
@@ -8079,59 +8214,59 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
8079
8214
  }, {
8080
8215
  key: "_startRtcReport",
8081
8216
  value: function _startRtcReport() {
8082
- var _this7 = this;
8217
+ var _this8 = this;
8083
8218
  this._stopRtcReport();
8084
8219
  var report = /* @__PURE__ */ function() {
8085
8220
  var _ref5 = _asyncToGenerator$1(/* @__PURE__ */ _regeneratorRuntime$1().mark(function _callee9() {
8086
- var _this7$_audioTranscei, _this7$_videoTranscei;
8087
- var _this7$_frameRecvCall, _yield$Promise$all3, _yield$Promise$all4, curAudioStats, curVideoStats, _this7$_audioStallObs, _this7$_videoStallObs, _this7$_networkQualit, _this7$_networkQualit2, _this7$_media, _this7$_media2, _this7$_media3, _this7$_media4, _this7$_media5, _this7$_media6, _this7$_frameRecvCall2, audioStats, videoStats, audioStallInfo, videoStallInfo, _ref6, _ref7, quality, qualityInfo, av_sync_diff;
8221
+ var _this8$_audioTranscei, _this8$_audioTranscei2, _this8$_videoTranscei, _this8$_videoTranscei2;
8222
+ 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;
8088
8223
  return _regeneratorRuntime$1().wrap(function _callee9$(_context9) {
8089
8224
  while (1)
8090
8225
  switch (_context9.prev = _context9.next) {
8091
8226
  case 0:
8092
- if (!(!((_this7$_audioTranscei = _this7._audioTransceicer) !== null && _this7$_audioTranscei !== void 0 && _this7$_audioTranscei.receiver) || !((_this7$_videoTranscei = _this7._videoTransceicer) !== null && _this7$_videoTranscei !== void 0 && _this7$_videoTranscei.receiver))) {
8227
+ 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))) {
8093
8228
  _context9.next = 4;
8094
8229
  break;
8095
8230
  }
8096
- _this7._preAudioStats = null;
8097
- _this7._preVideoStats = null;
8231
+ _this8._preAudioStats = null;
8232
+ _this8._preVideoStats = null;
8098
8233
  return _context9.abrupt("return");
8099
8234
  case 4:
8100
- if (!_this7._audioStallObserver && _this7._audioTransceicer) {
8101
- _this7._audioStallObserver = new AudioStallObserver();
8102
- _this7._audioStallObserver.start(_this7._audioTransceicer);
8235
+ if (!_this8._audioStallObserver && _this8._audioTransceicer) {
8236
+ _this8._audioStallObserver = new AudioStallObserver();
8237
+ _this8._audioStallObserver.start(_this8._audioTransceicer);
8103
8238
  }
8104
- if (!_this7._videoStallObserver && _this7._video && _this7._media) {
8105
- _this7._videoStallObserver = new VideoStallObserver();
8106
- _this7._videoStallObserver.start(_this7._media);
8239
+ if (!_this8._videoStallObserver && _this8._video && _this8._media) {
8240
+ _this8._videoStallObserver = new VideoStallObserver();
8241
+ _this8._videoStallObserver.start(_this8._media);
8107
8242
  }
8108
- if (!_this7._frameRecvCallback && _this7._media) {
8109
- _this7._frameRecvCallback = new VideoFrameRecvCallback();
8110
- (_this7$_frameRecvCall = _this7._frameRecvCallback) === null || _this7$_frameRecvCall === void 0 ? void 0 : _this7$_frameRecvCall.start(_this7._media);
8243
+ if (!_this8._frameRecvCallback && _this8._media) {
8244
+ _this8._frameRecvCallback = new VideoFrameRecvCallback();
8245
+ (_this8$_frameRecvCall = _this8._frameRecvCallback) === null || _this8$_frameRecvCall === void 0 ? void 0 : _this8$_frameRecvCall.start(_this8._media);
8111
8246
  }
8112
- if (_this7._pc && !_this7._networkQuality && _this7._opts.enableNetworkQuality && _this7._opts.networkQuality) {
8113
- _this7._networkQuality = new NetworkQuality(_this7._pc, _this7._opts.networkQuality);
8247
+ if (_this8._pc && !_this8._networkQuality && _this8._opts.enableNetworkQuality && _this8._opts.networkQuality) {
8248
+ _this8._networkQuality = new NetworkQuality(_this8._pc, _this8._opts.networkQuality);
8114
8249
  }
8115
8250
  _context9.next = 10;
8116
- return Promise.all([getRecvAudioStats(_this7._audioTransceicer.receiver.getStats()), getRecvVideoStats(_this7._videoTransceicer.receiver.getStats())]);
8251
+ return Promise.all([getRecvAudioStats(_this8._audioTransceicer.receiver.getStats()), getRecvVideoStats(_this8._videoTransceicer.receiver.getStats())]);
8117
8252
  case 10:
8118
8253
  _yield$Promise$all3 = _context9.sent;
8119
8254
  _yield$Promise$all4 = _slicedToArray(_yield$Promise$all3, 2);
8120
8255
  curAudioStats = _yield$Promise$all4[0];
8121
8256
  curVideoStats = _yield$Promise$all4[1];
8122
- if (!(_this7._preAudioStats && _this7._preVideoStats)) {
8257
+ if (!(_this8._preAudioStats && _this8._preVideoStats)) {
8123
8258
  _context9.next = 28;
8124
8259
  break;
8125
8260
  }
8126
- audioStats = diffRecvAudioStats(_this7._preAudioStats, curAudioStats);
8127
- videoStats = diffRecvVideoStats(_this7._preVideoStats, curVideoStats);
8128
- _this7._videoJitterBufferDelay = videoStats.jitterBufferDelay;
8261
+ audioStats = diffRecvAudioStats(_this8._preAudioStats, curAudioStats);
8262
+ videoStats = diffRecvVideoStats(_this8._preVideoStats, curVideoStats);
8263
+ _this8._videoJitterBufferDelay = videoStats.jitterBufferDelay;
8129
8264
  _context9.next = 20;
8130
- return (_this7$_audioStallObs = _this7._audioStallObserver) === null || _this7$_audioStallObs === void 0 ? void 0 : _this7$_audioStallObs.getAudioStallInfo();
8265
+ return (_this8$_audioStallObs = _this8._audioStallObserver) === null || _this8$_audioStallObs === void 0 ? void 0 : _this8$_audioStallObs.getAudioStallInfo();
8131
8266
  case 20:
8132
8267
  audioStallInfo = _context9.sent;
8133
8268
  _context9.next = 23;
8134
- return (_this7$_videoStallObs = _this7._videoStallObserver) === null || _this7$_videoStallObs === void 0 ? void 0 : _this7$_videoStallObs.getStallInfo({
8269
+ return (_this8$_videoStallObs = _this8._videoStallObserver) === null || _this8$_videoStallObs === void 0 ? void 0 : _this8$_videoStallObs.getStallInfo({
8135
8270
  interval: videoStats.statsInterval,
8136
8271
  frameRateReceived: videoStats.receivedFrameRate,
8137
8272
  frameRateDecoded: videoStats.decoderOutputFrameRate,
@@ -8139,18 +8274,18 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
8139
8274
  });
8140
8275
  case 23:
8141
8276
  videoStallInfo = _context9.sent;
8142
- _ref6 = (_this7$_networkQualit = (_this7$_networkQualit2 = _this7._networkQuality) === null || _this7$_networkQualit2 === void 0 ? void 0 : _this7$_networkQualit2.getDownlinkQuality(_objectSpread2$2(_objectSpread2$2({}, audioStats), {}, {
8277
+ _ref6 = (_this8$_networkQualit = (_this8$_networkQualit2 = _this8._networkQuality) === null || _this8$_networkQualit2 === void 0 ? void 0 : _this8$_networkQualit2.getDownlinkQuality(_objectSpread2$2(_objectSpread2$2({}, audioStats), {}, {
8143
8278
  stallDuration: (audioStallInfo === null || audioStallInfo === void 0 ? void 0 : audioStallInfo.stallDuration) || 0
8144
8279
  }), _objectSpread2$2(_objectSpread2$2({}, videoStats), {}, {
8145
8280
  stallDuration: (videoStallInfo === null || videoStallInfo === void 0 ? void 0 : videoStallInfo.stall.stallDuration100ms) || (videoStallInfo === null || videoStallInfo === void 0 ? void 0 : videoStallInfo.stall.stallDuration500ms) || 0
8146
- }))) !== null && _this7$_networkQualit !== void 0 ? _this7$_networkQualit : [], _ref7 = _slicedToArray(_ref6, 2), quality = _ref7[0], qualityInfo = _ref7[1];
8147
- if (_this7._opts.enableAdaptiveJitterBuffer) {
8148
- _this7._handleJitterBuffer(qualityInfo === null || qualityInfo === void 0 ? void 0 : qualityInfo.qualityQos, _this7._opts.adaptiveJitterBuffer, _this7._opts.networkStrategy);
8281
+ }))) !== null && _this8$_networkQualit !== void 0 ? _this8$_networkQualit : [], _ref7 = _slicedToArray(_ref6, 2), quality = _ref7[0], qualityInfo = _ref7[1];
8282
+ if (_this8._opts.enableAdaptiveJitterBuffer) {
8283
+ _this8._handleJitterBuffer(qualityInfo === null || qualityInfo === void 0 ? void 0 : qualityInfo.qualityQos, _this8._opts.adaptiveJitterBuffer, _this8._opts.networkStrategy);
8149
8284
  }
8150
8285
  if (videoStats.estimatedPlayoutTimestamp && audioStats.estimatedPlayoutTimestamp) {
8151
8286
  av_sync_diff = videoStats.estimatedPlayoutTimestamp - audioStats.estimatedPlayoutTimestamp;
8152
8287
  }
8153
- _this7.emit(EXTEND_EVENTS.RTC_NETWORK, _objectSpread2$2({
8288
+ _this8.emit(EXTEND_EVENTS.RTC_NETWORK, _objectSpread2$2({
8154
8289
  interval: videoStats.statsInterval,
8155
8290
  network_quality: quality,
8156
8291
  audio_stall_duration: audioStallInfo === null || audioStallInfo === void 0 ? void 0 : audioStallInfo.stallDuration,
@@ -8176,13 +8311,13 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
8176
8311
  quality_qos: qualityInfo === null || qualityInfo === void 0 ? void 0 : qualityInfo.qualityQos,
8177
8312
  quality_audio_qoe: qualityInfo === null || qualityInfo === void 0 ? void 0 : qualityInfo.audioQoe,
8178
8313
  quality_video_qoe: qualityInfo === null || qualityInfo === void 0 ? void 0 : qualityInfo.videoQoe,
8179
- current_delay: _this7._getDelay(),
8314
+ current_delay: _this8._getDelay(),
8180
8315
  visibility_state: document.visibilityState,
8181
- target_delay: _this7._targetDelayHint,
8316
+ target_delay: _this8._targetDelayHint,
8182
8317
  av_sync_diff,
8183
- set_delay_error: _this7._setDelayError || null,
8184
- video_width: ((_this7$_media = _this7._media) === null || _this7$_media === void 0 ? void 0 : _this7$_media.videoWidth) || 0,
8185
- video_height: ((_this7$_media2 = _this7._media) === null || _this7$_media2 === void 0 ? void 0 : _this7$_media2.videoHeight) || 0,
8318
+ set_delay_error: _this8._setDelayError || null,
8319
+ video_width: ((_this8$_media = _this8._media) === null || _this8$_media === void 0 ? void 0 : _this8$_media.videoWidth) || 0,
8320
+ video_height: ((_this8$_media2 = _this8._media) === null || _this8$_media2 === void 0 ? void 0 : _this8$_media2.videoHeight) || 0,
8186
8321
  abr_state: videoStats.abrState || "none",
8187
8322
  recv_frame_rate: videoStats.receivedFrameRate,
8188
8323
  decode_frame_rate: videoStats.decoderOutputFrameRate,
@@ -8190,15 +8325,19 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
8190
8325
  drop_frame_rate: videoStats.framesDropped,
8191
8326
  audio_packets_received: audioStats.packetsReceived,
8192
8327
  video_packets_received: videoStats.packetsReceived,
8193
- video_muted: (_this7$_media3 = _this7._media) === null || _this7$_media3 === void 0 ? void 0 : _this7$_media3.muted,
8194
- video_paused: (_this7$_media4 = _this7._media) === null || _this7$_media4 === void 0 ? void 0 : _this7$_media4.paused,
8195
- video_volume: (_this7$_media5 = _this7._media) === null || _this7$_media5 === void 0 ? void 0 : _this7$_media5.volume,
8196
- video_current_time: (_this7$_media6 = _this7._media) === null || _this7$_media6 === void 0 ? void 0 : _this7$_media6.currentTime
8197
- }, ((_this7$_frameRecvCall2 = _this7._frameRecvCallback) === null || _this7$_frameRecvCall2 === void 0 ? void 0 : _this7$_frameRecvCall2.getRecentRenderInfo4Report()) || {}));
8328
+ video_muted: (_this8$_media3 = _this8._media) === null || _this8$_media3 === void 0 ? void 0 : _this8$_media3.muted,
8329
+ video_paused: (_this8$_media4 = _this8._media) === null || _this8$_media4 === void 0 ? void 0 : _this8$_media4.paused,
8330
+ video_volume: (_this8$_media5 = _this8._media) === null || _this8$_media5 === void 0 ? void 0 : _this8$_media5.volume,
8331
+ video_current_time: (_this8$_media6 = _this8._media) === null || _this8$_media6 === void 0 ? void 0 : _this8$_media6.currentTime,
8332
+ fec_packets_received: videoStats.fecPacketsReceived,
8333
+ video_kbps: videoStats.receivedKBitrate,
8334
+ audio_kbps: audioStats.receivedKBitrate,
8335
+ fec_ssrc: videoStats.fecSsrc
8336
+ }, ((_this8$_frameRecvCall2 = _this8._frameRecvCallback) === null || _this8$_frameRecvCall2 === void 0 ? void 0 : _this8$_frameRecvCall2.getRecentRenderInfo4Report()) || {}));
8198
8337
  case 28:
8199
- _this7._preAudioStats = curAudioStats;
8200
- _this7._preVideoStats = curVideoStats;
8201
- _this7._setDelayError = null;
8338
+ _this8._preAudioStats = curAudioStats;
8339
+ _this8._preVideoStats = curVideoStats;
8340
+ _this8._setDelayError = null;
8202
8341
  case 31:
8203
8342
  case "end":
8204
8343
  return _context9.stop();
@@ -8353,7 +8492,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
8353
8492
  }, {
8354
8493
  key: "_changeVolumeInHarmonyWorkaround",
8355
8494
  value: function _changeVolumeInHarmonyWorkaround() {
8356
- var _this8 = this;
8495
+ var _this9 = this;
8357
8496
  if (isHarmonyOS()) {
8358
8497
  var originalDescriptor = Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, "muted");
8359
8498
  if (this._media && originalDescriptor) {
@@ -8372,9 +8511,9 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
8372
8511
  }
8373
8512
  });
8374
8513
  this._revertVolumeWorkaround = function() {
8375
- logger.log("revert HarmonyOS muted workaround. video dom:", _this8._media);
8376
- if (_this8._media) {
8377
- Object.defineProperty(_this8._media, "muted", originalDescriptor);
8514
+ logger.log("revert HarmonyOS muted workaround. video dom:", _this9._media);
8515
+ if (_this9._media) {
8516
+ Object.defineProperty(_this9._media, "muted", originalDescriptor);
8378
8517
  }
8379
8518
  };
8380
8519
  }
@@ -8383,7 +8522,7 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
8383
8522
  }, {
8384
8523
  key: "_mutedBeforePlayingWorkaround",
8385
8524
  value: function _mutedBeforePlayingWorkaround() {
8386
- var _this9 = this;
8525
+ var _this10 = this;
8387
8526
  if (isHeyTapBrowser() || isVivoBrowser()) {
8388
8527
  var originalDescriptor = Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, "muted");
8389
8528
  if (this._media && originalDescriptor) {
@@ -8403,10 +8542,10 @@ var Rts = /* @__PURE__ */ function(_EventEmitter) {
8403
8542
  });
8404
8543
  var revertMutedProxy = function revertMutedProxy2() {
8405
8544
  logger.log("revert muted workaround. muted:", originalMuted);
8406
- if (_this9._media) {
8407
- Object.defineProperty(_this9._media, "muted", originalDescriptor);
8408
- _this9._media.muted = originalMuted;
8409
- _this9._media.removeEventListener("playing", revertMutedProxy2);
8545
+ if (_this10._media) {
8546
+ Object.defineProperty(_this10._media, "muted", originalDescriptor);
8547
+ _this10._media.muted = originalMuted;
8548
+ _this10._media.removeEventListener("playing", revertMutedProxy2);
8410
8549
  }
8411
8550
  };
8412
8551
  this._media.addEventListener("playing", revertMutedProxy);
@@ -8516,10 +8655,11 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
8516
8655
  _this.__retry = function() {
8517
8656
  _this.player.removeClass(STATE_CLASS.ERROR);
8518
8657
  _this.player.addClass(STATE_CLASS.LOADING);
8519
- runHooks(_assertThisInitialized$1(_this), "retry", function() {
8658
+ _this.player.runHooks(_assertThisInitialized$1(_this), "retry", function() {
8520
8659
  _this.player.src = "";
8521
8660
  _this.player.once(CANPLAY, function() {
8522
- _this.player.mediaPlay();
8661
+ var _assertThisInitialize, _assertThisInitialize2;
8662
+ (_assertThisInitialize = _assertThisInitialized$1(_this)) === null || _assertThisInitialize === void 0 ? void 0 : (_assertThisInitialize2 = _assertThisInitialize.player) === null || _assertThisInitialize2 === void 0 ? void 0 : _assertThisInitialize2.mediaPlay();
8523
8663
  });
8524
8664
  });
8525
8665
  };
@@ -8571,7 +8711,7 @@ var RtsPlugin = /* @__PURE__ */ function(_BasePlugin) {
8571
8711
  }, {
8572
8712
  key: "version",
8573
8713
  get: function get() {
8574
- return "0.2.1-alpha.57";
8714
+ return "0.2.1-alpha.61";
8575
8715
  }
8576
8716
  }, {
8577
8717
  key: "beforePlayerInit",