@micromag/core 0.4.44 → 0.4.46
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/contexts.js +2 -6
- package/lib/contexts.js +2 -6
- package/package.json +2 -2
package/es/contexts.js
CHANGED
|
@@ -1023,11 +1023,9 @@ var usePlaybackMediaRef = function usePlaybackMediaRef() {
|
|
|
1023
1023
|
// Cleanup: clear media registration when this screen deactivates or unmounts.
|
|
1024
1024
|
// Note: we cannot check mediaRef.current here because React clears callback refs
|
|
1025
1025
|
// before running effect cleanups, so mediaRef.current is always null at this point.
|
|
1026
|
-
|
|
1027
1026
|
useEffect(function () {
|
|
1028
1027
|
return function () {
|
|
1029
1028
|
if (active) {
|
|
1030
|
-
console.log('clear register media');
|
|
1031
1029
|
setMedia(null);
|
|
1032
1030
|
setIsBackground(false);
|
|
1033
1031
|
}
|
|
@@ -1036,11 +1034,9 @@ var usePlaybackMediaRef = function usePlaybackMediaRef() {
|
|
|
1036
1034
|
|
|
1037
1035
|
// Register media with context when active and no media is registered
|
|
1038
1036
|
useEffect(function () {
|
|
1039
|
-
console.log('try to register media', active, mediaRef.current, media, updateKey);
|
|
1040
1037
|
if (!active || mediaRef.current === null || media !== null) {
|
|
1041
1038
|
return;
|
|
1042
1039
|
}
|
|
1043
|
-
console.log('register media');
|
|
1044
1040
|
setIsBackground(background);
|
|
1045
1041
|
setMedia(mediaRef.current);
|
|
1046
1042
|
}, [active, background, media, updateKey, setMedia, setIsBackground]);
|
|
@@ -1171,7 +1167,7 @@ function PlaybackProvider(_ref) {
|
|
|
1171
1167
|
if (fromRef === null || media === null || fromRef === media) {
|
|
1172
1168
|
setCurrentQualityLevel(level);
|
|
1173
1169
|
}
|
|
1174
|
-
}, [setCurrentQualityLevel]);
|
|
1170
|
+
}, [media, setCurrentQualityLevel]);
|
|
1175
1171
|
var value = useMemo(function () {
|
|
1176
1172
|
return {
|
|
1177
1173
|
muted: muted,
|
|
@@ -1197,7 +1193,7 @@ function PlaybackProvider(_ref) {
|
|
|
1197
1193
|
setMedia: setMedia,
|
|
1198
1194
|
setCurrentQualityLevel: finalSetCurrentQualityLevel
|
|
1199
1195
|
};
|
|
1200
|
-
}, [muted, playing, completed, paused, controls, controlsSuggestPlay, controlsVisible, controlsTheme, media, hasAudio, currentQualityLevel, setMuted, setIsBackground, isBackground, finalSetPlaying, finalSetControls, finalSetControlsTheme, setControlsSuggestPlay, setControlsVisible,
|
|
1196
|
+
}, [muted, playing, completed, paused, controls, controlsSuggestPlay, controlsVisible, controlsTheme, media, hasAudio, currentQualityLevel, setMuted, setIsBackground, isBackground, finalSetPlaying, finalSetControls, finalSetControlsTheme, setControlsSuggestPlay, setControlsVisible, showControls, hideControls, setMedia, finalSetCurrentQualityLevel]);
|
|
1201
1197
|
return /*#__PURE__*/React.createElement(PlaybackContext.Provider, {
|
|
1202
1198
|
value: value
|
|
1203
1199
|
}, children);
|
package/lib/contexts.js
CHANGED
|
@@ -1023,11 +1023,9 @@ var usePlaybackMediaRef = function usePlaybackMediaRef() {
|
|
|
1023
1023
|
// Cleanup: clear media registration when this screen deactivates or unmounts.
|
|
1024
1024
|
// Note: we cannot check mediaRef.current here because React clears callback refs
|
|
1025
1025
|
// before running effect cleanups, so mediaRef.current is always null at this point.
|
|
1026
|
-
|
|
1027
1026
|
React.useEffect(function () {
|
|
1028
1027
|
return function () {
|
|
1029
1028
|
if (active) {
|
|
1030
|
-
console.log('clear register media');
|
|
1031
1029
|
setMedia(null);
|
|
1032
1030
|
setIsBackground(false);
|
|
1033
1031
|
}
|
|
@@ -1036,11 +1034,9 @@ var usePlaybackMediaRef = function usePlaybackMediaRef() {
|
|
|
1036
1034
|
|
|
1037
1035
|
// Register media with context when active and no media is registered
|
|
1038
1036
|
React.useEffect(function () {
|
|
1039
|
-
console.log('try to register media', active, mediaRef.current, media, updateKey);
|
|
1040
1037
|
if (!active || mediaRef.current === null || media !== null) {
|
|
1041
1038
|
return;
|
|
1042
1039
|
}
|
|
1043
|
-
console.log('register media');
|
|
1044
1040
|
setIsBackground(background);
|
|
1045
1041
|
setMedia(mediaRef.current);
|
|
1046
1042
|
}, [active, background, media, updateKey, setMedia, setIsBackground]);
|
|
@@ -1171,7 +1167,7 @@ function PlaybackProvider(_ref) {
|
|
|
1171
1167
|
if (fromRef === null || media === null || fromRef === media) {
|
|
1172
1168
|
setCurrentQualityLevel(level);
|
|
1173
1169
|
}
|
|
1174
|
-
}, [setCurrentQualityLevel]);
|
|
1170
|
+
}, [media, setCurrentQualityLevel]);
|
|
1175
1171
|
var value = React.useMemo(function () {
|
|
1176
1172
|
return {
|
|
1177
1173
|
muted: muted,
|
|
@@ -1197,7 +1193,7 @@ function PlaybackProvider(_ref) {
|
|
|
1197
1193
|
setMedia: setMedia,
|
|
1198
1194
|
setCurrentQualityLevel: finalSetCurrentQualityLevel
|
|
1199
1195
|
};
|
|
1200
|
-
}, [muted, playing, completed, paused, controls, controlsSuggestPlay, controlsVisible, controlsTheme, media, hasAudio, currentQualityLevel, setMuted, setIsBackground, isBackground, finalSetPlaying, finalSetControls, finalSetControlsTheme, setControlsSuggestPlay, setControlsVisible,
|
|
1196
|
+
}, [muted, playing, completed, paused, controls, controlsSuggestPlay, controlsVisible, controlsTheme, media, hasAudio, currentQualityLevel, setMuted, setIsBackground, isBackground, finalSetPlaying, finalSetControls, finalSetControlsTheme, setControlsSuggestPlay, setControlsVisible, showControls, hideControls, setMedia, finalSetCurrentQualityLevel]);
|
|
1201
1197
|
return /*#__PURE__*/React.createElement(PlaybackContext.Provider, {
|
|
1202
1198
|
value: value
|
|
1203
1199
|
}, children);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.46",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -161,6 +161,6 @@
|
|
|
161
161
|
"access": "public",
|
|
162
162
|
"registry": "https://registry.npmjs.org/"
|
|
163
163
|
},
|
|
164
|
-
"gitHead": "
|
|
164
|
+
"gitHead": "4c2fdb2bb166162be997a70d13a14255e9975e1b",
|
|
165
165
|
"types": "es/index.d.ts"
|
|
166
166
|
}
|