@micromag/viewer 0.3.783 → 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 +16 -4
  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,
@@ -3783,10 +3791,11 @@ var defaultRoutes = {
3783
3791
  screen: screen
3784
3792
  };
3785
3793
 
3786
- var _excluded = ["story", "paused", "screenComponents", "memoryRouter", "basePath", "routes", "withoutRouter", "googleApiKey", "visitor", "locale", "locales", "translations", "pathWithIndex", "trackingVariables", "trackingDisabled", "trackingPaused"];
3794
+ var _excluded = ["story", "paused", "muted", "screenComponents", "memoryRouter", "basePath", "routes", "withoutRouter", "googleApiKey", "visitor", "locale", "locales", "translations", "pathWithIndex", "trackingVariables", "trackingDisabled", "trackingPaused"];
3787
3795
  var propTypes = {
3788
3796
  story: PropTypes$1.story,
3789
3797
  paused: PropTypes.bool,
3798
+ muted: PropTypes.bool,
3790
3799
  screen: PropTypes.string,
3791
3800
  screenComponents: PropTypes.objectOf(PropTypes.elementType),
3792
3801
  memoryRouter: PropTypes.bool,
@@ -3807,6 +3816,7 @@ var propTypes = {
3807
3816
  var defaultProps = {
3808
3817
  story: null,
3809
3818
  paused: false,
3819
+ muted: true,
3810
3820
  screen: null,
3811
3821
  screenComponents: null,
3812
3822
  memoryRouter: false,
@@ -3827,6 +3837,7 @@ var defaultProps = {
3827
3837
  var ViewerContainer = function ViewerContainer(_ref) {
3828
3838
  var story = _ref.story,
3829
3839
  paused = _ref.paused,
3840
+ muted = _ref.muted,
3830
3841
  screenComponents = _ref.screenComponents,
3831
3842
  memoryRouter = _ref.memoryRouter,
3832
3843
  basePath = _ref.basePath,
@@ -3907,7 +3918,8 @@ var ViewerContainer = function ViewerContainer(_ref) {
3907
3918
  }, /*#__PURE__*/React.createElement(VisitorProvider, {
3908
3919
  visitor: visitor
3909
3920
  }, /*#__PURE__*/React.createElement(PlaybackProvider, {
3910
- paused: paused
3921
+ paused: paused,
3922
+ muted: muted
3911
3923
  }, /*#__PURE__*/React.createElement(TrackingProvider, {
3912
3924
  variables: finalTrackingVariables,
3913
3925
  disabled: trackingDisabled,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/viewer",
3
- "version": "0.3.783",
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": "e79f1240a3d905de33eb3dd873b772c11b6ebdb0"
94
+ "gitHead": "dc19f62a0cf4272e4ccf3dd1cd5e6f1284ab9080"
95
95
  }