@micromag/element-background 0.3.396 → 0.3.403
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 -5
- package/lib/index.js +9 -5
- package/package.json +4 -4
package/es/index.js
CHANGED
|
@@ -31,7 +31,8 @@ var propTypes$1 = {
|
|
|
31
31
|
children: PropTypes.node,
|
|
32
32
|
loadingMode: PropTypes.string,
|
|
33
33
|
shouldLoad: PropTypes.bool,
|
|
34
|
-
withoutVideo: PropTypes.bool
|
|
34
|
+
withoutVideo: PropTypes.bool,
|
|
35
|
+
forceMuted: PropTypes.bool
|
|
35
36
|
};
|
|
36
37
|
var defaultProps$1 = {
|
|
37
38
|
width: null,
|
|
@@ -50,7 +51,8 @@ var defaultProps$1 = {
|
|
|
50
51
|
children: null,
|
|
51
52
|
loadingMode: 'lazy',
|
|
52
53
|
shouldLoad: true,
|
|
53
|
-
withoutVideo: false
|
|
54
|
+
withoutVideo: false,
|
|
55
|
+
forceMuted: false
|
|
54
56
|
};
|
|
55
57
|
var Background = function Background(_ref) {
|
|
56
58
|
var width = _ref.width,
|
|
@@ -69,7 +71,8 @@ var Background = function Background(_ref) {
|
|
|
69
71
|
children = _ref.children,
|
|
70
72
|
loadingMode = _ref.loadingMode,
|
|
71
73
|
shouldLoad = _ref.shouldLoad,
|
|
72
|
-
withoutVideo = _ref.withoutVideo
|
|
74
|
+
withoutVideo = _ref.withoutVideo,
|
|
75
|
+
forceMuted = _ref.forceMuted;
|
|
73
76
|
var _ref2 = media || {},
|
|
74
77
|
_ref2$type = _ref2.type,
|
|
75
78
|
mediaType = _ref2$type === void 0 ? null : _ref2$type,
|
|
@@ -143,10 +146,11 @@ var Background = function Background(_ref) {
|
|
|
143
146
|
}, /*#__PURE__*/React.createElement(Video, {
|
|
144
147
|
className: styles.video,
|
|
145
148
|
media: media,
|
|
146
|
-
mediaRef: mediaRef,
|
|
149
|
+
mediaRef: !forceMuted ? mediaRef : null,
|
|
147
150
|
paused: !playing,
|
|
148
|
-
muted: muted,
|
|
151
|
+
muted: muted || forceMuted,
|
|
149
152
|
shouldLoad: shouldLoad,
|
|
153
|
+
disablePictureInPicture: true,
|
|
150
154
|
autoPlay: true,
|
|
151
155
|
loop: true,
|
|
152
156
|
withPoster: true
|
package/lib/index.js
CHANGED
|
@@ -45,7 +45,8 @@ var propTypes$1 = {
|
|
|
45
45
|
children: PropTypes__default["default"].node,
|
|
46
46
|
loadingMode: PropTypes__default["default"].string,
|
|
47
47
|
shouldLoad: PropTypes__default["default"].bool,
|
|
48
|
-
withoutVideo: PropTypes__default["default"].bool
|
|
48
|
+
withoutVideo: PropTypes__default["default"].bool,
|
|
49
|
+
forceMuted: PropTypes__default["default"].bool
|
|
49
50
|
};
|
|
50
51
|
var defaultProps$1 = {
|
|
51
52
|
width: null,
|
|
@@ -64,7 +65,8 @@ var defaultProps$1 = {
|
|
|
64
65
|
children: null,
|
|
65
66
|
loadingMode: 'lazy',
|
|
66
67
|
shouldLoad: true,
|
|
67
|
-
withoutVideo: false
|
|
68
|
+
withoutVideo: false,
|
|
69
|
+
forceMuted: false
|
|
68
70
|
};
|
|
69
71
|
var Background = function Background(_ref) {
|
|
70
72
|
var width = _ref.width,
|
|
@@ -83,7 +85,8 @@ var Background = function Background(_ref) {
|
|
|
83
85
|
children = _ref.children,
|
|
84
86
|
loadingMode = _ref.loadingMode,
|
|
85
87
|
shouldLoad = _ref.shouldLoad,
|
|
86
|
-
withoutVideo = _ref.withoutVideo
|
|
88
|
+
withoutVideo = _ref.withoutVideo,
|
|
89
|
+
forceMuted = _ref.forceMuted;
|
|
87
90
|
var _ref2 = media || {},
|
|
88
91
|
_ref2$type = _ref2.type,
|
|
89
92
|
mediaType = _ref2$type === void 0 ? null : _ref2$type,
|
|
@@ -157,10 +160,11 @@ var Background = function Background(_ref) {
|
|
|
157
160
|
}, /*#__PURE__*/React__default["default"].createElement(Video__default["default"], {
|
|
158
161
|
className: styles.video,
|
|
159
162
|
media: media,
|
|
160
|
-
mediaRef: mediaRef,
|
|
163
|
+
mediaRef: !forceMuted ? mediaRef : null,
|
|
161
164
|
paused: !playing,
|
|
162
|
-
muted: muted,
|
|
165
|
+
muted: muted || forceMuted,
|
|
163
166
|
shouldLoad: shouldLoad,
|
|
167
|
+
disablePictureInPicture: true,
|
|
164
168
|
autoPlay: true,
|
|
165
169
|
loop: true,
|
|
166
170
|
withPoster: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-background",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.403",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@babel/runtime": "^7.13.10",
|
|
51
51
|
"@folklore/size": "^0.1.20",
|
|
52
|
-
"@micromag/core": "^0.3.
|
|
53
|
-
"@micromag/element-video": "^0.3.
|
|
52
|
+
"@micromag/core": "^0.3.403",
|
|
53
|
+
"@micromag/element-video": "^0.3.403",
|
|
54
54
|
"classnames": "^2.2.6",
|
|
55
55
|
"lodash": "^4.17.21",
|
|
56
56
|
"prop-types": "^15.7.2",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"access": "public",
|
|
62
62
|
"registry": "https://registry.npmjs.org/"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "3179202a6bd721978ed10d9282b904045770189b"
|
|
65
65
|
}
|