@micromag/viewer 0.3.784 → 0.3.785

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/es/index.js +10 -2
  2. package/package.json +2 -2
package/es/index.js CHANGED
@@ -2793,6 +2793,7 @@ var propTypes$2 = {
2793
2793
  withFullscreenWebView: PropTypes.bool,
2794
2794
  withNavigationHint: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
2795
2795
  withoutPlaybackControls: PropTypes.bool,
2796
+ withoutAutoUnmute: PropTypes.bool,
2796
2797
  onClose: PropTypes.func,
2797
2798
  onInteraction: PropTypes.func,
2798
2799
  onEnd: PropTypes.func,
@@ -2855,6 +2856,7 @@ var defaultProps$2 = {
2855
2856
  withoutTransitions: false,
2856
2857
  withoutNavigationArrow: false,
2857
2858
  withoutPlaybackControls: false,
2859
+ withoutAutoUnmute: false,
2858
2860
  onClose: null,
2859
2861
  onInteraction: null,
2860
2862
  onEnd: null,
@@ -2912,6 +2914,7 @@ var Viewer = function Viewer(_ref) {
2912
2914
  withFullscreenWebView = _ref.withFullscreenWebView,
2913
2915
  withNavigationHint = _ref.withNavigationHint,
2914
2916
  withoutPlaybackControls = _ref.withoutPlaybackControls,
2917
+ withoutAutoUnmute = _ref.withoutAutoUnmute,
2915
2918
  onCloseViewer = _ref.onClose,
2916
2919
  onInteraction = _ref.onInteraction,
2917
2920
  onEnd = _ref.onEnd,
@@ -3017,7 +3020,9 @@ var Viewer = function Viewer(_ref) {
3017
3020
  _usePlaybackContext$c3 = _usePlaybackContext.completed,
3018
3021
  mediaCompleted = _usePlaybackContext$c3 === void 0 ? false : _usePlaybackContext$c3,
3019
3022
  _usePlaybackContext$i = _usePlaybackContext.isBackground,
3020
- isBackgroundVideo = _usePlaybackContext$i === void 0 ? false : _usePlaybackContext$i;
3023
+ isBackgroundVideo = _usePlaybackContext$i === void 0 ? false : _usePlaybackContext$i,
3024
+ _usePlaybackContext$s = _usePlaybackContext.setMuted,
3025
+ setMuted = _usePlaybackContext$s === void 0 ? null : _usePlaybackContext$s;
3021
3026
  var playbackHelpVisible = useMemo(function () {
3022
3027
  return playbackControls && playbackControlsVisible;
3023
3028
  }, [playbackControls, playbackControlsVisible]);
@@ -3135,8 +3140,11 @@ var Viewer = function Viewer(_ref) {
3135
3140
  }
3136
3141
  if (!hasInteracted) {
3137
3142
  setHasInteracted(true);
3143
+ if (!withoutAutoUnmute && setMuted !== null) {
3144
+ setMuted(false);
3145
+ }
3138
3146
  }
3139
- }, [onInteraction, hasInteracted, setHasInteracted]);
3147
+ }, [onInteraction, hasInteracted, setHasInteracted, withoutAutoUnmute, setMuted]);
3140
3148
  var _useScreenInteraction = useScreenInteraction({
3141
3149
  screens: screens,
3142
3150
  screenIndex: screenIndex,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/viewer",
3
- "version": "0.3.784",
3
+ "version": "0.3.785",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -91,5 +91,5 @@
91
91
  "access": "public",
92
92
  "registry": "https://registry.npmjs.org/"
93
93
  },
94
- "gitHead": "516257dfb521d7241096cd2e0d31aa6b08721640"
94
+ "gitHead": "dc19f62a0cf4272e4ccf3dd1cd5e6f1284ab9080"
95
95
  }