@micromag/screen-video 0.3.113 → 0.3.119
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 +15 -6
- package/lib/index.js +14 -5
- package/package.json +11 -11
package/es/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import React, { useRef, useEffect, useState, useCallback, useMemo } from 'react'
|
|
|
9
9
|
import { PropTypes as PropTypes$1 } from '@micromag/core';
|
|
10
10
|
import { ScreenElement, PlaceholderVideo, Empty, Transitions } from '@micromag/core/components';
|
|
11
11
|
import { useScreenSize, useScreenRenderContext, useViewerNavigation } from '@micromag/core/contexts';
|
|
12
|
-
import { useTrackScreenMedia, useResizeObserver, useLongPress } from '@micromag/core/hooks';
|
|
12
|
+
import { useTrackScreenMedia, useResizeObserver, useLongPress, useMediaThumbnail } from '@micromag/core/hooks';
|
|
13
13
|
import Background from '@micromag/element-background';
|
|
14
14
|
import CallToAction from '@micromag/element-call-to-action';
|
|
15
15
|
import ClosedCaptions from '@micromag/element-closed-captions';
|
|
@@ -96,12 +96,18 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
96
96
|
autoPlay = _ref2$autoPlay === void 0 ? true : _ref2$autoPlay,
|
|
97
97
|
_ref2$media = _ref2.media,
|
|
98
98
|
videoMedia = _ref2$media === void 0 ? null : _ref2$media,
|
|
99
|
+
_ref2$thumbnailFile = _ref2.thumbnailFile,
|
|
100
|
+
thumbnailFile = _ref2$thumbnailFile === void 0 ? null : _ref2$thumbnailFile,
|
|
99
101
|
_ref2$closedCaptions = _ref2.closedCaptions,
|
|
100
102
|
closedCaptions = _ref2$closedCaptions === void 0 ? null : _ref2$closedCaptions,
|
|
101
103
|
_ref2$withSeekBar = _ref2.withSeekBar,
|
|
102
104
|
withSeekBar = _ref2$withSeekBar === void 0 ? false : _ref2$withSeekBar,
|
|
103
105
|
_ref2$withControls = _ref2.withControls,
|
|
104
|
-
withControls = _ref2$withControls === void 0 ? false : _ref2$withControls
|
|
106
|
+
withControls = _ref2$withControls === void 0 ? false : _ref2$withControls,
|
|
107
|
+
_ref2$color = _ref2.color,
|
|
108
|
+
color = _ref2$color === void 0 ? null : _ref2$color,
|
|
109
|
+
_ref2$progressColor = _ref2.progressColor,
|
|
110
|
+
progressColor = _ref2$progressColor === void 0 ? null : _ref2$progressColor;
|
|
105
111
|
|
|
106
112
|
var hasControls = (withSeekBar || withControls) && (isView || isEdit);
|
|
107
113
|
|
|
@@ -257,10 +263,9 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
257
263
|
_ref7$metadata = _ref7.metadata,
|
|
258
264
|
videoMetadata = _ref7$metadata === void 0 ? null : _ref7$metadata,
|
|
259
265
|
_ref7$url = _ref7.url,
|
|
260
|
-
videoUrl = _ref7$url === void 0 ? null : _ref7$url
|
|
261
|
-
_ref7$thumbnail_url = _ref7.thumbnail_url,
|
|
262
|
-
thumbnailUrl = _ref7$thumbnail_url === void 0 ? null : _ref7$thumbnail_url;
|
|
266
|
+
videoUrl = _ref7$url === void 0 ? null : _ref7$url;
|
|
263
267
|
|
|
268
|
+
var thumbnailUrl = useMediaThumbnail(videoMedia, thumbnailFile);
|
|
264
269
|
var hasVideoUrl = videoUrl !== null; // const hasThumbnail = thumbnailUrl !== null;
|
|
265
270
|
// const [posterReady, setPosterReady] = useState(!hasThumbnail);
|
|
266
271
|
|
|
@@ -366,8 +371,10 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
366
371
|
ref: controlsRef
|
|
367
372
|
}, /*#__PURE__*/React.createElement(MediaControls, {
|
|
368
373
|
className: classNames([styles.mediaControls, _defineProperty({}, styles.visible, visibleControls)]),
|
|
369
|
-
withSeekBar: withSeekBar,
|
|
370
374
|
withControls: withControls,
|
|
375
|
+
withSeekBar: withSeekBar,
|
|
376
|
+
color: color,
|
|
377
|
+
progressColor: progressColor,
|
|
371
378
|
playing: playing,
|
|
372
379
|
muted: muted,
|
|
373
380
|
currentTime: currentTime,
|
|
@@ -403,6 +410,8 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
403
410
|
duration: duration,
|
|
404
411
|
playing: playing,
|
|
405
412
|
focusable: false,
|
|
413
|
+
backgroundColor: color,
|
|
414
|
+
progressColor: progressColor,
|
|
406
415
|
className: classNames([styles.bottomSeekBar, _defineProperty({}, styles.isHidden, visibleControls)]),
|
|
407
416
|
isSmall: true
|
|
408
417
|
}) : null))) : null];
|
package/lib/index.js
CHANGED
|
@@ -117,12 +117,18 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
117
117
|
autoPlay = _ref2$autoPlay === void 0 ? true : _ref2$autoPlay,
|
|
118
118
|
_ref2$media = _ref2.media,
|
|
119
119
|
videoMedia = _ref2$media === void 0 ? null : _ref2$media,
|
|
120
|
+
_ref2$thumbnailFile = _ref2.thumbnailFile,
|
|
121
|
+
thumbnailFile = _ref2$thumbnailFile === void 0 ? null : _ref2$thumbnailFile,
|
|
120
122
|
_ref2$closedCaptions = _ref2.closedCaptions,
|
|
121
123
|
closedCaptions = _ref2$closedCaptions === void 0 ? null : _ref2$closedCaptions,
|
|
122
124
|
_ref2$withSeekBar = _ref2.withSeekBar,
|
|
123
125
|
withSeekBar = _ref2$withSeekBar === void 0 ? false : _ref2$withSeekBar,
|
|
124
126
|
_ref2$withControls = _ref2.withControls,
|
|
125
|
-
withControls = _ref2$withControls === void 0 ? false : _ref2$withControls
|
|
127
|
+
withControls = _ref2$withControls === void 0 ? false : _ref2$withControls,
|
|
128
|
+
_ref2$color = _ref2.color,
|
|
129
|
+
color = _ref2$color === void 0 ? null : _ref2$color,
|
|
130
|
+
_ref2$progressColor = _ref2.progressColor,
|
|
131
|
+
progressColor = _ref2$progressColor === void 0 ? null : _ref2$progressColor;
|
|
126
132
|
|
|
127
133
|
var hasControls = (withSeekBar || withControls) && (isView || isEdit);
|
|
128
134
|
|
|
@@ -278,10 +284,9 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
278
284
|
_ref7$metadata = _ref7.metadata,
|
|
279
285
|
videoMetadata = _ref7$metadata === void 0 ? null : _ref7$metadata,
|
|
280
286
|
_ref7$url = _ref7.url,
|
|
281
|
-
videoUrl = _ref7$url === void 0 ? null : _ref7$url
|
|
282
|
-
_ref7$thumbnail_url = _ref7.thumbnail_url,
|
|
283
|
-
thumbnailUrl = _ref7$thumbnail_url === void 0 ? null : _ref7$thumbnail_url;
|
|
287
|
+
videoUrl = _ref7$url === void 0 ? null : _ref7$url;
|
|
284
288
|
|
|
289
|
+
var thumbnailUrl = hooks.useMediaThumbnail(videoMedia, thumbnailFile);
|
|
285
290
|
var hasVideoUrl = videoUrl !== null; // const hasThumbnail = thumbnailUrl !== null;
|
|
286
291
|
// const [posterReady, setPosterReady] = useState(!hasThumbnail);
|
|
287
292
|
|
|
@@ -387,8 +392,10 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
387
392
|
ref: controlsRef
|
|
388
393
|
}, /*#__PURE__*/React__default["default"].createElement(MediaControls__default["default"], {
|
|
389
394
|
className: classNames__default["default"]([styles.mediaControls, _defineProperty__default["default"]({}, styles.visible, visibleControls)]),
|
|
390
|
-
withSeekBar: withSeekBar,
|
|
391
395
|
withControls: withControls,
|
|
396
|
+
withSeekBar: withSeekBar,
|
|
397
|
+
color: color,
|
|
398
|
+
progressColor: progressColor,
|
|
392
399
|
playing: playing,
|
|
393
400
|
muted: muted,
|
|
394
401
|
currentTime: currentTime,
|
|
@@ -424,6 +431,8 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
424
431
|
duration: duration,
|
|
425
432
|
playing: playing,
|
|
426
433
|
focusable: false,
|
|
434
|
+
backgroundColor: color,
|
|
435
|
+
progressColor: progressColor,
|
|
427
436
|
className: classNames__default["default"]([styles.bottomSeekBar, _defineProperty__default["default"]({}, styles.isHidden, visibleControls)]),
|
|
428
437
|
isSmall: true
|
|
429
438
|
}) : null))) : null];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-video",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.119",
|
|
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.119",
|
|
54
|
+
"@micromag/element-background": "^0.3.119",
|
|
55
|
+
"@micromag/element-call-to-action": "^0.3.119",
|
|
56
|
+
"@micromag/element-closed-captions": "^0.3.119",
|
|
57
|
+
"@micromag/element-container": "^0.3.119",
|
|
58
|
+
"@micromag/element-image": "^0.3.119",
|
|
59
|
+
"@micromag/element-media-controls": "^0.3.119",
|
|
60
|
+
"@micromag/element-video": "^0.3.119",
|
|
61
|
+
"@micromag/transforms": "^0.3.119",
|
|
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": "009841dc1641be98ddce6ed56cfcddc22509f342"
|
|
72
72
|
}
|