@micromag/element-background 0.3.463 → 0.3.471
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 +12 -4
- package/lib/index.js +12 -4
- package/package.json +4 -4
package/es/index.js
CHANGED
|
@@ -31,6 +31,7 @@ var propTypes$1 = {
|
|
|
31
31
|
children: PropTypes.node,
|
|
32
32
|
loadingMode: PropTypes.string,
|
|
33
33
|
shouldLoad: PropTypes.bool,
|
|
34
|
+
onPlayError: PropTypes.func,
|
|
34
35
|
withoutVideo: PropTypes.bool,
|
|
35
36
|
forceMuted: PropTypes.bool
|
|
36
37
|
};
|
|
@@ -51,6 +52,7 @@ var defaultProps$1 = {
|
|
|
51
52
|
children: null,
|
|
52
53
|
loadingMode: 'lazy',
|
|
53
54
|
shouldLoad: true,
|
|
55
|
+
onPlayError: null,
|
|
54
56
|
withoutVideo: false,
|
|
55
57
|
forceMuted: false
|
|
56
58
|
};
|
|
@@ -71,6 +73,7 @@ var Background = function Background(_ref) {
|
|
|
71
73
|
children = _ref.children,
|
|
72
74
|
loadingMode = _ref.loadingMode,
|
|
73
75
|
shouldLoad = _ref.shouldLoad,
|
|
76
|
+
onPlayError = _ref.onPlayError,
|
|
74
77
|
withoutVideo = _ref.withoutVideo,
|
|
75
78
|
forceMuted = _ref.forceMuted;
|
|
76
79
|
var _ref2 = media || {},
|
|
@@ -150,6 +153,7 @@ var Background = function Background(_ref) {
|
|
|
150
153
|
paused: !playing,
|
|
151
154
|
muted: muted || forceMuted,
|
|
152
155
|
shouldLoad: shouldLoad,
|
|
156
|
+
onPlayError: onPlayError,
|
|
153
157
|
disablePictureInPicture: true,
|
|
154
158
|
autoPlay: true,
|
|
155
159
|
loop: true,
|
|
@@ -179,7 +183,8 @@ var propTypes = {
|
|
|
179
183
|
current: PropTypes.any
|
|
180
184
|
})]),
|
|
181
185
|
shouldLoad: PropTypes.bool,
|
|
182
|
-
withoutVideo: PropTypes.bool
|
|
186
|
+
withoutVideo: PropTypes.bool,
|
|
187
|
+
onPlayError: PropTypes.bool
|
|
183
188
|
};
|
|
184
189
|
var defaultProps = {
|
|
185
190
|
width: null,
|
|
@@ -195,7 +200,8 @@ var defaultProps = {
|
|
|
195
200
|
loadingMode: 'lazy',
|
|
196
201
|
mediaRef: null,
|
|
197
202
|
shouldLoad: true,
|
|
198
|
-
withoutVideo: false
|
|
203
|
+
withoutVideo: false,
|
|
204
|
+
onPlayError: null
|
|
199
205
|
};
|
|
200
206
|
var BackgroundLayers = function BackgroundLayers(_ref) {
|
|
201
207
|
var width = _ref.width,
|
|
@@ -211,7 +217,8 @@ var BackgroundLayers = function BackgroundLayers(_ref) {
|
|
|
211
217
|
loadingMode = _ref.loadingMode,
|
|
212
218
|
mediaRef = _ref.mediaRef,
|
|
213
219
|
shouldLoad = _ref.shouldLoad,
|
|
214
|
-
withoutVideo = _ref.withoutVideo
|
|
220
|
+
withoutVideo = _ref.withoutVideo,
|
|
221
|
+
onPlayError = _ref.onPlayError;
|
|
215
222
|
var hasSize = width > 0 && height > 0;
|
|
216
223
|
var layers = useMemo(function () {
|
|
217
224
|
return getLayersFromBackground(background);
|
|
@@ -255,7 +262,8 @@ var BackgroundLayers = function BackgroundLayers(_ref) {
|
|
|
255
262
|
loadingMode: loadingMode,
|
|
256
263
|
shouldLoad: shouldLoad,
|
|
257
264
|
mediaRef: mediaRef,
|
|
258
|
-
withoutVideo: withoutVideo
|
|
265
|
+
withoutVideo: withoutVideo,
|
|
266
|
+
onPlayError: onPlayError
|
|
259
267
|
}, layer)));
|
|
260
268
|
})), /*#__PURE__*/React.createElement("div", {
|
|
261
269
|
className: styles.content
|
package/lib/index.js
CHANGED
|
@@ -35,6 +35,7 @@ var propTypes$1 = {
|
|
|
35
35
|
children: PropTypes.node,
|
|
36
36
|
loadingMode: PropTypes.string,
|
|
37
37
|
shouldLoad: PropTypes.bool,
|
|
38
|
+
onPlayError: PropTypes.func,
|
|
38
39
|
withoutVideo: PropTypes.bool,
|
|
39
40
|
forceMuted: PropTypes.bool
|
|
40
41
|
};
|
|
@@ -55,6 +56,7 @@ var defaultProps$1 = {
|
|
|
55
56
|
children: null,
|
|
56
57
|
loadingMode: 'lazy',
|
|
57
58
|
shouldLoad: true,
|
|
59
|
+
onPlayError: null,
|
|
58
60
|
withoutVideo: false,
|
|
59
61
|
forceMuted: false
|
|
60
62
|
};
|
|
@@ -75,6 +77,7 @@ var Background = function Background(_ref) {
|
|
|
75
77
|
children = _ref.children,
|
|
76
78
|
loadingMode = _ref.loadingMode,
|
|
77
79
|
shouldLoad = _ref.shouldLoad,
|
|
80
|
+
onPlayError = _ref.onPlayError,
|
|
78
81
|
withoutVideo = _ref.withoutVideo,
|
|
79
82
|
forceMuted = _ref.forceMuted;
|
|
80
83
|
var _ref2 = media || {},
|
|
@@ -154,6 +157,7 @@ var Background = function Background(_ref) {
|
|
|
154
157
|
paused: !playing,
|
|
155
158
|
muted: muted || forceMuted,
|
|
156
159
|
shouldLoad: shouldLoad,
|
|
160
|
+
onPlayError: onPlayError,
|
|
157
161
|
disablePictureInPicture: true,
|
|
158
162
|
autoPlay: true,
|
|
159
163
|
loop: true,
|
|
@@ -183,7 +187,8 @@ var propTypes = {
|
|
|
183
187
|
current: PropTypes.any
|
|
184
188
|
})]),
|
|
185
189
|
shouldLoad: PropTypes.bool,
|
|
186
|
-
withoutVideo: PropTypes.bool
|
|
190
|
+
withoutVideo: PropTypes.bool,
|
|
191
|
+
onPlayError: PropTypes.bool
|
|
187
192
|
};
|
|
188
193
|
var defaultProps = {
|
|
189
194
|
width: null,
|
|
@@ -199,7 +204,8 @@ var defaultProps = {
|
|
|
199
204
|
loadingMode: 'lazy',
|
|
200
205
|
mediaRef: null,
|
|
201
206
|
shouldLoad: true,
|
|
202
|
-
withoutVideo: false
|
|
207
|
+
withoutVideo: false,
|
|
208
|
+
onPlayError: null
|
|
203
209
|
};
|
|
204
210
|
var BackgroundLayers = function BackgroundLayers(_ref) {
|
|
205
211
|
var width = _ref.width,
|
|
@@ -215,7 +221,8 @@ var BackgroundLayers = function BackgroundLayers(_ref) {
|
|
|
215
221
|
loadingMode = _ref.loadingMode,
|
|
216
222
|
mediaRef = _ref.mediaRef,
|
|
217
223
|
shouldLoad = _ref.shouldLoad,
|
|
218
|
-
withoutVideo = _ref.withoutVideo
|
|
224
|
+
withoutVideo = _ref.withoutVideo,
|
|
225
|
+
onPlayError = _ref.onPlayError;
|
|
219
226
|
var hasSize = width > 0 && height > 0;
|
|
220
227
|
var layers = React.useMemo(function () {
|
|
221
228
|
return utils.getLayersFromBackground(background);
|
|
@@ -259,7 +266,8 @@ var BackgroundLayers = function BackgroundLayers(_ref) {
|
|
|
259
266
|
loadingMode: loadingMode,
|
|
260
267
|
shouldLoad: shouldLoad,
|
|
261
268
|
mediaRef: mediaRef,
|
|
262
|
-
withoutVideo: withoutVideo
|
|
269
|
+
withoutVideo: withoutVideo,
|
|
270
|
+
onPlayError: onPlayError
|
|
263
271
|
}, layer)));
|
|
264
272
|
})), /*#__PURE__*/React.createElement("div", {
|
|
265
273
|
className: styles.content
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-background",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.471",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@babel/runtime": "^7.13.10",
|
|
59
59
|
"@folklore/size": "^0.1.20",
|
|
60
|
-
"@micromag/core": "^0.3.
|
|
61
|
-
"@micromag/element-video": "^0.3.
|
|
60
|
+
"@micromag/core": "^0.3.465",
|
|
61
|
+
"@micromag/element-video": "^0.3.465",
|
|
62
62
|
"classnames": "^2.2.6",
|
|
63
63
|
"lodash": "^4.17.21",
|
|
64
64
|
"prop-types": "^15.7.2",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"access": "public",
|
|
70
70
|
"registry": "https://registry.npmjs.org/"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "6b03fab564117f8cc3175c9759047c44e03e4987"
|
|
73
73
|
}
|