@micromag/viewer 0.4.63 → 0.4.65
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 +18 -7
- package/package.json +10 -10
package/es/index.js
CHANGED
|
@@ -2172,7 +2172,7 @@ function PlaybackControls(_ref) {
|
|
|
2172
2172
|
_useState2 = _slicedToArray(_useState, 2),
|
|
2173
2173
|
showLoading = _useState2[0],
|
|
2174
2174
|
setShowLoading = _useState2[1];
|
|
2175
|
-
var mediaUrl = mediaElement !== null ? mediaElement.src : null;
|
|
2175
|
+
var mediaUrl = mediaElement !== null ? mediaElement.currentSrc || mediaElement.src : null;
|
|
2176
2176
|
var mediaReady = useMediaReady(mediaElement, {
|
|
2177
2177
|
id: mediaUrl
|
|
2178
2178
|
});
|
|
@@ -2185,6 +2185,15 @@ function PlaybackControls(_ref) {
|
|
|
2185
2185
|
buffering = _useMediaState.buffering,
|
|
2186
2186
|
playing = _useMediaState.playing,
|
|
2187
2187
|
muted = _useMediaState.muted;
|
|
2188
|
+
console.log({
|
|
2189
|
+
wantedPlaying: wantedPlaying,
|
|
2190
|
+
wantedMuted: wantedMuted,
|
|
2191
|
+
muted: muted,
|
|
2192
|
+
playing: playing,
|
|
2193
|
+
buffering: buffering,
|
|
2194
|
+
showLoading: showLoading,
|
|
2195
|
+
ready: ready
|
|
2196
|
+
});
|
|
2188
2197
|
useEffect(function () {
|
|
2189
2198
|
var id = null;
|
|
2190
2199
|
setShowLoading(false);
|
|
@@ -2195,7 +2204,9 @@ function PlaybackControls(_ref) {
|
|
|
2195
2204
|
}
|
|
2196
2205
|
return function () {
|
|
2197
2206
|
setShowLoading(false);
|
|
2198
|
-
|
|
2207
|
+
if (id !== null) {
|
|
2208
|
+
clearTimeout(id);
|
|
2209
|
+
}
|
|
2199
2210
|
};
|
|
2200
2211
|
}, [ready, buffering, withLoading, setShowLoading]);
|
|
2201
2212
|
var _useState3 = useState({
|
|
@@ -2281,7 +2292,7 @@ function PlaybackControls(_ref) {
|
|
|
2281
2292
|
seekBarOnly = _ref3.seekBarOnly;
|
|
2282
2293
|
var isCollapsed = controls && !controlsVisible && playing || !controls && mediaHasAudio;
|
|
2283
2294
|
var withSuggestPlay = controlsSuggestPlay && !finalShowLoading && !playing;
|
|
2284
|
-
var playIcon =
|
|
2295
|
+
var playIcon = wantedPlaying ? /*#__PURE__*/jsx(PauseIcon, {
|
|
2285
2296
|
className: styles$1.icon,
|
|
2286
2297
|
color: "currentColor"
|
|
2287
2298
|
}) : /*#__PURE__*/jsx(PlayIcon, {
|
|
@@ -2311,17 +2322,17 @@ function PlaybackControls(_ref) {
|
|
|
2311
2322
|
}),
|
|
2312
2323
|
withoutBootstrapStyles: true
|
|
2313
2324
|
}) : null, /*#__PURE__*/jsx(Button$1, {
|
|
2314
|
-
className: classNames([styles$1.playPauseButton, _defineProperty(_defineProperty({}, styles$1.hidden,
|
|
2325
|
+
className: classNames([styles$1.playPauseButton, _defineProperty(_defineProperty({}, styles$1.hidden, withSuggestPlay && !controls), styles$1.loading, finalShowLoading)]),
|
|
2315
2326
|
style: {
|
|
2316
2327
|
color: color
|
|
2317
2328
|
},
|
|
2318
|
-
onClick:
|
|
2319
|
-
focusable: controls && controlsVisible && (!seekBarOnly || !
|
|
2329
|
+
onClick: wantedPlaying ? onPause : onPlay,
|
|
2330
|
+
focusable: controls && controlsVisible && (!seekBarOnly || !wantedPlaying),
|
|
2320
2331
|
disabled: finalShowLoading,
|
|
2321
2332
|
icon: finalShowLoading ? /*#__PURE__*/jsx(Spinner, {
|
|
2322
2333
|
className: classNames([styles$1.spinner, styles$1.offset])
|
|
2323
2334
|
}) : playIcon,
|
|
2324
|
-
"aria-pressed": !
|
|
2335
|
+
"aria-pressed": !wantedPlaying,
|
|
2325
2336
|
"aria-label": finalShowLoading ? intl.formatMessage({
|
|
2326
2337
|
id: "YyYrXp",
|
|
2327
2338
|
defaultMessage: [{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/viewer",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.65",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -63,14 +63,14 @@
|
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@babel/runtime": "^7.28.6",
|
|
65
65
|
"@folklore/routes": "^0.2.36",
|
|
66
|
-
"@micromag/core": "^0.4.
|
|
67
|
-
"@micromag/element-badge": "^0.4.
|
|
68
|
-
"@micromag/element-scroll": "^0.4.
|
|
69
|
-
"@micromag/element-share-options": "^0.4.
|
|
70
|
-
"@micromag/element-webview": "^0.4.
|
|
71
|
-
"@micromag/elements": "^0.4.
|
|
72
|
-
"@micromag/intl": "^0.4.
|
|
73
|
-
"@micromag/screens": "^0.4.
|
|
66
|
+
"@micromag/core": "^0.4.65",
|
|
67
|
+
"@micromag/element-badge": "^0.4.65",
|
|
68
|
+
"@micromag/element-scroll": "^0.4.65",
|
|
69
|
+
"@micromag/element-share-options": "^0.4.65",
|
|
70
|
+
"@micromag/element-webview": "^0.4.65",
|
|
71
|
+
"@micromag/elements": "^0.4.65",
|
|
72
|
+
"@micromag/intl": "^0.4.65",
|
|
73
|
+
"@micromag/screens": "^0.4.65",
|
|
74
74
|
"@react-spring/core": "^10.0.3",
|
|
75
75
|
"@react-spring/web": "^10.0.3",
|
|
76
76
|
"@use-gesture/react": "^10.3.0",
|
|
@@ -89,6 +89,6 @@
|
|
|
89
89
|
"access": "public",
|
|
90
90
|
"registry": "https://registry.npmjs.org/"
|
|
91
91
|
},
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "33460a352e56298ae450392b04c09503ecfeae05",
|
|
93
93
|
"types": "es/index.d.ts"
|
|
94
94
|
}
|