@micromag/screen-video-360 0.3.219 → 0.3.226

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 CHANGED
@@ -10,7 +10,7 @@ import 'whatwg-fetch';
10
10
  import { PropTypes as PropTypes$1 } from '@micromag/core';
11
11
  import { ScreenElement, PlaceholderVideo360, Transitions } from '@micromag/core/components';
12
12
  import { useViewerInteraction, useViewerNavigation, useViewerContext, useScreenSize, useScreenRenderContext, useViewerWebView, usePlaybackContext, useViewerContainer } from '@micromag/core/contexts';
13
- import { useTrackScreenEvent, useTrackScreenMedia, useActivityDetector, useAnimationFrame } from '@micromag/core/hooks';
13
+ import { useTrackScreenEvent, useTrackScreenMedia, useActivityDetector, useDebounce, useAnimationFrame } from '@micromag/core/hooks';
14
14
  import Background from '@micromag/element-background';
15
15
  import CallToAction from '@micromag/element-call-to-action';
16
16
  import ClosedCaptions from '@micromag/element-closed-captions';
@@ -231,22 +231,19 @@ var Video360Screen = function Video360Screen(_ref) {
231
231
 
232
232
  var _useActivityDetector = useActivityDetector({
233
233
  element: viewerContainer,
234
- disabled: !current || !isView,
234
+ disabled: !isView,
235
235
  timeout: 2000
236
236
  }),
237
237
  activityDetected = _useActivityDetector.detected;
238
238
 
239
- useEffect(function () {
240
- if (!current) {
241
- return;
242
- }
243
-
239
+ var toggleControlsVisibility = useCallback(function () {
244
240
  if (activityDetected) {
245
241
  showControls();
246
242
  } else {
247
243
  hideControls();
248
244
  }
249
245
  }, [activityDetected, showControls, hideControls]);
246
+ useDebounce(toggleControlsVisibility, activityDetected, 1000);
250
247
 
251
248
  var _useState = useState(null),
252
249
  _useState2 = _slicedToArray(_useState, 2),
package/lib/index.js CHANGED
@@ -269,22 +269,19 @@ var Video360Screen = function Video360Screen(_ref) {
269
269
 
270
270
  var _useActivityDetector = hooks.useActivityDetector({
271
271
  element: viewerContainer,
272
- disabled: !current || !isView,
272
+ disabled: !isView,
273
273
  timeout: 2000
274
274
  }),
275
275
  activityDetected = _useActivityDetector.detected;
276
276
 
277
- React.useEffect(function () {
278
- if (!current) {
279
- return;
280
- }
281
-
277
+ var toggleControlsVisibility = React.useCallback(function () {
282
278
  if (activityDetected) {
283
279
  showControls();
284
280
  } else {
285
281
  hideControls();
286
282
  }
287
283
  }, [activityDetected, showControls, hideControls]);
284
+ hooks.useDebounce(toggleControlsVisibility, activityDetected, 1000);
288
285
 
289
286
  var _useState = React.useState(null),
290
287
  _useState2 = _slicedToArray__default["default"](_useState, 2),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-video-360",
3
- "version": "0.3.219",
3
+ "version": "0.3.226",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -50,15 +50,15 @@
50
50
  "dependencies": {
51
51
  "@babel/runtime": "^7.13.10",
52
52
  "@folklore/size": "^0.1.20",
53
- "@micromag/core": "^0.3.219",
54
- "@micromag/element-background": "^0.3.219",
55
- "@micromag/element-call-to-action": "^0.3.219",
56
- "@micromag/element-closed-captions": "^0.3.219",
57
- "@micromag/element-container": "^0.3.219",
58
- "@micromag/element-image": "^0.3.219",
59
- "@micromag/element-media-controls": "^0.3.219",
60
- "@micromag/element-video": "^0.3.219",
61
- "@micromag/transforms": "^0.3.219",
53
+ "@micromag/core": "^0.3.226",
54
+ "@micromag/element-background": "^0.3.226",
55
+ "@micromag/element-call-to-action": "^0.3.226",
56
+ "@micromag/element-closed-captions": "^0.3.226",
57
+ "@micromag/element-container": "^0.3.226",
58
+ "@micromag/element-image": "^0.3.226",
59
+ "@micromag/element-media-controls": "^0.3.226",
60
+ "@micromag/element-video": "^0.3.226",
61
+ "@micromag/transforms": "^0.3.226",
62
62
  "classnames": "^2.2.6",
63
63
  "lodash": "^4.17.21",
64
64
  "prop-types": "^15.7.2",
@@ -70,5 +70,5 @@
70
70
  "publishConfig": {
71
71
  "access": "public"
72
72
  },
73
- "gitHead": "ab36acb620cd3fba5c4e3c0522a299d1d27ee422"
73
+ "gitHead": "09b84178b69abaa01da5c8e22541d4ec10b5c6f1"
74
74
  }