@micromag/element-audio 0.3.668 → 0.3.676
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 +2 -2
- package/package.json +4 -4
package/es/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import isNumber from 'lodash/isNumber';
|
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import React, { useState, useMemo, useCallback, useRef, useEffect } from 'react';
|
|
8
8
|
import { PropTypes as PropTypes$1 } from '@micromag/core';
|
|
9
|
-
import { useDimensionObserver, useMediaCurrentTime, useMediaReady, useMediaDuration, useMediaLoad, useProgressSteps } from '@micromag/core/hooks';
|
|
9
|
+
import { useDimensionObserver, useMediaCurrentTime, useMediaReady, useMediaDuration, useMediaLoad, useProgressSteps, useDevicePixelRatio } from '@micromag/core/hooks';
|
|
10
10
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
11
11
|
import { useGesture } from '@use-gesture/react';
|
|
12
12
|
import { useIntl } from 'react-intl';
|
|
@@ -411,7 +411,6 @@ var Audio$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
411
411
|
|
|
412
412
|
var styles = {"container":"micromag-element-audio-audio-wave-container","canvasBackground":"micromag-element-audio-audio-wave-canvasBackground","canvasProgress":"micromag-element-audio-audio-wave-canvasProgress"};
|
|
413
413
|
|
|
414
|
-
var devicePixelRatio = typeof window !== 'undefined' ? window.devicePixelRatio || 1 : 1;
|
|
415
414
|
var propTypes = {
|
|
416
415
|
currentTime: PropTypes.number,
|
|
417
416
|
duration: PropTypes.number,
|
|
@@ -560,6 +559,7 @@ function AudioWave(_ref) {
|
|
|
560
559
|
// draw samples
|
|
561
560
|
var canvasBg = canvasBackgroundRef.current;
|
|
562
561
|
var canvasProgress = canvasProgressRef.current;
|
|
562
|
+
var devicePixelRatio = useDevicePixelRatio();
|
|
563
563
|
var scale = devicePixelRatio;
|
|
564
564
|
canvasBg.width = canvasProgress.width = Math.floor(elWidth * scale);
|
|
565
565
|
canvasBg.height = canvasProgress.height = Math.floor(elHeight * scale);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-audio",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.676",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@babel/runtime": "^7.13.10",
|
|
62
|
-
"@micromag/core": "^0.3.
|
|
63
|
-
"@micromag/element-closed-captions": "^0.3.
|
|
62
|
+
"@micromag/core": "^0.3.676",
|
|
63
|
+
"@micromag/element-closed-captions": "^0.3.676",
|
|
64
64
|
"@react-spring/core": "^9.6.1",
|
|
65
65
|
"@react-spring/web": "^9.6.1",
|
|
66
66
|
"@use-gesture/react": "^10.3.0",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"access": "public",
|
|
75
75
|
"registry": "https://registry.npmjs.org/"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "941f3a10c4de917c02ca81f39e6d15a85094e289"
|
|
78
78
|
}
|