@micromag/element-visual 0.3.147 → 0.3.152

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
@@ -11,14 +11,19 @@ import Video from '@micromag/element-video';
11
11
 
12
12
  var styles = {"container":"micromag-element-visual-container","videoContainer":"micromag-element-visual-videoContainer"};
13
13
 
14
- var _excluded = ["media", "width", "height", "resolution", "objectFit", "playing", "shouldLoad", "videoLoop", "videoInitialMuted", "onLoaded", "className", "videoClassName"];
14
+ var _excluded = ["media", "mediaRef", "width", "height", "resolution", "objectFit", "playing", "muted", "shouldLoad", "videoLoop", "videoInitialMuted", "onLoaded", "className", "videoClassName"];
15
15
  var propTypes = {
16
16
  media: PropTypes.media,
17
+ mediaRef: PropTypes$1.oneOfType([PropTypes$1.func, PropTypes$1.shape({
18
+ // eslint-disable-next-line react/forbid-prop-types
19
+ current: PropTypes$1.any
20
+ })]),
17
21
  width: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.string]),
18
22
  height: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.string]),
19
23
  resolution: PropTypes$1.number,
20
24
  objectFit: PropTypes.objectFit,
21
25
  playing: PropTypes$1.bool,
26
+ muted: PropTypes$1.bool,
22
27
  shouldLoad: PropTypes$1.bool,
23
28
  videoLoop: PropTypes$1.bool,
24
29
  videoInitialMuted: PropTypes$1.bool,
@@ -28,11 +33,13 @@ var propTypes = {
28
33
  };
29
34
  var defaultProps = {
30
35
  media: null,
36
+ mediaRef: null,
31
37
  width: null,
32
38
  height: null,
33
39
  resolution: 1,
34
40
  objectFit: null,
35
41
  playing: true,
42
+ muted: true,
36
43
  shouldLoad: true,
37
44
  videoLoop: true,
38
45
  videoInitialMuted: true,
@@ -43,15 +50,17 @@ var defaultProps = {
43
50
 
44
51
  var Visual = function Visual(_ref) {
45
52
  var media = _ref.media,
53
+ mediaRef = _ref.mediaRef,
46
54
  width = _ref.width,
47
55
  height = _ref.height,
48
56
  resolution = _ref.resolution,
49
57
  objectFit = _ref.objectFit,
50
58
  playing = _ref.playing,
59
+ muted = _ref.muted,
51
60
  shouldLoad = _ref.shouldLoad,
52
- videoLoop = _ref.videoLoop,
53
- videoInitialMuted = _ref.videoInitialMuted,
54
- onParentLoaded = _ref.onLoaded,
61
+ videoLoop = _ref.videoLoop;
62
+ _ref.videoInitialMuted;
63
+ var onParentLoaded = _ref.onLoaded,
55
64
  className = _ref.className,
56
65
  videoClassName = _ref.videoClassName,
57
66
  props = _objectWithoutProperties(_ref, _excluded);
@@ -138,13 +147,15 @@ var Visual = function Visual(_ref) {
138
147
  className: classNames([styles.videoContainer, _defineProperty({}, videoClassName, videoClassName !== null)]),
139
148
  style: videoContainerStyle
140
149
  }, /*#__PURE__*/React.createElement(Video, Object.assign({}, elProps, {
150
+ mediaRef: mediaRef,
141
151
  width: objectFit === null ? width : null,
142
152
  height: objectFit === null ? height : null,
143
- autoPlay: playing,
153
+ paused: !playing,
154
+ muted: muted,
144
155
  loop: videoLoop,
145
156
  shouldLoad: shouldLoad,
146
- initialMuted: videoInitialMuted,
147
- onReady: onLoaded
157
+ onReady: onLoaded,
158
+ autoPlay: true
148
159
  })))) : null) : null;
149
160
  };
150
161
 
package/lib/index.js CHANGED
@@ -24,14 +24,19 @@ var Video__default = /*#__PURE__*/_interopDefaultLegacy(Video);
24
24
 
25
25
  var styles = {"container":"micromag-element-visual-container","videoContainer":"micromag-element-visual-videoContainer"};
26
26
 
27
- var _excluded = ["media", "width", "height", "resolution", "objectFit", "playing", "shouldLoad", "videoLoop", "videoInitialMuted", "onLoaded", "className", "videoClassName"];
27
+ var _excluded = ["media", "mediaRef", "width", "height", "resolution", "objectFit", "playing", "muted", "shouldLoad", "videoLoop", "videoInitialMuted", "onLoaded", "className", "videoClassName"];
28
28
  var propTypes = {
29
29
  media: core.PropTypes.media,
30
+ mediaRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].shape({
31
+ // eslint-disable-next-line react/forbid-prop-types
32
+ current: PropTypes__default["default"].any
33
+ })]),
30
34
  width: PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string]),
31
35
  height: PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string]),
32
36
  resolution: PropTypes__default["default"].number,
33
37
  objectFit: core.PropTypes.objectFit,
34
38
  playing: PropTypes__default["default"].bool,
39
+ muted: PropTypes__default["default"].bool,
35
40
  shouldLoad: PropTypes__default["default"].bool,
36
41
  videoLoop: PropTypes__default["default"].bool,
37
42
  videoInitialMuted: PropTypes__default["default"].bool,
@@ -41,11 +46,13 @@ var propTypes = {
41
46
  };
42
47
  var defaultProps = {
43
48
  media: null,
49
+ mediaRef: null,
44
50
  width: null,
45
51
  height: null,
46
52
  resolution: 1,
47
53
  objectFit: null,
48
54
  playing: true,
55
+ muted: true,
49
56
  shouldLoad: true,
50
57
  videoLoop: true,
51
58
  videoInitialMuted: true,
@@ -56,15 +63,17 @@ var defaultProps = {
56
63
 
57
64
  var Visual = function Visual(_ref) {
58
65
  var media = _ref.media,
66
+ mediaRef = _ref.mediaRef,
59
67
  width = _ref.width,
60
68
  height = _ref.height,
61
69
  resolution = _ref.resolution,
62
70
  objectFit = _ref.objectFit,
63
71
  playing = _ref.playing,
72
+ muted = _ref.muted,
64
73
  shouldLoad = _ref.shouldLoad,
65
- videoLoop = _ref.videoLoop,
66
- videoInitialMuted = _ref.videoInitialMuted,
67
- onParentLoaded = _ref.onLoaded,
74
+ videoLoop = _ref.videoLoop;
75
+ _ref.videoInitialMuted;
76
+ var onParentLoaded = _ref.onLoaded,
68
77
  className = _ref.className,
69
78
  videoClassName = _ref.videoClassName,
70
79
  props = _objectWithoutProperties__default["default"](_ref, _excluded);
@@ -151,13 +160,15 @@ var Visual = function Visual(_ref) {
151
160
  className: classNames__default["default"]([styles.videoContainer, _defineProperty__default["default"]({}, videoClassName, videoClassName !== null)]),
152
161
  style: videoContainerStyle
153
162
  }, /*#__PURE__*/React__default["default"].createElement(Video__default["default"], Object.assign({}, elProps, {
163
+ mediaRef: mediaRef,
154
164
  width: objectFit === null ? width : null,
155
165
  height: objectFit === null ? height : null,
156
- autoPlay: playing,
166
+ paused: !playing,
167
+ muted: muted,
157
168
  loop: videoLoop,
158
169
  shouldLoad: shouldLoad,
159
- initialMuted: videoInitialMuted,
160
- onReady: onLoaded
170
+ onReady: onLoaded,
171
+ autoPlay: true
161
172
  })))) : null) : null;
162
173
  };
163
174
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-visual",
3
- "version": "0.3.147",
3
+ "version": "0.3.152",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -50,9 +50,9 @@
50
50
  "dependencies": {
51
51
  "@babel/runtime": "^7.13.10",
52
52
  "@folklore/size": "^0.1.20",
53
- "@micromag/core": "^0.3.147",
54
- "@micromag/element-image": "^0.3.147",
55
- "@micromag/element-video": "^0.3.147",
53
+ "@micromag/core": "^0.3.152",
54
+ "@micromag/element-image": "^0.3.152",
55
+ "@micromag/element-video": "^0.3.152",
56
56
  "classnames": "^2.2.6",
57
57
  "prop-types": "^15.7.2",
58
58
  "uuid": "^8.3.2"
@@ -60,5 +60,5 @@
60
60
  "publishConfig": {
61
61
  "access": "public"
62
62
  },
63
- "gitHead": "695a66acc54f4863dc44a98f0471e8233ca10aee"
63
+ "gitHead": "23db6c104c10cc70a73366c8b04576a312a36206"
64
64
  }