@bigbinary/neeto-media-recorder 2.6.2 → 2.6.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/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");
@@ -1285,13 +1288,15 @@ var MediaRecorder = function MediaRecorder(_ref, ref) {
1285
1288
  status: store["status"],
1286
1289
  error: store["error"],
1287
1290
  countdownTimeLeft: store["countdownTimeLeft"],
1288
- showTimeLimitWarning: store["showTimeLimitWarning"]
1291
+ showTimeLimitWarning: store["showTimeLimitWarning"],
1292
+ elapsedTime: store["elapsedTime"]
1289
1293
  };
1290
1294
  }, shallow),
1291
1295
  recorderStatus = _useRecorderStore.status,
1292
1296
  error = _useRecorderStore.error,
1293
1297
  countdownTimeLeft = _useRecorderStore.countdownTimeLeft,
1294
- showTimeLimitWarning = _useRecorderStore.showTimeLimitWarning;
1298
+ showTimeLimitWarning = _useRecorderStore.showTimeLimitWarning,
1299
+ elapsedTime = _useRecorderStore.elapsedTime;
1295
1300
  var _useRecorderStatus = useRecorderStatus(),
1296
1301
  isRecorderStatus = _useRecorderStatus.isStatus;
1297
1302
  var _useMultipartS3Upload = useMultipartS3UploadStatus(),
@@ -1581,8 +1586,22 @@ var MediaRecorder = function MediaRecorder(_ref, ref) {
1581
1586
  className: "mx-auto mb-2 w-1/2 p-3",
1582
1587
  "data-cy": "recorder-time-limit-warning-callout",
1583
1588
  style: "warning",
1584
- children: t("neetoMediaRecorder.record.timeLimitWarning", {
1585
- duration: getRecorderTimeLimitInHumanFormat(screenRecorder.timeLimit)
1589
+ children: /*#__PURE__*/jsx(Typography, {
1590
+ component: "span",
1591
+ style: "body2",
1592
+ children: /*#__PURE__*/jsx(Trans, {
1593
+ i18nKey: "neetoMediaRecorder.record.timeLimitWarning",
1594
+ components: {
1595
+ Bold: /*#__PURE__*/jsx(Typography, {
1596
+ component: "span",
1597
+ weight: "bold"
1598
+ })
1599
+ },
1600
+ values: {
1601
+ duration: getRecorderTimeLimitInHumanFormat(screenRecorder.timeLimit),
1602
+ endsIn: getRecorderTimeLimitInHumanFormat(screenRecorder.timeLimit - elapsedTime)
1603
+ }
1604
+ })
1586
1605
  })
1587
1606
  }), isRecorderStatus(SCREEN_RECORDER_STATUS.media_acquired, SCREEN_RECORDER_STATUS.restarting) && /*#__PURE__*/jsxs("div", {
1588
1607
  className: "mx-auto flex flex-col items-center justify-center space-y-4",