@micromag/screen-video 0.3.144 → 0.3.147
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 +19 -13
- package/lib/index.js +19 -13
- package/package.json +11 -11
package/es/index.js
CHANGED
|
@@ -288,25 +288,31 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
288
288
|
}, [videoUrl, hasVideoUrl, setReady]);
|
|
289
289
|
var onVideoReady = useCallback(function () {
|
|
290
290
|
setReady(true);
|
|
291
|
-
}, [setReady]);
|
|
292
|
-
|
|
293
|
-
|
|
291
|
+
}, [setReady]);
|
|
292
|
+
/**
|
|
293
|
+
* if video can play, but:
|
|
294
|
+
* - it's the current screen
|
|
295
|
+
* - the video doesn't provide visual controls
|
|
296
|
+
* - the video is set to play automatically
|
|
297
|
+
* - and it's **not** playing
|
|
298
|
+
* -> then set up a button that catches a click and plays the video
|
|
299
|
+
*/
|
|
294
300
|
|
|
295
301
|
var onCanPlay = useCallback(function () {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
}, [
|
|
302
|
+
if (current && !withControls && autoPlay && !playing) {
|
|
303
|
+
setAllowManualPlayOnTap(true);
|
|
304
|
+
}
|
|
305
|
+
}, [current, withControls, autoPlay, playing, play, allowManualPlayOnTap, setAllowManualPlayOnTap]);
|
|
306
|
+
var onForcePlay = useCallback(function (e) {
|
|
307
|
+
e.stopPropagation();
|
|
308
|
+
setAllowManualPlayOnTap(false);
|
|
309
|
+
play();
|
|
310
|
+
}, [setAllowManualPlayOnTap, play]);
|
|
305
311
|
var visibleControls = !autoPlay && !playing || muted || showMediaControls;
|
|
306
312
|
var items = [allowManualPlayOnTap ? /*#__PURE__*/React.createElement("button", {
|
|
307
313
|
key: "tap-catcher-button",
|
|
308
314
|
type: "button",
|
|
309
|
-
|
|
315
|
+
onClick: onForcePlay,
|
|
310
316
|
className: styles.unmuteAndPlayButton
|
|
311
317
|
}) : null, /*#__PURE__*/React.createElement(ScreenElement, {
|
|
312
318
|
key: "video",
|
package/lib/index.js
CHANGED
|
@@ -309,25 +309,31 @@ 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
|
-
|
|
312
|
+
}, [setReady]);
|
|
313
|
+
/**
|
|
314
|
+
* if video can play, but:
|
|
315
|
+
* - it's the current screen
|
|
316
|
+
* - the video doesn't provide visual controls
|
|
317
|
+
* - the video is set to play automatically
|
|
318
|
+
* - and it's **not** playing
|
|
319
|
+
* -> then set up a button that catches a click and plays the video
|
|
320
|
+
*/
|
|
315
321
|
|
|
316
322
|
var onCanPlay = React.useCallback(function () {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
}, [
|
|
323
|
+
if (current && !withControls && autoPlay && !playing) {
|
|
324
|
+
setAllowManualPlayOnTap(true);
|
|
325
|
+
}
|
|
326
|
+
}, [current, withControls, autoPlay, playing, play, allowManualPlayOnTap, setAllowManualPlayOnTap]);
|
|
327
|
+
var onForcePlay = React.useCallback(function (e) {
|
|
328
|
+
e.stopPropagation();
|
|
329
|
+
setAllowManualPlayOnTap(false);
|
|
330
|
+
play();
|
|
331
|
+
}, [setAllowManualPlayOnTap, play]);
|
|
326
332
|
var visibleControls = !autoPlay && !playing || muted || showMediaControls;
|
|
327
333
|
var items = [allowManualPlayOnTap ? /*#__PURE__*/React__default["default"].createElement("button", {
|
|
328
334
|
key: "tap-catcher-button",
|
|
329
335
|
type: "button",
|
|
330
|
-
|
|
336
|
+
onClick: onForcePlay,
|
|
331
337
|
className: styles.unmuteAndPlayButton
|
|
332
338
|
}) : null, /*#__PURE__*/React__default["default"].createElement(components.ScreenElement, {
|
|
333
339
|
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.147",
|
|
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.
|
|
54
|
-
"@micromag/element-background": "^0.3.
|
|
55
|
-
"@micromag/element-call-to-action": "^0.3.
|
|
56
|
-
"@micromag/element-closed-captions": "^0.3.
|
|
57
|
-
"@micromag/element-container": "^0.3.
|
|
58
|
-
"@micromag/element-image": "^0.3.
|
|
59
|
-
"@micromag/element-media-controls": "^0.3.
|
|
60
|
-
"@micromag/element-video": "^0.3.
|
|
61
|
-
"@micromag/transforms": "^0.3.
|
|
53
|
+
"@micromag/core": "^0.3.147",
|
|
54
|
+
"@micromag/element-background": "^0.3.147",
|
|
55
|
+
"@micromag/element-call-to-action": "^0.3.147",
|
|
56
|
+
"@micromag/element-closed-captions": "^0.3.147",
|
|
57
|
+
"@micromag/element-container": "^0.3.147",
|
|
58
|
+
"@micromag/element-image": "^0.3.147",
|
|
59
|
+
"@micromag/element-media-controls": "^0.3.147",
|
|
60
|
+
"@micromag/element-video": "^0.3.147",
|
|
61
|
+
"@micromag/transforms": "^0.3.147",
|
|
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": "
|
|
71
|
+
"gitHead": "695a66acc54f4863dc44a98f0471e8233ca10aee"
|
|
72
72
|
}
|