@micromag/screen-video 0.3.159 → 0.3.164
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 +4 -4
- package/lib/index.js +3 -3
- package/package.json +11 -11
package/es/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import React, { useEffect, useState, useCallback, useMemo } from 'react';
|
|
9
9
|
import { PropTypes as PropTypes$1 } from '@micromag/core';
|
|
10
10
|
import { ScreenElement, PlaceholderVideo, Empty, Transitions } from '@micromag/core/components';
|
|
11
|
-
import { useScreenSize, useScreenRenderContext, useViewerNavigation, useViewerContext, useViewerWebView, usePlaybackContext, usePlaybackMediaRef } from '@micromag/core/contexts';
|
|
11
|
+
import { useScreenSize, useScreenRenderContext, useViewerNavigation, useViewerContext, useViewerWebView, usePlaybackContext, usePlaybackMediaRef, useViewerContainer } from '@micromag/core/contexts';
|
|
12
12
|
import { useTrackScreenMedia, useActivityDetector, useMediaThumbnail } from '@micromag/core/hooks';
|
|
13
13
|
import Background from '@micromag/element-background';
|
|
14
14
|
import CallToAction from '@micromag/element-call-to-action';
|
|
@@ -153,12 +153,13 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
153
153
|
setPlaying(true);
|
|
154
154
|
}
|
|
155
155
|
}, [current, autoPlay]);
|
|
156
|
+
var viewerContainer = useViewerContainer();
|
|
156
157
|
|
|
157
158
|
var _useActivityDetector = useActivityDetector({
|
|
159
|
+
element: viewerContainer,
|
|
158
160
|
disabled: !current || !isView,
|
|
159
161
|
timeout: 2000
|
|
160
162
|
}),
|
|
161
|
-
activityDetectorRef = _useActivityDetector.ref,
|
|
162
163
|
activityDetected = _useActivityDetector.detected;
|
|
163
164
|
|
|
164
165
|
useEffect(function () {
|
|
@@ -341,8 +342,7 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
341
342
|
})) : null)) : null];
|
|
342
343
|
return /*#__PURE__*/React.createElement("div", {
|
|
343
344
|
className: classNames([styles.container, (_ref7 = {}, _defineProperty(_ref7, className, className !== null), _defineProperty(_ref7, styles.fullscreen, fullscreen), _ref7)]),
|
|
344
|
-
"data-screen-ready": isStatic || isCapture || ready
|
|
345
|
-
ref: activityDetectorRef
|
|
345
|
+
"data-screen-ready": isStatic || isCapture || ready
|
|
346
346
|
}, !isPlaceholder ? /*#__PURE__*/React.createElement(Background, {
|
|
347
347
|
background: background,
|
|
348
348
|
width: width,
|
package/lib/index.js
CHANGED
|
@@ -173,12 +173,13 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
173
173
|
setPlaying(true);
|
|
174
174
|
}
|
|
175
175
|
}, [current, autoPlay]);
|
|
176
|
+
var viewerContainer = contexts.useViewerContainer();
|
|
176
177
|
|
|
177
178
|
var _useActivityDetector = hooks.useActivityDetector({
|
|
179
|
+
element: viewerContainer,
|
|
178
180
|
disabled: !current || !isView,
|
|
179
181
|
timeout: 2000
|
|
180
182
|
}),
|
|
181
|
-
activityDetectorRef = _useActivityDetector.ref,
|
|
182
183
|
activityDetected = _useActivityDetector.detected;
|
|
183
184
|
|
|
184
185
|
React.useEffect(function () {
|
|
@@ -361,8 +362,7 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
361
362
|
})) : null)) : null];
|
|
362
363
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
363
364
|
className: classNames__default["default"]([styles.container, (_ref7 = {}, _defineProperty__default["default"](_ref7, className, className !== null), _defineProperty__default["default"](_ref7, styles.fullscreen, fullscreen), _ref7)]),
|
|
364
|
-
"data-screen-ready": isStatic || isCapture || ready
|
|
365
|
-
ref: activityDetectorRef
|
|
365
|
+
"data-screen-ready": isStatic || isCapture || ready
|
|
366
366
|
}, !isPlaceholder ? /*#__PURE__*/React__default["default"].createElement(Background__default["default"], {
|
|
367
367
|
background: background,
|
|
368
368
|
width: width,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-video",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.164",
|
|
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.
|
|
54
|
-
"@micromag/element-background": "^0.3.
|
|
55
|
-
"@micromag/element-call-to-action": "^0.3.
|
|
56
|
-
"@micromag/element-closed-captions": "^0.3.
|
|
57
|
-
"@micromag/element-container": "^0.3.
|
|
58
|
-
"@micromag/element-image": "^0.3.
|
|
59
|
-
"@micromag/element-media-controls": "^0.3.
|
|
60
|
-
"@micromag/element-video": "^0.3.
|
|
61
|
-
"@micromag/transforms": "^0.3.
|
|
53
|
+
"@micromag/core": "^0.3.164",
|
|
54
|
+
"@micromag/element-background": "^0.3.164",
|
|
55
|
+
"@micromag/element-call-to-action": "^0.3.164",
|
|
56
|
+
"@micromag/element-closed-captions": "^0.3.164",
|
|
57
|
+
"@micromag/element-container": "^0.3.164",
|
|
58
|
+
"@micromag/element-image": "^0.3.164",
|
|
59
|
+
"@micromag/element-media-controls": "^0.3.164",
|
|
60
|
+
"@micromag/element-video": "^0.3.164",
|
|
61
|
+
"@micromag/transforms": "^0.3.164",
|
|
62
62
|
"classnames": "^2.2.6",
|
|
63
63
|
"lodash": "^4.17.21",
|
|
64
64
|
"prop-types": "^15.7.2",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "9f184b29369c35b3928578e6a67bb60e86cf36b0"
|
|
72
72
|
}
|