@micromag/screen-video 0.4.48 → 0.4.50
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 +110 -103
- package/package.json +11 -11
package/es/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
5
|
import { getSizeWithinBounds } from '@folklore/size';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
-
import
|
|
7
|
+
import { useState, useEffect, useCallback, useMemo } from 'react';
|
|
8
8
|
import { ScreenElement, Empty, PlaceholderVideo } from '@micromag/core/components';
|
|
9
9
|
import { useScreenSize, useScreenRenderContext, useViewerNavigation, useViewerContext, useViewerWebView, usePlaybackContext, usePlaybackMediaRef, useViewerContainer } from '@micromag/core/contexts';
|
|
10
10
|
import { useTrackScreenMedia, useActivityDetector, useDebounce, useMediaThumbnail } from '@micromag/core/hooks';
|
|
@@ -16,6 +16,7 @@ import Footer from '@micromag/element-footer';
|
|
|
16
16
|
import Header from '@micromag/element-header';
|
|
17
17
|
import Image from '@micromag/element-image';
|
|
18
18
|
import Video from '@micromag/element-video';
|
|
19
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
19
20
|
|
|
20
21
|
var styles = {"container":"micromag-screen-video-container","content":"micromag-screen-video-content","emptyContainer":"micromag-screen-video-emptyContainer","empty":"micromag-screen-video-empty","inner":"micromag-screen-video-inner","header":"micromag-screen-video-header","bottom":"micromag-screen-video-bottom","placeholder":"micromag-screen-video-placeholder","videoContainer":"micromag-screen-video-videoContainer","fullscreen":"micromag-screen-video-fullscreen","image":"micromag-screen-video-image","video":"micromag-screen-video-video"};
|
|
21
22
|
|
|
@@ -268,109 +269,115 @@ function VideoScreen(_ref) {
|
|
|
268
269
|
setControlsSuggestPlay(true);
|
|
269
270
|
}
|
|
270
271
|
}, [isView, current, playing, hasVideoUrl, autoPlay, setPlaying, setControlsSuggestPlay]);
|
|
271
|
-
return /*#__PURE__*/
|
|
272
|
+
return /*#__PURE__*/jsxs("div", {
|
|
272
273
|
className: classNames([styles.container, className, _defineProperty({}, styles.fullscreen, fullscreen)]),
|
|
273
|
-
"data-screen-ready": isStatic || isCapture || ready
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
274
|
+
"data-screen-ready": isStatic || isCapture || ready,
|
|
275
|
+
children: [/*#__PURE__*/jsx(Container, {
|
|
276
|
+
width: width,
|
|
277
|
+
height: height,
|
|
278
|
+
className: styles.content,
|
|
279
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
280
|
+
className: styles.inner,
|
|
281
|
+
children: [!isPlaceholder && hasHeader ? /*#__PURE__*/jsx("div", {
|
|
282
|
+
className: styles.header,
|
|
283
|
+
style: {
|
|
284
|
+
paddingTop: spacing / 2,
|
|
285
|
+
paddingLeft: spacing,
|
|
286
|
+
paddingRight: spacing,
|
|
287
|
+
transform: !isPreview ? "translate(0, ".concat(viewerTopHeight, "px)") : null
|
|
288
|
+
},
|
|
289
|
+
children: /*#__PURE__*/jsx(Header, _objectSpread({
|
|
290
|
+
fade: current && !controlsVisible
|
|
291
|
+
}, header))
|
|
292
|
+
}, "header") : null, /*#__PURE__*/jsx(ScreenElement, {
|
|
293
|
+
placeholder: /*#__PURE__*/jsx(PlaceholderVideo, _objectSpread({
|
|
294
|
+
className: styles.placeholder
|
|
295
|
+
}, placeholderProps)),
|
|
296
|
+
empty: /*#__PURE__*/jsx("div", {
|
|
297
|
+
className: styles.emptyContainer,
|
|
298
|
+
children: /*#__PURE__*/jsx(Empty, {
|
|
299
|
+
className: styles.empty,
|
|
300
|
+
children: /*#__PURE__*/jsx(FormattedMessage, {
|
|
301
|
+
id: "3ext9Q",
|
|
302
|
+
defaultMessage: [{
|
|
303
|
+
"type": 0,
|
|
304
|
+
"value": "Video"
|
|
305
|
+
}]
|
|
306
|
+
})
|
|
307
|
+
})
|
|
308
|
+
}),
|
|
309
|
+
isEmpty: !hasVideoUrl,
|
|
310
|
+
children: hasVideoUrl ? /*#__PURE__*/jsx("div", {
|
|
311
|
+
className: styles.videoContainer,
|
|
312
|
+
style: {
|
|
313
|
+
width: resizedVideoWidth,
|
|
314
|
+
height: resizedVideoHeight,
|
|
315
|
+
left: resizedVideoLeft,
|
|
316
|
+
top: resizedVideoTop
|
|
317
|
+
},
|
|
318
|
+
children: shouldDisplayPoster ? /*#__PURE__*/jsx(Image, {
|
|
319
|
+
className: styles.image,
|
|
320
|
+
media: finalThumbnail,
|
|
321
|
+
width: resizedVideoWidth,
|
|
322
|
+
height: resizedVideoHeight,
|
|
323
|
+
objectFit: {
|
|
324
|
+
fit: 'cover'
|
|
325
|
+
},
|
|
326
|
+
resolution: resolution,
|
|
327
|
+
shouldLoad: mediaShouldLoad
|
|
328
|
+
}) : /*#__PURE__*/jsx(Video, _objectSpread(_objectSpread({}, finalVideo), {}, {
|
|
329
|
+
width: resizedVideoWidth,
|
|
330
|
+
height: resizedVideoHeight,
|
|
331
|
+
paused: !videoPlaying,
|
|
332
|
+
muted: muted,
|
|
333
|
+
mediaRef: mediaRef,
|
|
334
|
+
className: styles.video,
|
|
335
|
+
onReady: onVideoReady,
|
|
336
|
+
onPlay: onPlay,
|
|
337
|
+
onPause: onPause,
|
|
338
|
+
onTimeUpdate: onTimeUpdate,
|
|
339
|
+
onProgressStep: onProgressStep,
|
|
340
|
+
onDurationChange: onDurationChange,
|
|
341
|
+
onSeeked: onSeeked,
|
|
342
|
+
onEnded: onEnded
|
|
343
|
+
// onSuspended={onSuspended}
|
|
344
|
+
,
|
|
345
|
+
onPlayError: onPlayError,
|
|
346
|
+
disablePictureInPicture: true,
|
|
347
|
+
focusable: current && isView,
|
|
348
|
+
shouldLoad: mediaShouldLoad,
|
|
349
|
+
qualityStartLevel: currentQualityLevel,
|
|
350
|
+
onQualityLevelChange: setCurrentQualityLevel
|
|
351
|
+
}))
|
|
352
|
+
}) : null
|
|
353
|
+
}, "video"), !isPlaceholder ? /*#__PURE__*/jsxs("div", {
|
|
354
|
+
className: styles.bottom,
|
|
355
|
+
style: {
|
|
356
|
+
transform: current && !isPreview ? "translate3d(0, -".concat(viewerBottomHeight, "px, 0)") : null,
|
|
357
|
+
paddingLeft: Math.max(spacing / 2, viewerBottomSidesWidth),
|
|
358
|
+
paddingRight: Math.max(spacing / 2, viewerBottomSidesWidth),
|
|
359
|
+
paddingBottom: spacing / 2,
|
|
360
|
+
paddingTop: 0
|
|
361
|
+
},
|
|
362
|
+
children: [(closedCaptions !== null || captions !== null) && !isPreview && !isCapture && !isStatic ? /*#__PURE__*/jsx(ClosedCaptions, _objectSpread(_objectSpread({
|
|
363
|
+
className: styles.closedCaptions,
|
|
364
|
+
media: closedCaptions // BW Compat
|
|
365
|
+
}, captions), {}, {
|
|
366
|
+
currentTime: currentTime
|
|
367
|
+
})) : null, hasFooter ? /*#__PURE__*/jsx(Footer, _objectSpread({}, footerProps)) : null]
|
|
368
|
+
}, "bottom-content") : null]
|
|
369
|
+
})
|
|
370
|
+
}), !isPlaceholder ? /*#__PURE__*/jsx(Background, {
|
|
371
|
+
background: background,
|
|
372
|
+
width: width,
|
|
373
|
+
height: height,
|
|
374
|
+
resolution: resolution,
|
|
375
|
+
playing: backgroundPlaying,
|
|
376
|
+
muted: muted,
|
|
377
|
+
shouldLoad: mediaShouldLoad,
|
|
378
|
+
withoutVideo: isPreview
|
|
379
|
+
}) : null]
|
|
380
|
+
});
|
|
374
381
|
}
|
|
375
382
|
|
|
376
383
|
var definition = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-video",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.50",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -62,15 +62,15 @@
|
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@babel/runtime": "^7.28.6",
|
|
64
64
|
"@folklore/size": "^0.1.20",
|
|
65
|
-
"@micromag/core": "^0.4.
|
|
66
|
-
"@micromag/element-background": "^0.4.
|
|
67
|
-
"@micromag/element-closed-captions": "^0.4.
|
|
68
|
-
"@micromag/element-container": "^0.4.
|
|
69
|
-
"@micromag/element-footer": "^0.4.
|
|
70
|
-
"@micromag/element-header": "^0.4.
|
|
71
|
-
"@micromag/element-image": "^0.4.
|
|
72
|
-
"@micromag/element-video": "^0.4.
|
|
73
|
-
"@micromag/transforms": "^0.4.
|
|
65
|
+
"@micromag/core": "^0.4.50",
|
|
66
|
+
"@micromag/element-background": "^0.4.50",
|
|
67
|
+
"@micromag/element-closed-captions": "^0.4.50",
|
|
68
|
+
"@micromag/element-container": "^0.4.50",
|
|
69
|
+
"@micromag/element-footer": "^0.4.50",
|
|
70
|
+
"@micromag/element-header": "^0.4.50",
|
|
71
|
+
"@micromag/element-image": "^0.4.50",
|
|
72
|
+
"@micromag/element-video": "^0.4.50",
|
|
73
|
+
"@micromag/transforms": "^0.4.50",
|
|
74
74
|
"classnames": "^2.2.6",
|
|
75
75
|
"lodash": "^4.17.23",
|
|
76
76
|
"react-intl": "^8.1.3 || ^10.0.0",
|
|
@@ -80,6 +80,6 @@
|
|
|
80
80
|
"access": "public",
|
|
81
81
|
"registry": "https://registry.npmjs.org/"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "940d5ca98f8f448b79eaa3e2fa685c3ee95185b8",
|
|
84
84
|
"types": "es/index.d.ts"
|
|
85
85
|
}
|