@micromag/element-video 0.3.789 → 0.3.790

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.
Files changed (2) hide show
  1. package/es/index.js +7 -1
  2. package/package.json +2 -2
package/es/index.js CHANGED
@@ -263,6 +263,8 @@ var Video = function Video(_ref) {
263
263
  onReady();
264
264
  }
265
265
  }, [ready, onReady]);
266
+ var finalPreload = shouldLoad ? preload : 'none';
267
+ var preloadRef = useRef(finalPreload);
266
268
  useEffect(function () {
267
269
  var _ref$current2 = _ref6.current,
268
270
  element = _ref$current2 === void 0 ? null : _ref$current2;
@@ -273,6 +275,10 @@ var Video = function Video(_ref) {
273
275
  if (paused && !isPaused) {
274
276
  element.pause();
275
277
  } else if (!paused && isPaused) {
278
+ if (preloadRef.current === 'none') {
279
+ element.load();
280
+ preloadRef.current = finalPreload;
281
+ }
276
282
  element.play()["catch"](function (e) {
277
283
  if (onPlayError !== null) {
278
284
  onPlayError(e);
@@ -313,7 +319,7 @@ var Video = function Video(_ref) {
313
319
  loop: loop,
314
320
  muted: muted,
315
321
  poster: shouldLoad && withPoster && finalThumbnail !== null ? finalThumbnail.url || null : null,
316
- preload: shouldLoad ? preload : 'none',
322
+ preload: finalPreload,
317
323
  playsInline: playsInline,
318
324
  crossOrigin: withoutCors ? 'anonymous' : null,
319
325
  disablePictureInPicture: disablePictureInPicture,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-video",
3
- "version": "0.3.789",
3
+ "version": "0.3.790",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -72,5 +72,5 @@
72
72
  "access": "public",
73
73
  "registry": "https://registry.npmjs.org/"
74
74
  },
75
- "gitHead": "60eb4574b9d13a985e7cd317429c06c1f98ab275"
75
+ "gitHead": "f9c93340504b38edd9716cf8173d5420e52f273a"
76
76
  }