@micromag/screen-video 0.3.144 → 0.3.145
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 +9 -13
- package/lib/index.js +9 -13
- package/package.json +2 -2
package/es/index.js
CHANGED
|
@@ -288,25 +288,21 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
288
288
|
}, [videoUrl, hasVideoUrl, setReady]);
|
|
289
289
|
var onVideoReady = useCallback(function () {
|
|
290
290
|
setReady(true);
|
|
291
|
-
}, [setReady]);
|
|
292
|
-
|
|
293
|
-
var AUTOPLAY_CHECK_DELAY = 1000; // @todo check if a timeout is needed?
|
|
294
|
-
|
|
291
|
+
}, [setReady]);
|
|
295
292
|
var onCanPlay = useCallback(function () {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}
|
|
300
|
-
}, AUTOPLAY_CHECK_DELAY);
|
|
301
|
-
return function () {
|
|
302
|
-
return clearTimeout(autoplayCheckTimeout);
|
|
303
|
-
};
|
|
293
|
+
if (current && autoPlay && !playing) {
|
|
294
|
+
setAllowManualPlayOnTap(true);
|
|
295
|
+
}
|
|
304
296
|
}, [current, autoPlay, playing, play, allowManualPlayOnTap, setAllowManualPlayOnTap]);
|
|
297
|
+
var onForcePlay = useCallback(function () {
|
|
298
|
+
setAllowManualPlayOnTap(false);
|
|
299
|
+
play();
|
|
300
|
+
}, [setAllowManualPlayOnTap, play]);
|
|
305
301
|
var visibleControls = !autoPlay && !playing || muted || showMediaControls;
|
|
306
302
|
var items = [allowManualPlayOnTap ? /*#__PURE__*/React.createElement("button", {
|
|
307
303
|
key: "tap-catcher-button",
|
|
308
304
|
type: "button",
|
|
309
|
-
onTouchStart:
|
|
305
|
+
onTouchStart: onForcePlay,
|
|
310
306
|
className: styles.unmuteAndPlayButton
|
|
311
307
|
}) : null, /*#__PURE__*/React.createElement(ScreenElement, {
|
|
312
308
|
key: "video",
|
package/lib/index.js
CHANGED
|
@@ -309,25 +309,21 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
309
309
|
}, [videoUrl, hasVideoUrl, setReady]);
|
|
310
310
|
var onVideoReady = React.useCallback(function () {
|
|
311
311
|
setReady(true);
|
|
312
|
-
}, [setReady]);
|
|
313
|
-
|
|
314
|
-
var AUTOPLAY_CHECK_DELAY = 1000; // @todo check if a timeout is needed?
|
|
315
|
-
|
|
312
|
+
}, [setReady]);
|
|
316
313
|
var onCanPlay = React.useCallback(function () {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
}
|
|
321
|
-
}, AUTOPLAY_CHECK_DELAY);
|
|
322
|
-
return function () {
|
|
323
|
-
return clearTimeout(autoplayCheckTimeout);
|
|
324
|
-
};
|
|
314
|
+
if (current && autoPlay && !playing) {
|
|
315
|
+
setAllowManualPlayOnTap(true);
|
|
316
|
+
}
|
|
325
317
|
}, [current, autoPlay, playing, play, allowManualPlayOnTap, setAllowManualPlayOnTap]);
|
|
318
|
+
var onForcePlay = React.useCallback(function () {
|
|
319
|
+
setAllowManualPlayOnTap(false);
|
|
320
|
+
play();
|
|
321
|
+
}, [setAllowManualPlayOnTap, play]);
|
|
326
322
|
var visibleControls = !autoPlay && !playing || muted || showMediaControls;
|
|
327
323
|
var items = [allowManualPlayOnTap ? /*#__PURE__*/React__default["default"].createElement("button", {
|
|
328
324
|
key: "tap-catcher-button",
|
|
329
325
|
type: "button",
|
|
330
|
-
onTouchStart:
|
|
326
|
+
onTouchStart: onForcePlay,
|
|
331
327
|
className: styles.unmuteAndPlayButton
|
|
332
328
|
}) : null, /*#__PURE__*/React__default["default"].createElement(components.ScreenElement, {
|
|
333
329
|
key: "video",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-video",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.145",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "2a108f03c2666189c35a226df90490c02b42e493"
|
|
72
72
|
}
|