@micromag/element-audio 0.4.37 → 0.4.40
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/es/index.js +16 -16
- package/package.json +4 -4
package/es/index.js
CHANGED
|
@@ -112,7 +112,7 @@ function AudioBars(_ref) {
|
|
|
112
112
|
}
|
|
113
113
|
});
|
|
114
114
|
return /*#__PURE__*/React.createElement("div", {
|
|
115
|
-
className: classNames([styles$2.container,
|
|
115
|
+
className: classNames([styles$2.container, className]),
|
|
116
116
|
ref: elRef
|
|
117
117
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
118
118
|
version: "1.1",
|
|
@@ -232,16 +232,16 @@ function Audio(_ref) {
|
|
|
232
232
|
}
|
|
233
233
|
return url;
|
|
234
234
|
}, [files, url]);
|
|
235
|
-
var
|
|
236
|
-
var currentTime = useMediaCurrentTime(
|
|
235
|
+
var _ref7 = useRef(null);
|
|
236
|
+
var currentTime = useMediaCurrentTime(_ref7.current, {
|
|
237
237
|
id: srcUrl,
|
|
238
238
|
disabled: paused || !withWave && onProgressStep === null,
|
|
239
239
|
updateInterval: updateInterval
|
|
240
240
|
});
|
|
241
|
-
var ready = useMediaReady(
|
|
241
|
+
var ready = useMediaReady(_ref7.current, {
|
|
242
242
|
id: srcUrl
|
|
243
243
|
});
|
|
244
|
-
var duration = useMediaDuration(
|
|
244
|
+
var duration = useMediaDuration(_ref7.current, {
|
|
245
245
|
id: srcUrl
|
|
246
246
|
});
|
|
247
247
|
|
|
@@ -250,7 +250,7 @@ function Audio(_ref) {
|
|
|
250
250
|
// reduceBufferFactor,
|
|
251
251
|
// });
|
|
252
252
|
|
|
253
|
-
useMediaLoad(
|
|
253
|
+
useMediaLoad(_ref7.current, {
|
|
254
254
|
preload: preload,
|
|
255
255
|
shouldLoad: shouldLoad
|
|
256
256
|
});
|
|
@@ -261,7 +261,7 @@ function Audio(_ref) {
|
|
|
261
261
|
}
|
|
262
262
|
}, [duration, customOnDurationChange]);
|
|
263
263
|
var onVolumeChange = useCallback(function () {
|
|
264
|
-
var _ref$current =
|
|
264
|
+
var _ref$current = _ref7.current,
|
|
265
265
|
element = _ref$current === void 0 ? null : _ref$current;
|
|
266
266
|
if (element === null) {
|
|
267
267
|
return;
|
|
@@ -269,17 +269,17 @@ function Audio(_ref) {
|
|
|
269
269
|
if (customOnVolumeChange !== null) {
|
|
270
270
|
customOnVolumeChange(element.volume);
|
|
271
271
|
}
|
|
272
|
-
}, [
|
|
272
|
+
}, [_ref7.current, customOnVolumeChange]);
|
|
273
273
|
var onWavePlay = useCallback(function () {
|
|
274
|
-
var _ref$current2 =
|
|
274
|
+
var _ref$current2 = _ref7.current,
|
|
275
275
|
element = _ref$current2 === void 0 ? null : _ref$current2;
|
|
276
276
|
if (element === null) {
|
|
277
277
|
return;
|
|
278
278
|
}
|
|
279
279
|
element.play();
|
|
280
|
-
}, [
|
|
280
|
+
}, [_ref7.current]);
|
|
281
281
|
var onWaveSeek = useCallback(function (newTime) {
|
|
282
|
-
var _ref$current3 =
|
|
282
|
+
var _ref$current3 = _ref7.current,
|
|
283
283
|
element = _ref$current3 === void 0 ? null : _ref$current3;
|
|
284
284
|
if (element === null) {
|
|
285
285
|
return;
|
|
@@ -287,14 +287,14 @@ function Audio(_ref) {
|
|
|
287
287
|
if (isNumber(newTime)) {
|
|
288
288
|
element.currentTime = newTime;
|
|
289
289
|
}
|
|
290
|
-
}, [
|
|
290
|
+
}, [_ref7.current]);
|
|
291
291
|
useEffect(function () {
|
|
292
292
|
if (waveReady && onReady !== null) {
|
|
293
293
|
onReady();
|
|
294
294
|
}
|
|
295
295
|
}, [waveReady, onReady]);
|
|
296
296
|
useEffect(function () {
|
|
297
|
-
var _ref$current4 =
|
|
297
|
+
var _ref$current4 = _ref7.current,
|
|
298
298
|
element = _ref$current4 === void 0 ? null : _ref$current4;
|
|
299
299
|
if (element === null) {
|
|
300
300
|
return;
|
|
@@ -318,11 +318,11 @@ function Audio(_ref) {
|
|
|
318
318
|
});
|
|
319
319
|
var progress = currentTime !== null && duration > 0 ? currentTime / duration : 0;
|
|
320
320
|
return /*#__PURE__*/React.createElement("div", {
|
|
321
|
-
className: classNames([styles$1.container,
|
|
321
|
+
className: classNames([styles$1.container, className])
|
|
322
322
|
}, /*#__PURE__*/React.createElement("audio", {
|
|
323
323
|
key: srcUrl,
|
|
324
324
|
ref: function ref(newRef) {
|
|
325
|
-
|
|
325
|
+
_ref7.current = newRef;
|
|
326
326
|
if (mediaRef !== null && isFunction(mediaRef)) {
|
|
327
327
|
mediaRef(newRef);
|
|
328
328
|
} else if (mediaRef !== null) {
|
|
@@ -551,7 +551,7 @@ function AudioWave(_ref) {
|
|
|
551
551
|
}
|
|
552
552
|
});
|
|
553
553
|
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
554
|
-
className: classNames([styles.container,
|
|
554
|
+
className: classNames([styles.container, className]),
|
|
555
555
|
ref: elRef
|
|
556
556
|
}, bind()), /*#__PURE__*/React.createElement("canvas", {
|
|
557
557
|
ref: canvasBackgroundRef,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-audio",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.40",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@babel/runtime": "^7.28.6",
|
|
64
|
-
"@micromag/core": "^0.4.
|
|
65
|
-
"@micromag/element-closed-captions": "^0.4.
|
|
64
|
+
"@micromag/core": "^0.4.40",
|
|
65
|
+
"@micromag/element-closed-captions": "^0.4.40",
|
|
66
66
|
"@react-spring/core": "^10.0.3",
|
|
67
67
|
"@react-spring/web": "^10.0.3",
|
|
68
68
|
"@use-gesture/react": "^10.3.0",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"access": "public",
|
|
76
76
|
"registry": "https://registry.npmjs.org/"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "6a9ff6e196a972abfd617f49353862cf445b0e83"
|
|
79
79
|
}
|