@micromag/screen-video 0.3.201 → 0.3.205

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
@@ -93,6 +93,8 @@ var VideoScreen = function VideoScreen(_ref) {
93
93
  var _ref2 = video || {},
94
94
  _ref2$autoPlay = _ref2.autoPlay,
95
95
  autoPlay = _ref2$autoPlay === void 0 ? true : _ref2$autoPlay,
96
+ _ref2$loop = _ref2.loop,
97
+ loop = _ref2$loop === void 0 ? false : _ref2$loop,
96
98
  _ref2$media = _ref2.media,
97
99
  videoMedia = _ref2$media === void 0 ? null : _ref2$media,
98
100
  _ref2$thumbnail = _ref2.thumbnail,
@@ -221,12 +223,14 @@ var VideoScreen = function VideoScreen(_ref) {
221
223
  }
222
224
  }, [trackScreenMedia, video]);
223
225
  var onEnded = useCallback(function () {
224
- setPlaying(false);
226
+ if (current && !loop) {
227
+ setPlaying(false);
228
+ }
225
229
 
226
- if (shouldGotoNextScreenOnEnd) {
230
+ if (current && shouldGotoNextScreenOnEnd) {
227
231
  gotoNextScreen();
228
232
  }
229
- }, [current, shouldGotoNextScreenOnEnd, gotoNextScreen]);
233
+ }, [loop, current, shouldGotoNextScreenOnEnd, gotoNextScreen]);
230
234
  var fullscreen = layout === 'full';
231
235
  var hasCallToAction = callToAction !== null && callToAction.active === true;
232
236
  var hasVideo = video !== null;
@@ -281,10 +285,10 @@ var VideoScreen = function VideoScreen(_ref) {
281
285
  setReady(true);
282
286
  }, [setReady]);
283
287
  var onSuspended = useCallback(function () {
284
- if (playing) {
288
+ if (playing && current) {
285
289
  setPlaying(false);
286
290
  }
287
- }, [playing, setPlaying]);
291
+ }, [current, playing, setPlaying]);
288
292
  var items = [/*#__PURE__*/React.createElement(ScreenElement, {
289
293
  key: "video",
290
294
  placeholder: /*#__PURE__*/React.createElement(PlaceholderVideo, Object.assign({
package/lib/index.js CHANGED
@@ -113,6 +113,8 @@ var VideoScreen = function VideoScreen(_ref) {
113
113
  var _ref2 = video || {},
114
114
  _ref2$autoPlay = _ref2.autoPlay,
115
115
  autoPlay = _ref2$autoPlay === void 0 ? true : _ref2$autoPlay,
116
+ _ref2$loop = _ref2.loop,
117
+ loop = _ref2$loop === void 0 ? false : _ref2$loop,
116
118
  _ref2$media = _ref2.media,
117
119
  videoMedia = _ref2$media === void 0 ? null : _ref2$media,
118
120
  _ref2$thumbnail = _ref2.thumbnail,
@@ -241,12 +243,14 @@ var VideoScreen = function VideoScreen(_ref) {
241
243
  }
242
244
  }, [trackScreenMedia, video]);
243
245
  var onEnded = React.useCallback(function () {
244
- setPlaying(false);
246
+ if (current && !loop) {
247
+ setPlaying(false);
248
+ }
245
249
 
246
- if (shouldGotoNextScreenOnEnd) {
250
+ if (current && shouldGotoNextScreenOnEnd) {
247
251
  gotoNextScreen();
248
252
  }
249
- }, [current, shouldGotoNextScreenOnEnd, gotoNextScreen]);
253
+ }, [loop, current, shouldGotoNextScreenOnEnd, gotoNextScreen]);
250
254
  var fullscreen = layout === 'full';
251
255
  var hasCallToAction = callToAction !== null && callToAction.active === true;
252
256
  var hasVideo = video !== null;
@@ -301,10 +305,10 @@ var VideoScreen = function VideoScreen(_ref) {
301
305
  setReady(true);
302
306
  }, [setReady]);
303
307
  var onSuspended = React.useCallback(function () {
304
- if (playing) {
308
+ if (playing && current) {
305
309
  setPlaying(false);
306
310
  }
307
- }, [playing, setPlaying]);
311
+ }, [current, playing, setPlaying]);
308
312
  var items = [/*#__PURE__*/React__default["default"].createElement(components.ScreenElement, {
309
313
  key: "video",
310
314
  placeholder: /*#__PURE__*/React__default["default"].createElement(components.PlaceholderVideo, Object.assign({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-video",
3
- "version": "0.3.201",
3
+ "version": "0.3.205",
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.196",
54
- "@micromag/element-background": "^0.3.200",
55
- "@micromag/element-call-to-action": "^0.3.196",
56
- "@micromag/element-closed-captions": "^0.3.196",
57
- "@micromag/element-container": "^0.3.196",
58
- "@micromag/element-image": "^0.3.196",
59
- "@micromag/element-media-controls": "^0.3.196",
60
- "@micromag/element-video": "^0.3.200",
61
- "@micromag/transforms": "^0.3.196",
53
+ "@micromag/core": "^0.3.205",
54
+ "@micromag/element-background": "^0.3.205",
55
+ "@micromag/element-call-to-action": "^0.3.205",
56
+ "@micromag/element-closed-captions": "^0.3.205",
57
+ "@micromag/element-container": "^0.3.205",
58
+ "@micromag/element-image": "^0.3.205",
59
+ "@micromag/element-media-controls": "^0.3.205",
60
+ "@micromag/element-video": "^0.3.205",
61
+ "@micromag/transforms": "^0.3.205",
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": "b1decf8f5598fce5ddcd470b3c801b8f73358d27"
71
+ "gitHead": "6611334d21b32d4882928b0bd66d98deda386702"
72
72
  }