@bigbinary/neeto-media-recorder 2.6.2 → 2.6.4

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
@@ -2,7 +2,7 @@ import { shallow } from 'zustand/shallow';
2
2
  import { useEffect, useState, forwardRef, useRef, useImperativeHandle } from 'react';
3
3
  import classNames from 'classnames';
4
4
  import { isNotEmpty, noop } from '@bigbinary/neeto-cist';
5
- import { SCREEN_RECORDER_STATUS, UPLOAD_STATUS as UPLOAD_STATUS$1, MIME_TYPE as MIME_TYPE$1, ONE_MINUTE_IN_MILLISECONDS as ONE_MINUTE_IN_MILLISECONDS$1, ONE_SECOND_IN_MILLISECONDS as ONE_SECOND_IN_MILLISECONDS$1, IS_EXTENSION as IS_EXTENSION$1, SCREEN_RECORDER_ERROR, IS_SAFARI_EXTENSION, SCREEN_RECORDER_EVENT, UPLOAD_EVENT } from '@bigbinary/neeto-media-recorder/constants';
5
+ import { SCREEN_RECORDER_STATUS, UPLOAD_STATUS as UPLOAD_STATUS$1, ONE_SECOND_IN_MILLISECONDS as ONE_SECOND_IN_MILLISECONDS$1, MIME_TYPE as MIME_TYPE$1, ONE_MINUTE_IN_MILLISECONDS as ONE_MINUTE_IN_MILLISECONDS$1, IS_EXTENSION as IS_EXTENSION$1, SCREEN_RECORDER_ERROR, IS_SAFARI_EXTENSION, SCREEN_RECORDER_EVENT, UPLOAD_EVENT } from '@bigbinary/neeto-media-recorder/constants';
6
6
  import { screenRecorder, useMultipartS3UploadStatus, getMultipartS3Uploader } from '@bigbinary/neeto-media-recorder/core';
7
7
  import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
8
8
  import Alert from '@bigbinary/neetoui/Alert';
@@ -568,6 +568,9 @@ var getRecorderTimeLimitInHumanFormat = function getRecorderTimeLimitInHumanForm
568
568
  var minutes = Math.floor(timeInMs / (1000 * 60));
569
569
  var hours = Math.floor(minutes / 60);
570
570
  if (hours < 1) {
571
+ if (minutes < 1) {
572
+ return "".concat(Math.floor(timeInMs / ONE_SECOND_IN_MILLISECONDS$1), " seconds");
573
+ }
571
574
  return "".concat(minutes, " minutes");
572
575
  }
573
576
  return "".concat(hours, " hours");
@@ -1026,6 +1029,26 @@ var generatePublicUrl = function generatePublicUrl(recordingId) {
1026
1029
  return "".concat(baseURL, "/watch/").concat(recordingId);
1027
1030
  };
1028
1031
 
1032
+ var UseDesktopAppCallout = function UseDesktopAppCallout() {
1033
+ return /*#__PURE__*/jsx(Callout, {
1034
+ className: "mb-3",
1035
+ style: "info",
1036
+ children: /*#__PURE__*/jsx(Typography, {
1037
+ component: "span",
1038
+ style: "body2",
1039
+ children: /*#__PURE__*/jsx(Trans, {
1040
+ i18nKey: "neetoMediaRecorder.useDesktopAppCallOut",
1041
+ components: {
1042
+ Download: /*#__PURE__*/jsx(Button, {
1043
+ href: "https://neeto.com/neetorecord/download",
1044
+ style: "link"
1045
+ })
1046
+ }
1047
+ })
1048
+ })
1049
+ });
1050
+ };
1051
+
1029
1052
  var UploadingInProgress = function UploadingInProgress(_ref) {
1030
1053
  var recording = _ref.recording,
1031
1054
  uploadProgress = _ref.uploadProgress,
@@ -1067,7 +1090,7 @@ var UploadingInProgress = function UploadingInProgress(_ref) {
1067
1090
  className: "flex h-screen w-full flex-col items-center justify-center",
1068
1091
  children: [/*#__PURE__*/jsxs("div", {
1069
1092
  className: "flex h-full w-full flex-col items-center justify-start py-14 lg:py-20 xl:py-28 2xl:py-36",
1070
- children: [/*#__PURE__*/jsxs("div", {
1093
+ children: [/*#__PURE__*/jsx(UseDesktopAppCallout, {}), /*#__PURE__*/jsxs("div", {
1071
1094
  className: "w-full pb-6 text-center",
1072
1095
  children: [/*#__PURE__*/jsx(Typography, {
1073
1096
  className: "select-none pb-6",
@@ -1285,13 +1308,15 @@ var MediaRecorder = function MediaRecorder(_ref, ref) {
1285
1308
  status: store["status"],
1286
1309
  error: store["error"],
1287
1310
  countdownTimeLeft: store["countdownTimeLeft"],
1288
- showTimeLimitWarning: store["showTimeLimitWarning"]
1311
+ showTimeLimitWarning: store["showTimeLimitWarning"],
1312
+ elapsedTime: store["elapsedTime"]
1289
1313
  };
1290
1314
  }, shallow),
1291
1315
  recorderStatus = _useRecorderStore.status,
1292
1316
  error = _useRecorderStore.error,
1293
1317
  countdownTimeLeft = _useRecorderStore.countdownTimeLeft,
1294
- showTimeLimitWarning = _useRecorderStore.showTimeLimitWarning;
1318
+ showTimeLimitWarning = _useRecorderStore.showTimeLimitWarning,
1319
+ elapsedTime = _useRecorderStore.elapsedTime;
1295
1320
  var _useRecorderStatus = useRecorderStatus(),
1296
1321
  isRecorderStatus = _useRecorderStatus.isStatus;
1297
1322
  var _useMultipartS3Upload = useMultipartS3UploadStatus(),
@@ -1528,16 +1553,16 @@ var MediaRecorder = function MediaRecorder(_ref, ref) {
1528
1553
  });
1529
1554
  }
1530
1555
  if (isRecorderStatus(SCREEN_RECORDER_STATUS.stopped) && isUploadStatus(UPLOAD_STATUS$1.completed)) {
1531
- return /*#__PURE__*/jsx("div", {
1556
+ return /*#__PURE__*/jsxs("div", {
1532
1557
  className: "h-screen w-full",
1533
- children: /*#__PURE__*/jsx(PageLoader, {})
1558
+ children: [/*#__PURE__*/jsx(UseDesktopAppCallout, {}), /*#__PURE__*/jsx(PageLoader, {})]
1534
1559
  });
1535
1560
  }
1536
1561
  return /*#__PURE__*/jsxs("div", {
1537
1562
  className: "flex h-screen w-full flex-col items-center justify-start py-10 xl:py-14 2xl:py-20",
1538
1563
  children: [/*#__PURE__*/jsxs("div", {
1539
1564
  className: classNames("w-full max-w-3xl"),
1540
- children: [error === SCREEN_RECORDER_ERROR.NotAllowedError && /*#__PURE__*/jsxs("div", {
1565
+ children: [/*#__PURE__*/jsx(UseDesktopAppCallout, {}), error === SCREEN_RECORDER_ERROR.NotAllowedError && /*#__PURE__*/jsxs("div", {
1541
1566
  className: "flex flex-col items-center",
1542
1567
  children: [/*#__PURE__*/jsx(Typography, {
1543
1568
  className: "mb-2",
@@ -1581,8 +1606,22 @@ var MediaRecorder = function MediaRecorder(_ref, ref) {
1581
1606
  className: "mx-auto mb-2 w-1/2 p-3",
1582
1607
  "data-cy": "recorder-time-limit-warning-callout",
1583
1608
  style: "warning",
1584
- children: t("neetoMediaRecorder.record.timeLimitWarning", {
1585
- duration: getRecorderTimeLimitInHumanFormat(screenRecorder.timeLimit)
1609
+ children: /*#__PURE__*/jsx(Typography, {
1610
+ component: "span",
1611
+ style: "body2",
1612
+ children: /*#__PURE__*/jsx(Trans, {
1613
+ i18nKey: "neetoMediaRecorder.record.timeLimitWarning",
1614
+ components: {
1615
+ Bold: /*#__PURE__*/jsx(Typography, {
1616
+ component: "span",
1617
+ weight: "bold"
1618
+ })
1619
+ },
1620
+ values: {
1621
+ duration: getRecorderTimeLimitInHumanFormat(screenRecorder.timeLimit),
1622
+ endsIn: getRecorderTimeLimitInHumanFormat(screenRecorder.timeLimit - elapsedTime)
1623
+ }
1624
+ })
1586
1625
  })
1587
1626
  }), isRecorderStatus(SCREEN_RECORDER_STATUS.media_acquired, SCREEN_RECORDER_STATUS.restarting) && /*#__PURE__*/jsxs("div", {
1588
1627
  className: "mx-auto flex flex-col items-center justify-center space-y-4",