@bigbinary/neeto-media-recorder 2.7.39 → 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.
Files changed (3) hide show
  1. package/core.js +21 -11
  2. package/core.js.map +1 -1
  3. package/package.json +1 -1
package/core.js CHANGED
@@ -2090,6 +2090,14 @@ var ScreenRecorder = /*#__PURE__*/function () {
2090
2090
  if (_classPrivateFieldGet(_this, _showCountdown)) {
2091
2091
  _classPrivateFieldGet(_this, _startCountdown).call(_this);
2092
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
+ });
2093
2101
  _classPrivateFieldGet(_this, _startMediaRecorder).call(_this);
2094
2102
  }
2095
2103
  case 31:
@@ -2683,8 +2691,9 @@ var ScreenRecorder = /*#__PURE__*/function () {
2683
2691
  _classPrivateFieldInitSpec(this, _startMediaRecorder, {
2684
2692
  writable: true,
2685
2693
  value: function value() {
2694
+ var delayMs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
2686
2695
  _classPrivateFieldGet(_this, _logger).info("startMediaRecorder -> scheduled", _objectSpread({
2687
- delayMs: HALF_A_SECOND_IN_MILLISECONDS
2696
+ delayMs: delayMs
2688
2697
  }, _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this)));
2689
2698
  _classPrivateFieldSet(_this, _startRecordingTimeoutID, setTimeout(function () {
2690
2699
  try {
@@ -2740,7 +2749,7 @@ var ScreenRecorder = /*#__PURE__*/function () {
2740
2749
  _classPrivateFieldSet(_this, _mediaRecorder, null);
2741
2750
  throw error;
2742
2751
  }
2743
- }, HALF_A_SECOND_IN_MILLISECONDS));
2752
+ }, delayMs));
2744
2753
  }
2745
2754
  });
2746
2755
  _classPrivateFieldInitSpec(this, _startCountdown, {
@@ -2771,15 +2780,13 @@ var ScreenRecorder = /*#__PURE__*/function () {
2771
2780
  };
2772
2781
  }
2773
2782
  _classPrivateFieldGet(_this, _fireCallbacks).call(_this, SCREEN_RECORDER_EVENT.onCountdown, [0]);
2774
- setTimeout(function () {
2775
- _classPrivateFieldGet(_this, _logger).info("startCountdown -> end, starting recorder");
2776
- if (_classPrivateFieldGet(_this, _playCountdownAudio)) _classPrivateFieldGet(_this, _startRecordingAudio).play();
2777
- _classPrivateFieldGet(_this, _fireCallbacks).call(_this, SCREEN_RECORDER_EVENT.onCountdownEnd);
2778
- _classPrivateFieldGet(_this, _store).setState({
2779
- status: SCREEN_RECORDER_STATUS.recording
2780
- });
2781
- _classPrivateFieldGet(_this, _startMediaRecorder).call(_this);
2782
- }, 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);
2783
2790
  clearInterval(_classPrivateFieldGet(_this, _countdownTimerId));
2784
2791
  _classPrivateFieldSet(_this, _countdownTimerId, null);
2785
2792
  return {
@@ -2888,6 +2895,9 @@ var ScreenRecorder = /*#__PURE__*/function () {
2888
2895
  // The chime is suppressed (vs. natural completion which plays it) since the
2889
2896
  // user explicitly opted out of the count-in. Listeners hook onCountdownSkip
2890
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.
2891
2901
  }]);
2892
2902
  return ScreenRecorder;
2893
2903
  }();