@micromag/screen-video 0.2.405 → 0.2.409
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 +9 -4
- package/lib/index.js +9 -4
- package/package.json +11 -11
package/es/index.js
CHANGED
|
@@ -28,7 +28,7 @@ var propTypes = {
|
|
|
28
28
|
background: PropTypes$1.backgroundElement,
|
|
29
29
|
callToAction: PropTypes$1.callToAction,
|
|
30
30
|
current: PropTypes.bool,
|
|
31
|
-
|
|
31
|
+
active: PropTypes.bool,
|
|
32
32
|
transitions: PropTypes$1.transitions,
|
|
33
33
|
spacing: PropTypes.number,
|
|
34
34
|
getMediaRef: PropTypes.func,
|
|
@@ -40,7 +40,7 @@ var defaultProps = {
|
|
|
40
40
|
background: null,
|
|
41
41
|
callToAction: null,
|
|
42
42
|
current: true,
|
|
43
|
-
|
|
43
|
+
active: true,
|
|
44
44
|
transitions: null,
|
|
45
45
|
spacing: 20,
|
|
46
46
|
getMediaRef: null,
|
|
@@ -55,6 +55,7 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
55
55
|
background = _ref.background,
|
|
56
56
|
callToAction = _ref.callToAction,
|
|
57
57
|
current = _ref.current,
|
|
58
|
+
active = _ref.active,
|
|
58
59
|
transitions = _ref.transitions,
|
|
59
60
|
spacing = _ref.spacing,
|
|
60
61
|
getMediaRef = _ref.getMediaRef,
|
|
@@ -74,6 +75,8 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
74
75
|
isCapture = _useScreenRenderConte.isCapture;
|
|
75
76
|
|
|
76
77
|
var backgroundPlaying = current && (isView || isEdit);
|
|
78
|
+
var backgroundShouldLoad = current || active || !isView;
|
|
79
|
+
var videoShouldLoad = current || active || !isView;
|
|
77
80
|
var apiRef = useRef();
|
|
78
81
|
|
|
79
82
|
var _ref2 = apiRef.current || {},
|
|
@@ -276,7 +279,8 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
276
279
|
onDurationChanged: onDurationChanged,
|
|
277
280
|
onSeeked: onSeeked,
|
|
278
281
|
onVolumeChanged: onVolumeChanged,
|
|
279
|
-
focusable: current && isView
|
|
282
|
+
focusable: current && isView,
|
|
283
|
+
preload: videoShouldLoad ? 'auto' : 'metadata' // onPosterLoaded={onPosterLoaded}
|
|
280
284
|
|
|
281
285
|
}))) : null), !isPlaceholder ? /*#__PURE__*/React.createElement("div", {
|
|
282
286
|
key: "bottom-content",
|
|
@@ -319,7 +323,8 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
319
323
|
background: background,
|
|
320
324
|
width: width,
|
|
321
325
|
height: height,
|
|
322
|
-
playing: backgroundPlaying
|
|
326
|
+
playing: backgroundPlaying,
|
|
327
|
+
shouldLoad: backgroundShouldLoad
|
|
323
328
|
}) : null, /*#__PURE__*/React.createElement(Container, {
|
|
324
329
|
width: width,
|
|
325
330
|
height: height
|
package/lib/index.js
CHANGED
|
@@ -49,7 +49,7 @@ var propTypes = {
|
|
|
49
49
|
background: core.PropTypes.backgroundElement,
|
|
50
50
|
callToAction: core.PropTypes.callToAction,
|
|
51
51
|
current: PropTypes__default["default"].bool,
|
|
52
|
-
|
|
52
|
+
active: PropTypes__default["default"].bool,
|
|
53
53
|
transitions: core.PropTypes.transitions,
|
|
54
54
|
spacing: PropTypes__default["default"].number,
|
|
55
55
|
getMediaRef: PropTypes__default["default"].func,
|
|
@@ -61,7 +61,7 @@ var defaultProps = {
|
|
|
61
61
|
background: null,
|
|
62
62
|
callToAction: null,
|
|
63
63
|
current: true,
|
|
64
|
-
|
|
64
|
+
active: true,
|
|
65
65
|
transitions: null,
|
|
66
66
|
spacing: 20,
|
|
67
67
|
getMediaRef: null,
|
|
@@ -76,6 +76,7 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
76
76
|
background = _ref.background,
|
|
77
77
|
callToAction = _ref.callToAction,
|
|
78
78
|
current = _ref.current,
|
|
79
|
+
active = _ref.active,
|
|
79
80
|
transitions = _ref.transitions,
|
|
80
81
|
spacing = _ref.spacing,
|
|
81
82
|
getMediaRef = _ref.getMediaRef,
|
|
@@ -95,6 +96,8 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
95
96
|
isCapture = _useScreenRenderConte.isCapture;
|
|
96
97
|
|
|
97
98
|
var backgroundPlaying = current && (isView || isEdit);
|
|
99
|
+
var backgroundShouldLoad = current || active || !isView;
|
|
100
|
+
var videoShouldLoad = current || active || !isView;
|
|
98
101
|
var apiRef = React.useRef();
|
|
99
102
|
|
|
100
103
|
var _ref2 = apiRef.current || {},
|
|
@@ -297,7 +300,8 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
297
300
|
onDurationChanged: onDurationChanged,
|
|
298
301
|
onSeeked: onSeeked,
|
|
299
302
|
onVolumeChanged: onVolumeChanged,
|
|
300
|
-
focusable: current && isView
|
|
303
|
+
focusable: current && isView,
|
|
304
|
+
preload: videoShouldLoad ? 'auto' : 'metadata' // onPosterLoaded={onPosterLoaded}
|
|
301
305
|
|
|
302
306
|
}))) : null), !isPlaceholder ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
303
307
|
key: "bottom-content",
|
|
@@ -340,7 +344,8 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
340
344
|
background: background,
|
|
341
345
|
width: width,
|
|
342
346
|
height: height,
|
|
343
|
-
playing: backgroundPlaying
|
|
347
|
+
playing: backgroundPlaying,
|
|
348
|
+
shouldLoad: backgroundShouldLoad
|
|
344
349
|
}) : null, /*#__PURE__*/React__default["default"].createElement(Container__default["default"], {
|
|
345
350
|
width: width,
|
|
346
351
|
height: height
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-video",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.409",
|
|
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.15",
|
|
53
|
-
"@micromag/core": "^0.2.
|
|
54
|
-
"@micromag/element-background": "^0.2.
|
|
55
|
-
"@micromag/element-call-to-action": "^0.2.
|
|
56
|
-
"@micromag/element-closed-captions": "^0.2.
|
|
57
|
-
"@micromag/element-container": "^0.2.
|
|
58
|
-
"@micromag/element-image": "^0.2.
|
|
59
|
-
"@micromag/element-media-controls": "^0.2.
|
|
60
|
-
"@micromag/element-video": "^0.2.
|
|
61
|
-
"@micromag/transforms": "^0.2.
|
|
53
|
+
"@micromag/core": "^0.2.409",
|
|
54
|
+
"@micromag/element-background": "^0.2.409",
|
|
55
|
+
"@micromag/element-call-to-action": "^0.2.409",
|
|
56
|
+
"@micromag/element-closed-captions": "^0.2.409",
|
|
57
|
+
"@micromag/element-container": "^0.2.409",
|
|
58
|
+
"@micromag/element-image": "^0.2.409",
|
|
59
|
+
"@micromag/element-media-controls": "^0.2.409",
|
|
60
|
+
"@micromag/element-video": "^0.2.409",
|
|
61
|
+
"@micromag/transforms": "^0.2.409",
|
|
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": "4c16c3bb63644d1bd5b7d50086098337317ee3f6"
|
|
72
72
|
}
|