@bigbinary/neeto-media-recorder 2.6.9 → 2.6.11

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/index.js CHANGED
@@ -578,41 +578,44 @@ var getRecorderTimeLimitInHumanFormat = function getRecorderTimeLimitInHumanForm
578
578
  var getDeviceInfo = /*#__PURE__*/function () {
579
579
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
580
580
  var _yield$chrome$storage, _platform$os;
581
- var isCameraEnabled;
581
+ var mimeType,
582
+ isCameraEnabled,
583
+ _args = arguments;
582
584
  return _regeneratorRuntime.wrap(function _callee$(_context) {
583
585
  while (1) switch (_context.prev = _context.next) {
584
586
  case 0:
587
+ mimeType = _args.length > 0 && _args[0] !== undefined ? _args[0] : getSupportedMimeType();
585
588
  if (!IS_EXTENSION$1) {
586
- _context.next = 15;
589
+ _context.next = 16;
587
590
  break;
588
591
  }
589
- _context.next = 3;
592
+ _context.next = 4;
590
593
  return chrome.storage.local.get("isCameraOn");
591
- case 3:
594
+ case 4:
592
595
  _context.t2 = _yield$chrome$storage = _context.sent;
593
596
  _context.t1 = _context.t2 === null;
594
597
  if (_context.t1) {
595
- _context.next = 7;
598
+ _context.next = 8;
596
599
  break;
597
600
  }
598
601
  _context.t1 = _yield$chrome$storage === void 0;
599
- case 7:
602
+ case 8:
600
603
  if (!_context.t1) {
601
- _context.next = 11;
604
+ _context.next = 12;
602
605
  break;
603
606
  }
604
607
  _context.t3 = void 0;
605
- _context.next = 12;
608
+ _context.next = 13;
606
609
  break;
607
- case 11:
608
- _context.t3 = _yield$chrome$storage.isCameraOn;
609
610
  case 12:
611
+ _context.t3 = _yield$chrome$storage.isCameraOn;
612
+ case 13:
610
613
  _context.t0 = _context.t3;
611
- _context.next = 16;
614
+ _context.next = 17;
612
615
  break;
613
- case 15:
614
- _context.t0 = false;
615
616
  case 16:
617
+ _context.t0 = false;
618
+ case 17:
616
619
  isCameraEnabled = _context.t0;
617
620
  return _context.abrupt("return", {
618
621
  os: (_platform$os = platform.os) === null || _platform$os === void 0 ? void 0 : _platform$os.toString(),
@@ -620,9 +623,10 @@ var getDeviceInfo = /*#__PURE__*/function () {
620
623
  browser: "".concat(platform.name, " v").concat(platform.version),
621
624
  isCameraEnabled: isCameraEnabled,
622
625
  isMicEnabled: !!screenRecorder.audioConfiguration,
623
- displaySurface: screenRecorder.displaySurface
626
+ displaySurface: screenRecorder.displaySurface,
627
+ mimeType: mimeType
624
628
  });
625
- case 18:
629
+ case 19:
626
630
  case "end":
627
631
  return _context.stop();
628
632
  }
@@ -633,7 +637,8 @@ var getDeviceInfo = /*#__PURE__*/function () {
633
637
  };
634
638
  }();
635
639
  var isMp4Supported = function isMp4Supported() {
636
- return getSupportedMimeType() === MIME_TYPE$1.mp4;
640
+ var mimeType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getSupportedMimeType();
641
+ return mimeType === MIME_TYPE$1.mp4;
637
642
  };
638
643
 
639
644
  var baseUrl = "/api/v1/recordings";
@@ -641,7 +646,7 @@ var create = function create(deviceInfo) {
641
646
  return axios.post(baseUrl, {
642
647
  recording: {
643
648
  deviceInfo: deviceInfo,
644
- isMp4: isMp4Supported()
649
+ isMp4: isMp4Supported(deviceInfo.mimeType)
645
650
  }
646
651
  });
647
652
  };
@@ -1038,6 +1043,9 @@ var UseDesktopAppCallout = function UseDesktopAppCallout() {
1038
1043
  style: "h4",
1039
1044
  children: /*#__PURE__*/jsx(Trans, {
1040
1045
  i18nKey: "neetoMediaRecorder.useDesktopAppCallOut",
1046
+ values: {
1047
+ appName: IS_EXTENSION$1 ? "chrome extension" : "web"
1048
+ },
1041
1049
  components: {
1042
1050
  Download: /*#__PURE__*/jsx(Button, {
1043
1051
  href: "https://neeto.com/neetorecord/download",
@@ -1281,7 +1289,9 @@ var MediaRecorder = function MediaRecorder(_ref, ref) {
1281
1289
  _ref$onDiscard = _ref.onDiscard,
1282
1290
  onDiscard = _ref$onDiscard === void 0 ? noop : _ref$onDiscard,
1283
1291
  _ref$appName = _ref.appName,
1284
- appName = _ref$appName === void 0 ? globalProps.appName : _ref$appName;
1292
+ appName = _ref$appName === void 0 ? globalProps.appName : _ref$appName,
1293
+ _ref$mimeType = _ref.mimeType,
1294
+ mimeType = _ref$mimeType === void 0 ? getSupportedMimeType() : _ref$mimeType;
1285
1295
  var _useTranslation = useTranslation(),
1286
1296
  t = _useTranslation.t;
1287
1297
  var _useState = useState(false),
@@ -1332,6 +1342,7 @@ var MediaRecorder = function MediaRecorder(_ref, ref) {
1332
1342
  uploadId = _ref2.uploadId;
1333
1343
  var multipartS3Uploader = getMultipartS3Uploader();
1334
1344
  multipartS3Uploader.setRecording(recording.id, uploadId);
1345
+ multipartS3Uploader.setMimeType(mimeType);
1335
1346
  var uploadStatus = multipartS3Uploader.status;
1336
1347
  var recorderStatus = useRecorderStore.getState().status;
1337
1348
  if (uploadStatus === UPLOAD_STATUS$1.uploading || isRetryUpload) {
@@ -1361,7 +1372,7 @@ var MediaRecorder = function MediaRecorder(_ref, ref) {
1361
1372
  while (1) switch (_context.prev = _context.next) {
1362
1373
  case 0:
1363
1374
  _context.next = 2;
1364
- return getDeviceInfo();
1375
+ return getDeviceInfo(mimeType);
1365
1376
  case 2:
1366
1377
  deviceInfo = _context.sent;
1367
1378
  createRecordingPromise.current = createRecording(deviceInfo);