@micromag/element-video 0.3.790 → 0.3.792
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 +3 -1
- package/package.json +2 -2
package/es/index.js
CHANGED
|
@@ -265,6 +265,7 @@ var Video = function Video(_ref) {
|
|
|
265
265
|
}, [ready, onReady]);
|
|
266
266
|
var finalPreload = shouldLoad ? preload : 'none';
|
|
267
267
|
var preloadRef = useRef(finalPreload);
|
|
268
|
+
var hasPlayedRef = useRef(false);
|
|
268
269
|
useEffect(function () {
|
|
269
270
|
var _ref$current2 = _ref6.current,
|
|
270
271
|
element = _ref$current2 === void 0 ? null : _ref$current2;
|
|
@@ -279,6 +280,7 @@ var Video = function Video(_ref) {
|
|
|
279
280
|
element.load();
|
|
280
281
|
preloadRef.current = finalPreload;
|
|
281
282
|
}
|
|
283
|
+
hasPlayedRef.current = true;
|
|
282
284
|
element.play()["catch"](function (e) {
|
|
283
285
|
if (onPlayError !== null) {
|
|
284
286
|
onPlayError(e);
|
|
@@ -315,7 +317,7 @@ var Video = function Video(_ref) {
|
|
|
315
317
|
}
|
|
316
318
|
},
|
|
317
319
|
src: sources === null && shouldLoad ? "".concat(mediaUrl, "#t=0.001") : null,
|
|
318
|
-
autoPlay: autoPlay && !paused,
|
|
320
|
+
autoPlay: autoPlay && !paused && !hasPlayedRef.current && muted,
|
|
319
321
|
loop: loop,
|
|
320
322
|
muted: muted,
|
|
321
323
|
poster: shouldLoad && withPoster && finalThumbnail !== null ? finalThumbnail.url || null : null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-video",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.792",
|
|
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": "
|
|
75
|
+
"gitHead": "0212271243811112db66fe3393287da15ff28384"
|
|
76
76
|
}
|