@micromag/screen-video 0.3.134 → 0.3.138
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 +21 -17
- package/lib/index.js +21 -17
- package/package.json +11 -11
package/es/index.js
CHANGED
|
@@ -117,6 +117,7 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
117
117
|
seek = _ref3.seek,
|
|
118
118
|
play = _ref3.play,
|
|
119
119
|
pause = _ref3.pause,
|
|
120
|
+
suspended = _ref3.suspended,
|
|
120
121
|
_ref3$mediaRef = _ref3.mediaRef,
|
|
121
122
|
apiMediaRef = _ref3$mediaRef === void 0 ? null : _ref3$mediaRef;
|
|
122
123
|
|
|
@@ -287,19 +288,26 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
287
288
|
setReady(!hasVideoUrl);
|
|
288
289
|
}, [videoUrl, hasVideoUrl, setReady]);
|
|
289
290
|
var onVideoReady = useCallback(function () {
|
|
290
|
-
setReady(true);
|
|
291
|
-
}, [setReady]);
|
|
292
|
-
useEffect(function () {
|
|
293
|
-
var checkPlayStatus = setTimeout(function () {
|
|
294
|
-
if (current && ready && autoPlay && !playing && apiMediaRef) {
|
|
295
|
-
setShouldCatchFirstTapToPlay(true);
|
|
296
|
-
}
|
|
297
|
-
}, 200); // @todo?
|
|
291
|
+
setReady(true); // @todo the battery-saving play button issue
|
|
298
292
|
|
|
299
|
-
|
|
300
|
-
|
|
293
|
+
if (autoPlay && suspended) {
|
|
294
|
+
setShouldCatchFirstTapToPlay(true);
|
|
295
|
+
}
|
|
296
|
+
}, [setReady, autoPlay, suspended, setShouldCatchFirstTapToPlay]);
|
|
297
|
+
var onSuspended = useCallback(function () {
|
|
298
|
+
if (autoPlay && suspended) {
|
|
299
|
+
setShouldCatchFirstTapToPlay(true);
|
|
300
|
+
}
|
|
301
|
+
}, [autoPlay, suspended, setShouldCatchFirstTapToPlay]);
|
|
301
302
|
var visibleControls = !autoPlay && !playing || muted || showMediaControls;
|
|
302
|
-
var items = [/*#__PURE__*/React.createElement(
|
|
303
|
+
var items = [shouldCatchFirstTapToPlay && suspended ? /*#__PURE__*/React.createElement("button", {
|
|
304
|
+
key: "tap-catcher-button",
|
|
305
|
+
type: "button",
|
|
306
|
+
onTouchStart: function onTouchStart() {
|
|
307
|
+
return play();
|
|
308
|
+
},
|
|
309
|
+
className: styles.unmuteAndPlayButton
|
|
310
|
+
}) : null, /*#__PURE__*/React.createElement(ScreenElement, {
|
|
303
311
|
key: "video",
|
|
304
312
|
placeholder: /*#__PURE__*/React.createElement(PlaceholderVideo, Object.assign({
|
|
305
313
|
className: styles.placeholder
|
|
@@ -348,15 +356,11 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
348
356
|
onDurationChanged: onDurationChanged,
|
|
349
357
|
onSeeked: onSeeked,
|
|
350
358
|
onEnded: onEnded,
|
|
359
|
+
onSuspended: onSuspended,
|
|
351
360
|
onVolumeChanged: onVolumeChanged,
|
|
352
361
|
focusable: current && isView,
|
|
353
362
|
shouldLoad: mediaShouldLoad
|
|
354
|
-
}))) : null),
|
|
355
|
-
key: "tap-catcher-button",
|
|
356
|
-
type: "button",
|
|
357
|
-
onTouchStart: play,
|
|
358
|
-
className: styles.unmuteAndPlayButton
|
|
359
|
-
}) : null, !isPlaceholder ? /*#__PURE__*/React.createElement("div", {
|
|
363
|
+
}))) : null), !isPlaceholder ? /*#__PURE__*/React.createElement("div", {
|
|
360
364
|
key: "bottom-content",
|
|
361
365
|
className: styles.bottomContent
|
|
362
366
|
}, /*#__PURE__*/React.createElement(Transitions, {
|
package/lib/index.js
CHANGED
|
@@ -138,6 +138,7 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
138
138
|
seek = _ref3.seek,
|
|
139
139
|
play = _ref3.play,
|
|
140
140
|
pause = _ref3.pause,
|
|
141
|
+
suspended = _ref3.suspended,
|
|
141
142
|
_ref3$mediaRef = _ref3.mediaRef,
|
|
142
143
|
apiMediaRef = _ref3$mediaRef === void 0 ? null : _ref3$mediaRef;
|
|
143
144
|
|
|
@@ -308,19 +309,26 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
308
309
|
setReady(!hasVideoUrl);
|
|
309
310
|
}, [videoUrl, hasVideoUrl, setReady]);
|
|
310
311
|
var onVideoReady = React.useCallback(function () {
|
|
311
|
-
setReady(true);
|
|
312
|
-
}, [setReady]);
|
|
313
|
-
React.useEffect(function () {
|
|
314
|
-
var checkPlayStatus = setTimeout(function () {
|
|
315
|
-
if (current && ready && autoPlay && !playing && apiMediaRef) {
|
|
316
|
-
setShouldCatchFirstTapToPlay(true);
|
|
317
|
-
}
|
|
318
|
-
}, 200); // @todo?
|
|
312
|
+
setReady(true); // @todo the battery-saving play button issue
|
|
319
313
|
|
|
320
|
-
|
|
321
|
-
|
|
314
|
+
if (autoPlay && suspended) {
|
|
315
|
+
setShouldCatchFirstTapToPlay(true);
|
|
316
|
+
}
|
|
317
|
+
}, [setReady, autoPlay, suspended, setShouldCatchFirstTapToPlay]);
|
|
318
|
+
var onSuspended = React.useCallback(function () {
|
|
319
|
+
if (autoPlay && suspended) {
|
|
320
|
+
setShouldCatchFirstTapToPlay(true);
|
|
321
|
+
}
|
|
322
|
+
}, [autoPlay, suspended, setShouldCatchFirstTapToPlay]);
|
|
322
323
|
var visibleControls = !autoPlay && !playing || muted || showMediaControls;
|
|
323
|
-
var items = [/*#__PURE__*/React__default["default"].createElement(
|
|
324
|
+
var items = [shouldCatchFirstTapToPlay && suspended ? /*#__PURE__*/React__default["default"].createElement("button", {
|
|
325
|
+
key: "tap-catcher-button",
|
|
326
|
+
type: "button",
|
|
327
|
+
onTouchStart: function onTouchStart() {
|
|
328
|
+
return play();
|
|
329
|
+
},
|
|
330
|
+
className: styles.unmuteAndPlayButton
|
|
331
|
+
}) : null, /*#__PURE__*/React__default["default"].createElement(components.ScreenElement, {
|
|
324
332
|
key: "video",
|
|
325
333
|
placeholder: /*#__PURE__*/React__default["default"].createElement(components.PlaceholderVideo, Object.assign({
|
|
326
334
|
className: styles.placeholder
|
|
@@ -369,15 +377,11 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
369
377
|
onDurationChanged: onDurationChanged,
|
|
370
378
|
onSeeked: onSeeked,
|
|
371
379
|
onEnded: onEnded,
|
|
380
|
+
onSuspended: onSuspended,
|
|
372
381
|
onVolumeChanged: onVolumeChanged,
|
|
373
382
|
focusable: current && isView,
|
|
374
383
|
shouldLoad: mediaShouldLoad
|
|
375
|
-
}))) : null),
|
|
376
|
-
key: "tap-catcher-button",
|
|
377
|
-
type: "button",
|
|
378
|
-
onTouchStart: play,
|
|
379
|
-
className: styles.unmuteAndPlayButton
|
|
380
|
-
}) : null, !isPlaceholder ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
384
|
+
}))) : null), !isPlaceholder ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
381
385
|
key: "bottom-content",
|
|
382
386
|
className: styles.bottomContent
|
|
383
387
|
}, /*#__PURE__*/React__default["default"].createElement(components.Transitions, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-video",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.138",
|
|
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.138",
|
|
54
|
+
"@micromag/element-background": "^0.3.138",
|
|
55
|
+
"@micromag/element-call-to-action": "^0.3.138",
|
|
56
|
+
"@micromag/element-closed-captions": "^0.3.138",
|
|
57
|
+
"@micromag/element-container": "^0.3.138",
|
|
58
|
+
"@micromag/element-image": "^0.3.138",
|
|
59
|
+
"@micromag/element-media-controls": "^0.3.138",
|
|
60
|
+
"@micromag/element-video": "^0.3.138",
|
|
61
|
+
"@micromag/transforms": "^0.3.138",
|
|
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": "6460d58f8b915076249a11089a5f662ac11830fa"
|
|
72
72
|
}
|