apm-react-audio-player 1.0.26 → 1.0.27

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 (2) hide show
  1. package/dist/index.js +3 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -61,11 +61,12 @@ function _unsupportedIterableToArray(r, a) {
61
61
  }
62
62
 
63
63
  var useAudioPlayer = function useAudioPlayer(audioRef, progressBarRef, volumeCtrl) {
64
+ var initialDuration = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
64
65
  var _useState = React.useState(false),
65
66
  _useState2 = _slicedToArray(_useState, 2),
66
67
  isPlaying = _useState2[0],
67
68
  setIsPlaying = _useState2[1];
68
- var _useState3 = React.useState(0),
69
+ var _useState3 = React.useState(initialDuration),
69
70
  _useState4 = _slicedToArray(_useState3, 2),
70
71
  duration = _useState4[0],
71
72
  setDuration = _useState4[1];
@@ -373,7 +374,7 @@ var ReactAudioPlayerInner = function ReactAudioPlayerInner(props) {
373
374
  })), /*#__PURE__*/React.createElement("div", {
374
375
  className: "player-duration",
375
376
  style: customStyles && customStyles.duration
376
- }, duration && !isNaN(duration) && calculateTime(duration))), /*#__PURE__*/React.createElement("div", {
377
+ }, duration && !isNaN(duration) ? calculateTime(duration) : '-- : --')), /*#__PURE__*/React.createElement("div", {
377
378
  className: "player-content"
378
379
  }, customHtml && customHtml, /*#__PURE__*/React.createElement("div", {
379
380
  className: "player-audio-type type-sm"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apm-react-audio-player",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "author": "Jason Phan <jphan@mpr.org>",
5
5
  "license": "MIT",
6
6
  "private": false,