@bigbinary/neeto-media-recorder 2.5.1 → 2.5.3
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 +11 -5
- package/core.js.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
package/core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import { isPresent, existsBy, isNotEmpty, isNot } from '@bigbinary/neeto-cist';
|
|
2
|
+
import { isPresent, existsBy, isNotEmpty, isNot, noop } from '@bigbinary/neeto-cist';
|
|
3
3
|
import { MIME_TYPE as MIME_TYPE$1, RETRYABLE_ERRORS, UPLOAD_STATUS, UPLOAD_EVENT, SCREEN_RECORDER_STATUS, START_RECORDING_SOUND, RECORDING_LIMIT_REACHED_WARNING_SOUND, SCREEN_RECORDER_ERROR, SCREEN_RECORDER_EVENT, RECORDING_TIME_LIMIT_FREE_PLAN, ONE_SECOND, HALF_A_SECOND_IN_MILLISECONDS, ONE_SECOND_IN_MILLISECONDS, TWO_HUNDRED_MILLISECONDS, ONE_MINUTE_IN_MILLISECONDS, STOP_RECORDING_DUE_TO_LIMIT_REACHED_SOUND, IS_EXTENSION } from '@bigbinary/neeto-media-recorder/constants';
|
|
4
4
|
import { isNotNil, min, isNil, identity, isEmpty, pick, equals, not } from 'ramda';
|
|
5
5
|
import platform from 'platform';
|
|
@@ -827,7 +827,9 @@ function compareChromiumVersions(version1, version2) {
|
|
|
827
827
|
return 0;
|
|
828
828
|
}
|
|
829
829
|
var getSupportedMimeType = function getSupportedMimeType(fallback) {
|
|
830
|
-
|
|
830
|
+
var _platform$os, _platform$os$family;
|
|
831
|
+
var isWindows = (_platform$os = platform.os) === null || _platform$os === void 0 ? void 0 : (_platform$os$family = _platform$os.family) === null || _platform$os$family === void 0 ? void 0 : _platform$os$family.includes("Windows");
|
|
832
|
+
if (MediaRecorder.isTypeSupported(MIME_TYPE.mp4) && !isWindows) {
|
|
831
833
|
if (platform.name === "Safari") {
|
|
832
834
|
return MIME_TYPE.mp4;
|
|
833
835
|
}
|
|
@@ -1882,9 +1884,13 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
1882
1884
|
error: SCREEN_RECORDER_ERROR[error.name]
|
|
1883
1885
|
});
|
|
1884
1886
|
_classPrivateFieldGet(_this, _fireCallbacks).call(_this, SCREEN_RECORDER_EVENT.onError, [error]);
|
|
1885
|
-
|
|
1886
|
-
_classPrivateFieldGet(_this,
|
|
1887
|
-
|
|
1887
|
+
// To prevent triggering #onRecordingStop when the mediaRecorder is failed to start.
|
|
1888
|
+
_classPrivateFieldGet(_this, _mediaRecorder).onstop = noop;
|
|
1889
|
+
if (_classPrivateFieldGet(_this, _mediaStream)) {
|
|
1890
|
+
_classPrivateFieldGet(_this, _mediaStream).getVideoTracks()[0].stop();
|
|
1891
|
+
_classPrivateFieldGet(_this, _mediaStream).getAudioTracks()[0].stop();
|
|
1892
|
+
_classPrivateFieldSet(_this, _mediaStream, null);
|
|
1893
|
+
}
|
|
1888
1894
|
_classPrivateFieldSet(_this, _stream, null);
|
|
1889
1895
|
_classPrivateFieldSet(_this, _audioStream, null);
|
|
1890
1896
|
_classPrivateFieldSet(_this, _mediaRecorder, null);
|