@bigbinary/neeto-media-recorder 2.7.38 → 2.7.40

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/core.js CHANGED
@@ -760,12 +760,15 @@ var buildRetryableApi = function buildRetryableApi(apiConnector) {
760
760
  case 0:
761
761
  _apiConnectorArgs$con = apiConnectorArgs.config, config = _apiConnectorArgs$con === void 0 ? null : _apiConnectorArgs$con; // If the signal is already aborted before we start, addEventListener("abort")
762
762
  // will never fire — so we'd otherwise run the full retry/backoff schedule
763
- // against an aborted request.
763
+ // against an aborted request. Throw an axios CanceledError so callers'
764
+ // `axios.isCancel` checks treat this as cancellation instead of a real
765
+ // failure (e.g. completeUpload won't flip status to "error" while a
766
+ // parallel abortUpload is finishing).
764
767
  if (!(config !== null && config !== void 0 && (_config$signal = config.signal) !== null && _config$signal !== void 0 && _config$signal.aborted)) {
765
768
  _context.next = 3;
766
769
  break;
767
770
  }
768
- throw new RetryError("Request cancelled or request retries exhausted");
771
+ throw new axios.CanceledError("Request cancelled");
769
772
  case 3:
770
773
  remainingAttempts = retries + 1;
771
774
  shouldCancelRetries = false;
@@ -2087,6 +2090,14 @@ var ScreenRecorder = /*#__PURE__*/function () {
2087
2090
  if (_classPrivateFieldGet(_this, _showCountdown)) {
2088
2091
  _classPrivateFieldGet(_this, _startCountdown).call(_this);
2089
2092
  } else {
2093
+ // No countdown: emit the canonical "count-in finished" hook and flip to
2094
+ // recording so consumers (toolbar, options-page countdown) update, just
2095
+ // like the countdown and skipCountdown paths do.
2096
+ _classPrivateFieldGet(_this, _fireCallbacks).call(_this, SCREEN_RECORDER_EVENT.onCountdownEnd);
2097
+ _classPrivateFieldGet(_this, _store).setState({
2098
+ countdownTimeLeft: 0,
2099
+ status: SCREEN_RECORDER_STATUS.recording
2100
+ });
2090
2101
  _classPrivateFieldGet(_this, _startMediaRecorder).call(_this);
2091
2102
  }
2092
2103
  case 31:
@@ -2680,8 +2691,9 @@ var ScreenRecorder = /*#__PURE__*/function () {
2680
2691
  _classPrivateFieldInitSpec(this, _startMediaRecorder, {
2681
2692
  writable: true,
2682
2693
  value: function value() {
2694
+ var delayMs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
2683
2695
  _classPrivateFieldGet(_this, _logger).info("startMediaRecorder -> scheduled", _objectSpread({
2684
- delayMs: HALF_A_SECOND_IN_MILLISECONDS
2696
+ delayMs: delayMs
2685
2697
  }, _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this)));
2686
2698
  _classPrivateFieldSet(_this, _startRecordingTimeoutID, setTimeout(function () {
2687
2699
  try {
@@ -2737,7 +2749,7 @@ var ScreenRecorder = /*#__PURE__*/function () {
2737
2749
  _classPrivateFieldSet(_this, _mediaRecorder, null);
2738
2750
  throw error;
2739
2751
  }
2740
- }, HALF_A_SECOND_IN_MILLISECONDS));
2752
+ }, delayMs));
2741
2753
  }
2742
2754
  });
2743
2755
  _classPrivateFieldInitSpec(this, _startCountdown, {
@@ -2768,15 +2780,13 @@ var ScreenRecorder = /*#__PURE__*/function () {
2768
2780
  };
2769
2781
  }
2770
2782
  _classPrivateFieldGet(_this, _fireCallbacks).call(_this, SCREEN_RECORDER_EVENT.onCountdown, [0]);
2771
- setTimeout(function () {
2772
- _classPrivateFieldGet(_this, _logger).info("startCountdown -> end, starting recorder");
2773
- if (_classPrivateFieldGet(_this, _playCountdownAudio)) _classPrivateFieldGet(_this, _startRecordingAudio).play();
2774
- _classPrivateFieldGet(_this, _fireCallbacks).call(_this, SCREEN_RECORDER_EVENT.onCountdownEnd);
2775
- _classPrivateFieldGet(_this, _store).setState({
2776
- status: SCREEN_RECORDER_STATUS.recording
2777
- });
2778
- _classPrivateFieldGet(_this, _startMediaRecorder).call(_this);
2779
- }, ONE_SECOND_IN_MILLISECONDS);
2783
+ _classPrivateFieldGet(_this, _logger).info("startCountdown -> end, starting recorder");
2784
+ if (_classPrivateFieldGet(_this, _playCountdownAudio)) _classPrivateFieldGet(_this, _startRecordingAudio).play();
2785
+ _classPrivateFieldGet(_this, _fireCallbacks).call(_this, SCREEN_RECORDER_EVENT.onCountdownEnd);
2786
+ _classPrivateFieldGet(_this, _store).setState({
2787
+ status: SCREEN_RECORDER_STATUS.recording
2788
+ });
2789
+ _classPrivateFieldGet(_this, _startMediaRecorder).call(_this, _classPrivateFieldGet(_this, _playCountdownAudio) ? HALF_A_SECOND_IN_MILLISECONDS : 0);
2780
2790
  clearInterval(_classPrivateFieldGet(_this, _countdownTimerId));
2781
2791
  _classPrivateFieldSet(_this, _countdownTimerId, null);
2782
2792
  return {
@@ -2885,6 +2895,9 @@ var ScreenRecorder = /*#__PURE__*/function () {
2885
2895
  // The chime is suppressed (vs. natural completion which plays it) since the
2886
2896
  // user explicitly opted out of the count-in. Listeners hook onCountdownSkip
2887
2897
  // to clean up countdown-only side effects like scheduled beeps.
2898
+ // `delayMs` only exists to keep the start chime out of the recording; when no
2899
+ // chime plays (countdown skipped or disabled) we start immediately so the
2900
+ // recorder begins ticking without a perceptible gap.
2888
2901
  }]);
2889
2902
  return ScreenRecorder;
2890
2903
  }();