@micromag/screen-video 0.3.541 → 0.3.569
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 +2 -3
- package/package.json +12 -13
- package/lib/index.js +0 -501
package/es/index.js
CHANGED
|
@@ -381,7 +381,6 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
381
381
|
};
|
|
382
382
|
VideoScreen.propTypes = propTypes;
|
|
383
383
|
VideoScreen.defaultProps = defaultProps;
|
|
384
|
-
var VideoScreen$1 = VideoScreen;
|
|
385
384
|
|
|
386
385
|
var definition = {
|
|
387
386
|
id: 'video',
|
|
@@ -403,7 +402,7 @@ var definition = {
|
|
|
403
402
|
"value": "Video"
|
|
404
403
|
}]
|
|
405
404
|
}),
|
|
406
|
-
component: VideoScreen
|
|
405
|
+
component: VideoScreen,
|
|
407
406
|
layouts: ['middle', 'full'],
|
|
408
407
|
// transforms,
|
|
409
408
|
fields: [{
|
|
@@ -493,4 +492,4 @@ var definition = {
|
|
|
493
492
|
}]
|
|
494
493
|
};
|
|
495
494
|
|
|
496
|
-
export { VideoScreen
|
|
495
|
+
export { VideoScreen, definition as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-video",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.569",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -30,12 +30,11 @@
|
|
|
30
30
|
}
|
|
31
31
|
],
|
|
32
32
|
"license": "ISC",
|
|
33
|
-
"
|
|
33
|
+
"type": "module",
|
|
34
34
|
"module": "es/index.js",
|
|
35
35
|
"style": "assets/css/styles.css",
|
|
36
36
|
"exports": {
|
|
37
37
|
".": {
|
|
38
|
-
"require": "./lib/index.js",
|
|
39
38
|
"import": "./es/index.js"
|
|
40
39
|
},
|
|
41
40
|
"./assets/css/styles": "./assets/css/styles.css",
|
|
@@ -62,15 +61,15 @@
|
|
|
62
61
|
"dependencies": {
|
|
63
62
|
"@babel/runtime": "^7.13.10",
|
|
64
63
|
"@folklore/size": "^0.1.20",
|
|
65
|
-
"@micromag/core": "^0.3.
|
|
66
|
-
"@micromag/element-background": "^0.3.
|
|
67
|
-
"@micromag/element-closed-captions": "^0.3.
|
|
68
|
-
"@micromag/element-container": "^0.3.
|
|
69
|
-
"@micromag/element-footer": "^0.3.
|
|
70
|
-
"@micromag/element-header": "^0.3.
|
|
71
|
-
"@micromag/element-image": "^0.3.
|
|
72
|
-
"@micromag/element-video": "^0.3.
|
|
73
|
-
"@micromag/transforms": "^0.3.
|
|
64
|
+
"@micromag/core": "^0.3.569",
|
|
65
|
+
"@micromag/element-background": "^0.3.569",
|
|
66
|
+
"@micromag/element-closed-captions": "^0.3.569",
|
|
67
|
+
"@micromag/element-container": "^0.3.569",
|
|
68
|
+
"@micromag/element-footer": "^0.3.569",
|
|
69
|
+
"@micromag/element-header": "^0.3.569",
|
|
70
|
+
"@micromag/element-image": "^0.3.569",
|
|
71
|
+
"@micromag/element-video": "^0.3.569",
|
|
72
|
+
"@micromag/transforms": "^0.3.569",
|
|
74
73
|
"classnames": "^2.2.6",
|
|
75
74
|
"lodash": "^4.17.21",
|
|
76
75
|
"prop-types": "^15.7.2",
|
|
@@ -81,5 +80,5 @@
|
|
|
81
80
|
"access": "public",
|
|
82
81
|
"registry": "https://registry.npmjs.org/"
|
|
83
82
|
},
|
|
84
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "ceb71f23a32ab8df4a1563a1e5cd5598e539de4d"
|
|
85
84
|
}
|
package/lib/index.js
DELETED
|
@@ -1,501 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var reactIntl = require('react-intl');
|
|
6
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
-
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
8
|
-
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
9
|
-
var size = require('@folklore/size');
|
|
10
|
-
var classNames = require('classnames');
|
|
11
|
-
var PropTypes = require('prop-types');
|
|
12
|
-
var React = require('react');
|
|
13
|
-
var core = require('@micromag/core');
|
|
14
|
-
var components = require('@micromag/core/components');
|
|
15
|
-
var contexts = require('@micromag/core/contexts');
|
|
16
|
-
var hooks = require('@micromag/core/hooks');
|
|
17
|
-
var utils = require('@micromag/core/utils');
|
|
18
|
-
var Background = require('@micromag/element-background');
|
|
19
|
-
var ClosedCaptions = require('@micromag/element-closed-captions');
|
|
20
|
-
var Container = require('@micromag/element-container');
|
|
21
|
-
var Footer = require('@micromag/element-footer');
|
|
22
|
-
var Header = require('@micromag/element-header');
|
|
23
|
-
var Image = require('@micromag/element-image');
|
|
24
|
-
var Video = require('@micromag/element-video');
|
|
25
|
-
|
|
26
|
-
var styles = {"unmuteAndPlayButton":"micromag-screen-video-unmuteAndPlayButton","container":"micromag-screen-video-container","fullscreen":"micromag-screen-video-fullscreen","image":"micromag-screen-video-image","video":"micromag-screen-video-video","placeholder":"micromag-screen-video-placeholder","inner":"micromag-screen-video-inner","empty":"micromag-screen-video-empty","emptyContainer":"micromag-screen-video-emptyContainer","background":"micromag-screen-video-background","disabled":"micromag-screen-video-disabled","hidden":"micromag-screen-video-hidden","content":"micromag-screen-video-content","header":"micromag-screen-video-header","bottom":"micromag-screen-video-bottom","videoContainer":"micromag-screen-video-videoContainer"};
|
|
27
|
-
|
|
28
|
-
var propTypes = {
|
|
29
|
-
layout: PropTypes.oneOf(['middle', 'full']),
|
|
30
|
-
video: core.PropTypes.videoElement,
|
|
31
|
-
gotoNextScreenOnEnd: PropTypes.bool,
|
|
32
|
-
header: core.PropTypes.header,
|
|
33
|
-
footer: core.PropTypes.footer,
|
|
34
|
-
background: core.PropTypes.backgroundElement,
|
|
35
|
-
current: PropTypes.bool,
|
|
36
|
-
active: PropTypes.bool,
|
|
37
|
-
spacing: PropTypes.number,
|
|
38
|
-
mediaRef: PropTypes.func,
|
|
39
|
-
className: PropTypes.string
|
|
40
|
-
};
|
|
41
|
-
var defaultProps = {
|
|
42
|
-
layout: 'middle',
|
|
43
|
-
video: null,
|
|
44
|
-
gotoNextScreenOnEnd: false,
|
|
45
|
-
header: null,
|
|
46
|
-
footer: null,
|
|
47
|
-
background: null,
|
|
48
|
-
current: true,
|
|
49
|
-
active: true,
|
|
50
|
-
spacing: 20,
|
|
51
|
-
mediaRef: null,
|
|
52
|
-
className: null
|
|
53
|
-
};
|
|
54
|
-
var VideoScreen = function VideoScreen(_ref) {
|
|
55
|
-
var layout = _ref.layout,
|
|
56
|
-
video = _ref.video,
|
|
57
|
-
gotoNextScreenOnEnd = _ref.gotoNextScreenOnEnd,
|
|
58
|
-
header = _ref.header,
|
|
59
|
-
footer = _ref.footer,
|
|
60
|
-
background = _ref.background,
|
|
61
|
-
current = _ref.current,
|
|
62
|
-
active = _ref.active,
|
|
63
|
-
spacing = _ref.spacing,
|
|
64
|
-
customMediaRef = _ref.mediaRef,
|
|
65
|
-
className = _ref.className;
|
|
66
|
-
var trackScreenMedia = hooks.useTrackScreenMedia('video');
|
|
67
|
-
var _useScreenSize = contexts.useScreenSize(),
|
|
68
|
-
width = _useScreenSize.width,
|
|
69
|
-
height = _useScreenSize.height,
|
|
70
|
-
resolution = _useScreenSize.resolution;
|
|
71
|
-
var _useScreenRenderConte = contexts.useScreenRenderContext(),
|
|
72
|
-
isView = _useScreenRenderConte.isView,
|
|
73
|
-
isPreview = _useScreenRenderConte.isPreview,
|
|
74
|
-
isPlaceholder = _useScreenRenderConte.isPlaceholder,
|
|
75
|
-
isEdit = _useScreenRenderConte.isEdit,
|
|
76
|
-
isStatic = _useScreenRenderConte.isStatic,
|
|
77
|
-
isCapture = _useScreenRenderConte.isCapture;
|
|
78
|
-
var _useViewerNavigation = contexts.useViewerNavigation(),
|
|
79
|
-
gotoNextScreen = _useViewerNavigation.gotoNextScreen;
|
|
80
|
-
var _useViewerContext = contexts.useViewerContext(),
|
|
81
|
-
viewerTopHeight = _useViewerContext.topHeight,
|
|
82
|
-
viewerBottomHeight = _useViewerContext.bottomHeight,
|
|
83
|
-
viewerBottomSidesWidth = _useViewerContext.bottomSidesWidth;
|
|
84
|
-
var _useViewerWebView = contexts.useViewerWebView(),
|
|
85
|
-
openWebView = _useViewerWebView.open;
|
|
86
|
-
var mediaShouldLoad = current || active;
|
|
87
|
-
var shouldGotoNextScreenOnEnd = gotoNextScreenOnEnd && isView && current;
|
|
88
|
-
var _ref2 = video || {},
|
|
89
|
-
_ref2$autoPlay = _ref2.autoPlay,
|
|
90
|
-
autoPlay = _ref2$autoPlay === void 0 ? true : _ref2$autoPlay,
|
|
91
|
-
_ref2$loop = _ref2.loop,
|
|
92
|
-
loop = _ref2$loop === void 0 ? false : _ref2$loop,
|
|
93
|
-
_ref2$media = _ref2.media,
|
|
94
|
-
videoMedia = _ref2$media === void 0 ? null : _ref2$media,
|
|
95
|
-
_ref2$thumbnail = _ref2.thumbnail,
|
|
96
|
-
thumbnail = _ref2$thumbnail === void 0 ? null : _ref2$thumbnail,
|
|
97
|
-
_ref2$captions = _ref2.captions,
|
|
98
|
-
captions = _ref2$captions === void 0 ? null : _ref2$captions,
|
|
99
|
-
_ref2$closedCaptions = _ref2.closedCaptions,
|
|
100
|
-
closedCaptions = _ref2$closedCaptions === void 0 ? null : _ref2$closedCaptions,
|
|
101
|
-
_ref2$withSeekBar = _ref2.withSeekBar,
|
|
102
|
-
withSeekBar = _ref2$withSeekBar === void 0 ? false : _ref2$withSeekBar,
|
|
103
|
-
_ref2$withControls = _ref2.withControls,
|
|
104
|
-
withControls = _ref2$withControls === void 0 ? false : _ref2$withControls,
|
|
105
|
-
_ref2$color = _ref2.color,
|
|
106
|
-
color = _ref2$color === void 0 ? null : _ref2$color,
|
|
107
|
-
_ref2$progressColor = _ref2.progressColor,
|
|
108
|
-
progressColor = _ref2$progressColor === void 0 ? null : _ref2$progressColor;
|
|
109
|
-
var _usePlaybackContext = contexts.usePlaybackContext(),
|
|
110
|
-
playing = _usePlaybackContext.playing,
|
|
111
|
-
muted = _usePlaybackContext.muted,
|
|
112
|
-
setControls = _usePlaybackContext.setControls,
|
|
113
|
-
setControlsSuggestPlay = _usePlaybackContext.setControlsSuggestPlay,
|
|
114
|
-
setControlsTheme = _usePlaybackContext.setControlsTheme,
|
|
115
|
-
setPlaying = _usePlaybackContext.setPlaying,
|
|
116
|
-
controlsVisible = _usePlaybackContext.controlsVisible,
|
|
117
|
-
showControls = _usePlaybackContext.showControls,
|
|
118
|
-
hideControls = _usePlaybackContext.hideControls;
|
|
119
|
-
var mediaRef = contexts.usePlaybackMediaRef(current);
|
|
120
|
-
var _useState = React.useState(false),
|
|
121
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
122
|
-
hasPlayed = _useState2[0],
|
|
123
|
-
setHasPlayed = _useState2[1];
|
|
124
|
-
var backgroundPlaying = current && (isView || isEdit);
|
|
125
|
-
var videoPlaying = current && (isView || isEdit) && playing;
|
|
126
|
-
var shouldDisplayPoster = isPreview || isCapture;
|
|
127
|
-
React.useEffect(function () {
|
|
128
|
-
if (!current) {
|
|
129
|
-
return function () {};
|
|
130
|
-
}
|
|
131
|
-
setControlsTheme({
|
|
132
|
-
seekBarOnly: withSeekBar && !withControls,
|
|
133
|
-
color: color,
|
|
134
|
-
progressColor: progressColor
|
|
135
|
-
});
|
|
136
|
-
if (withControls || withSeekBar) {
|
|
137
|
-
setControls(true);
|
|
138
|
-
} else {
|
|
139
|
-
setControls(false);
|
|
140
|
-
}
|
|
141
|
-
return function () {
|
|
142
|
-
if (withControls || withSeekBar) {
|
|
143
|
-
setControls(false);
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
}, [current, withControls, setControls, withSeekBar, color, progressColor]);
|
|
147
|
-
React.useEffect(function () {
|
|
148
|
-
if (customMediaRef !== null) {
|
|
149
|
-
customMediaRef(mediaRef.current);
|
|
150
|
-
}
|
|
151
|
-
}, [mediaRef.current]);
|
|
152
|
-
React.useEffect(function () {
|
|
153
|
-
if (current && autoPlay) {
|
|
154
|
-
setPlaying(true);
|
|
155
|
-
}
|
|
156
|
-
}, [current, autoPlay]);
|
|
157
|
-
var viewerContainer = contexts.useViewerContainer();
|
|
158
|
-
var _useActivityDetector = hooks.useActivityDetector({
|
|
159
|
-
element: viewerContainer,
|
|
160
|
-
disabled: !isView,
|
|
161
|
-
timeout: 2000
|
|
162
|
-
}),
|
|
163
|
-
activityDetected = _useActivityDetector.detected;
|
|
164
|
-
var toggleControlsVisibility = React.useCallback(function () {
|
|
165
|
-
if (activityDetected) {
|
|
166
|
-
showControls();
|
|
167
|
-
} else {
|
|
168
|
-
hideControls();
|
|
169
|
-
}
|
|
170
|
-
}, [activityDetected, showControls, hideControls]);
|
|
171
|
-
hooks.useDebounce(toggleControlsVisibility, activityDetected, 1000);
|
|
172
|
-
var _useState3 = React.useState(null),
|
|
173
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
174
|
-
currentTime = _useState4[0],
|
|
175
|
-
setCurrentTime = _useState4[1];
|
|
176
|
-
var _useState5 = React.useState(null),
|
|
177
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
178
|
-
duration = _useState6[0],
|
|
179
|
-
setDuration = _useState6[1];
|
|
180
|
-
var onTimeUpdate = React.useCallback(function () {
|
|
181
|
-
var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
182
|
-
if (time !== null && typeof time.currentTarget !== 'undefined') {
|
|
183
|
-
var _ref3 = time.currentTarget || {},
|
|
184
|
-
_ref3$currentTime = _ref3.currentTime,
|
|
185
|
-
targetTime = _ref3$currentTime === void 0 ? 0 : _ref3$currentTime;
|
|
186
|
-
setCurrentTime(targetTime);
|
|
187
|
-
} else {
|
|
188
|
-
setCurrentTime(0);
|
|
189
|
-
}
|
|
190
|
-
}, [duration, setCurrentTime]);
|
|
191
|
-
var onProgressStep = React.useCallback(function (step) {
|
|
192
|
-
trackScreenMedia(video, "progress_".concat(Math.round(step * 100, 10), "%"));
|
|
193
|
-
}, [trackScreenMedia, video]);
|
|
194
|
-
var onDurationChange = React.useCallback(function (dur) {
|
|
195
|
-
setDuration(dur);
|
|
196
|
-
}, [setDuration]);
|
|
197
|
-
var onPlay = React.useCallback(function (_ref4) {
|
|
198
|
-
var initial = _ref4.initial;
|
|
199
|
-
if (!hasPlayed) {
|
|
200
|
-
setHasPlayed(true);
|
|
201
|
-
}
|
|
202
|
-
trackScreenMedia(video, initial ? 'play' : 'resume');
|
|
203
|
-
}, [trackScreenMedia, video]);
|
|
204
|
-
var onPause = React.useCallback(function (_ref5) {
|
|
205
|
-
var midway = _ref5.midway;
|
|
206
|
-
trackScreenMedia(video, midway ? 'pause' : 'ended');
|
|
207
|
-
}, [trackScreenMedia, video]);
|
|
208
|
-
var onSeeked = React.useCallback(function (time) {
|
|
209
|
-
if (time > 0) {
|
|
210
|
-
trackScreenMedia(video, 'seek');
|
|
211
|
-
}
|
|
212
|
-
}, [trackScreenMedia, video]);
|
|
213
|
-
var onEnded = React.useCallback(function () {
|
|
214
|
-
if (current && !loop) {
|
|
215
|
-
setPlaying(false);
|
|
216
|
-
}
|
|
217
|
-
if (current && shouldGotoNextScreenOnEnd) {
|
|
218
|
-
gotoNextScreen();
|
|
219
|
-
}
|
|
220
|
-
}, [loop, current, shouldGotoNextScreenOnEnd, gotoNextScreen]);
|
|
221
|
-
var fullscreen = layout === 'full';
|
|
222
|
-
var hasHeader = utils.isHeaderFilled(header);
|
|
223
|
-
var hasFooter = utils.isFooterFilled(footer);
|
|
224
|
-
var footerProps = utils.getFooterProps(footer, {
|
|
225
|
-
isView: isView,
|
|
226
|
-
current: current,
|
|
227
|
-
openWebView: openWebView,
|
|
228
|
-
isPreview: isPreview
|
|
229
|
-
});
|
|
230
|
-
var hasVideo = video !== null;
|
|
231
|
-
var _useState7 = React.useState(hasVideo),
|
|
232
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
233
|
-
ready = _useState8[0],
|
|
234
|
-
setReady = _useState8[1];
|
|
235
|
-
var finalVideo = React.useMemo(function () {
|
|
236
|
-
return hasVideo ? _objectSpread(_objectSpread({}, video), {}, {
|
|
237
|
-
autoPlay: !isPreview && !isStatic && !isCapture && autoPlay && current
|
|
238
|
-
}) : null;
|
|
239
|
-
}, [hasVideo, video, isPreview, isStatic, isCapture, autoPlay, current]);
|
|
240
|
-
var _ref6 = videoMedia || {},
|
|
241
|
-
_ref6$metadata = _ref6.metadata,
|
|
242
|
-
videoMetadata = _ref6$metadata === void 0 ? null : _ref6$metadata,
|
|
243
|
-
_ref6$url = _ref6.url,
|
|
244
|
-
videoUrl = _ref6$url === void 0 ? null : _ref6$url;
|
|
245
|
-
var finalThumbnail = hooks.useMediaThumbnail(videoMedia, thumbnail);
|
|
246
|
-
var hasVideoUrl = videoUrl !== null;
|
|
247
|
-
var _ref7 = videoMetadata || {},
|
|
248
|
-
_ref7$width = _ref7.width,
|
|
249
|
-
videoWidth = _ref7$width === void 0 ? 0 : _ref7$width,
|
|
250
|
-
_ref7$height = _ref7.height,
|
|
251
|
-
videoHeight = _ref7$height === void 0 ? 0 : _ref7$height;
|
|
252
|
-
var _getSizeWithinBounds = size.getSizeWithinBounds(videoWidth, videoHeight, width, height, {
|
|
253
|
-
cover: fullscreen
|
|
254
|
-
}),
|
|
255
|
-
resizedVideoWidth = _getSizeWithinBounds.width,
|
|
256
|
-
resizedVideoHeight = _getSizeWithinBounds.height;
|
|
257
|
-
var resizedVideoLeft = -(resizedVideoWidth - width) / 2;
|
|
258
|
-
var resizedVideoTop = -(resizedVideoHeight - height) / 2;
|
|
259
|
-
var placeholderProps = fullscreen ? {
|
|
260
|
-
width: '100%',
|
|
261
|
-
height: '100%'
|
|
262
|
-
} : {
|
|
263
|
-
width: '100%'
|
|
264
|
-
};
|
|
265
|
-
React.useEffect(function () {
|
|
266
|
-
setReady(!hasVideoUrl);
|
|
267
|
-
}, [videoUrl, hasVideoUrl, setReady]);
|
|
268
|
-
var onVideoReady = React.useCallback(function () {
|
|
269
|
-
setReady(true);
|
|
270
|
-
}, [setReady]);
|
|
271
|
-
|
|
272
|
-
// const onSuspended = useCallback(() => {
|
|
273
|
-
// if (playing && current) {
|
|
274
|
-
// setPlaying(false);
|
|
275
|
-
// }
|
|
276
|
-
// }, [current, playing, setPlaying]);
|
|
277
|
-
|
|
278
|
-
var onPlayError = React.useCallback(function () {
|
|
279
|
-
if (isView && playing && current && hasVideoUrl && autoPlay) {
|
|
280
|
-
setPlaying(false);
|
|
281
|
-
setControlsSuggestPlay(true);
|
|
282
|
-
}
|
|
283
|
-
}, [isView, current, playing, hasVideoUrl, autoPlay, setPlaying, setControlsSuggestPlay]);
|
|
284
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
285
|
-
className: classNames([styles.container, _defineProperty(_defineProperty({}, className, className !== null), styles.fullscreen, fullscreen)]),
|
|
286
|
-
"data-screen-ready": isStatic || isCapture || ready
|
|
287
|
-
}, /*#__PURE__*/React.createElement(Container, {
|
|
288
|
-
width: width,
|
|
289
|
-
height: height,
|
|
290
|
-
className: styles.content
|
|
291
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
292
|
-
className: styles.inner
|
|
293
|
-
}, !isPlaceholder && hasHeader ? /*#__PURE__*/React.createElement("div", {
|
|
294
|
-
key: "header",
|
|
295
|
-
className: styles.header,
|
|
296
|
-
style: {
|
|
297
|
-
paddingTop: spacing / 2,
|
|
298
|
-
paddingLeft: spacing,
|
|
299
|
-
paddingRight: spacing,
|
|
300
|
-
transform: !isPreview ? "translate(0, ".concat(viewerTopHeight, "px)") : null
|
|
301
|
-
}
|
|
302
|
-
}, /*#__PURE__*/React.createElement(Header, Object.assign({
|
|
303
|
-
fade: current && !controlsVisible
|
|
304
|
-
}, header))) : null, /*#__PURE__*/React.createElement(components.ScreenElement, {
|
|
305
|
-
key: "video",
|
|
306
|
-
placeholder: /*#__PURE__*/React.createElement(components.PlaceholderVideo, Object.assign({
|
|
307
|
-
className: styles.placeholder
|
|
308
|
-
}, placeholderProps)),
|
|
309
|
-
empty: /*#__PURE__*/React.createElement("div", {
|
|
310
|
-
className: styles.emptyContainer
|
|
311
|
-
}, /*#__PURE__*/React.createElement(components.Empty, {
|
|
312
|
-
className: styles.empty
|
|
313
|
-
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
314
|
-
id: "3ext9Q",
|
|
315
|
-
defaultMessage: [{
|
|
316
|
-
"type": 0,
|
|
317
|
-
"value": "Video"
|
|
318
|
-
}]
|
|
319
|
-
}))),
|
|
320
|
-
isEmpty: !hasVideoUrl
|
|
321
|
-
}, hasVideoUrl ? /*#__PURE__*/React.createElement("div", {
|
|
322
|
-
className: styles.videoContainer,
|
|
323
|
-
style: {
|
|
324
|
-
width: resizedVideoWidth,
|
|
325
|
-
height: resizedVideoHeight,
|
|
326
|
-
left: resizedVideoLeft,
|
|
327
|
-
top: resizedVideoTop
|
|
328
|
-
}
|
|
329
|
-
}, shouldDisplayPoster ? /*#__PURE__*/React.createElement(Image, {
|
|
330
|
-
className: styles.image,
|
|
331
|
-
media: finalThumbnail,
|
|
332
|
-
width: resizedVideoWidth,
|
|
333
|
-
height: resizedVideoHeight,
|
|
334
|
-
objectFit: {
|
|
335
|
-
fit: 'cover'
|
|
336
|
-
},
|
|
337
|
-
resolution: resolution,
|
|
338
|
-
shouldLoad: mediaShouldLoad
|
|
339
|
-
}) : /*#__PURE__*/React.createElement(Video, Object.assign({}, finalVideo, {
|
|
340
|
-
width: resizedVideoWidth,
|
|
341
|
-
height: resizedVideoHeight,
|
|
342
|
-
paused: !videoPlaying,
|
|
343
|
-
muted: muted,
|
|
344
|
-
mediaRef: mediaRef,
|
|
345
|
-
className: styles.video,
|
|
346
|
-
onReady: onVideoReady,
|
|
347
|
-
onPlay: onPlay,
|
|
348
|
-
onPause: onPause,
|
|
349
|
-
onTimeUpdate: onTimeUpdate,
|
|
350
|
-
onProgressStep: onProgressStep,
|
|
351
|
-
onDurationChange: onDurationChange,
|
|
352
|
-
onSeeked: onSeeked,
|
|
353
|
-
onEnded: onEnded
|
|
354
|
-
// onSuspended={onSuspended}
|
|
355
|
-
,
|
|
356
|
-
onPlayError: onPlayError,
|
|
357
|
-
disablePictureInPicture: true,
|
|
358
|
-
focusable: current && isView,
|
|
359
|
-
shouldLoad: mediaShouldLoad
|
|
360
|
-
}))) : null), !isPlaceholder ? /*#__PURE__*/React.createElement("div", {
|
|
361
|
-
key: "bottom-content",
|
|
362
|
-
className: styles.bottom,
|
|
363
|
-
style: {
|
|
364
|
-
transform: current && !isPreview ? "translate3d(0, -".concat(viewerBottomHeight, "px, 0)") : null,
|
|
365
|
-
paddingLeft: Math.max(spacing / 2, viewerBottomSidesWidth),
|
|
366
|
-
paddingRight: Math.max(spacing / 2, viewerBottomSidesWidth),
|
|
367
|
-
paddingBottom: spacing / 2,
|
|
368
|
-
paddingTop: 0
|
|
369
|
-
}
|
|
370
|
-
}, (closedCaptions !== null || captions !== null) && !isPreview && !isCapture && !isStatic ? /*#__PURE__*/React.createElement(ClosedCaptions, Object.assign({
|
|
371
|
-
className: styles.closedCaptions,
|
|
372
|
-
media: closedCaptions // BW Compat
|
|
373
|
-
}, captions, {
|
|
374
|
-
currentTime: currentTime
|
|
375
|
-
})) : null, hasFooter ? /*#__PURE__*/React.createElement(Footer, footerProps) : null) : null)), !isPlaceholder ? /*#__PURE__*/React.createElement(Background, {
|
|
376
|
-
background: background,
|
|
377
|
-
width: width,
|
|
378
|
-
height: height,
|
|
379
|
-
resolution: resolution,
|
|
380
|
-
playing: backgroundPlaying,
|
|
381
|
-
muted: muted,
|
|
382
|
-
shouldLoad: mediaShouldLoad,
|
|
383
|
-
withoutVideo: isPreview
|
|
384
|
-
}) : null);
|
|
385
|
-
};
|
|
386
|
-
VideoScreen.propTypes = propTypes;
|
|
387
|
-
VideoScreen.defaultProps = defaultProps;
|
|
388
|
-
var VideoScreen$1 = VideoScreen;
|
|
389
|
-
|
|
390
|
-
var definition = {
|
|
391
|
-
id: 'video',
|
|
392
|
-
type: 'screen',
|
|
393
|
-
group: {
|
|
394
|
-
label: reactIntl.defineMessage({
|
|
395
|
-
id: "+9akmg",
|
|
396
|
-
defaultMessage: [{
|
|
397
|
-
"type": 0,
|
|
398
|
-
"value": "Audio and Video"
|
|
399
|
-
}]
|
|
400
|
-
}),
|
|
401
|
-
order: 5
|
|
402
|
-
},
|
|
403
|
-
title: reactIntl.defineMessage({
|
|
404
|
-
id: "UBXIYP",
|
|
405
|
-
defaultMessage: [{
|
|
406
|
-
"type": 0,
|
|
407
|
-
"value": "Video"
|
|
408
|
-
}]
|
|
409
|
-
}),
|
|
410
|
-
component: VideoScreen$1,
|
|
411
|
-
layouts: ['middle', 'full'],
|
|
412
|
-
// transforms,
|
|
413
|
-
fields: [{
|
|
414
|
-
name: 'layout',
|
|
415
|
-
type: 'screen-layout',
|
|
416
|
-
defaultValue: 'middle',
|
|
417
|
-
label: reactIntl.defineMessage({
|
|
418
|
-
id: "4iBXj2",
|
|
419
|
-
defaultMessage: [{
|
|
420
|
-
"type": 0,
|
|
421
|
-
"value": "Layout"
|
|
422
|
-
}]
|
|
423
|
-
})
|
|
424
|
-
}, {
|
|
425
|
-
name: 'video',
|
|
426
|
-
type: 'video-element',
|
|
427
|
-
theme: {
|
|
428
|
-
color: 'primary'
|
|
429
|
-
},
|
|
430
|
-
defaultValue: {
|
|
431
|
-
autoPlay: true
|
|
432
|
-
},
|
|
433
|
-
label: reactIntl.defineMessage({
|
|
434
|
-
id: "tvl2Zc",
|
|
435
|
-
defaultMessage: [{
|
|
436
|
-
"type": 0,
|
|
437
|
-
"value": "Video"
|
|
438
|
-
}]
|
|
439
|
-
})
|
|
440
|
-
}, {
|
|
441
|
-
name: 'gotoNextScreenOnEnd',
|
|
442
|
-
type: 'toggle',
|
|
443
|
-
defaultValue: false,
|
|
444
|
-
label: reactIntl.defineMessage({
|
|
445
|
-
id: "n8zmLY",
|
|
446
|
-
defaultMessage: [{
|
|
447
|
-
"type": 0,
|
|
448
|
-
"value": "Go to next screen on end"
|
|
449
|
-
}]
|
|
450
|
-
})
|
|
451
|
-
}, {
|
|
452
|
-
name: 'background',
|
|
453
|
-
type: 'background',
|
|
454
|
-
label: reactIntl.defineMessage({
|
|
455
|
-
id: "+MPZRu",
|
|
456
|
-
defaultMessage: [{
|
|
457
|
-
"type": 0,
|
|
458
|
-
"value": "Background"
|
|
459
|
-
}]
|
|
460
|
-
})
|
|
461
|
-
}, {
|
|
462
|
-
name: 'header',
|
|
463
|
-
type: 'header',
|
|
464
|
-
label: reactIntl.defineMessage({
|
|
465
|
-
id: "rhuDxI",
|
|
466
|
-
defaultMessage: [{
|
|
467
|
-
"type": 0,
|
|
468
|
-
"value": "Header"
|
|
469
|
-
}]
|
|
470
|
-
}),
|
|
471
|
-
theme: {
|
|
472
|
-
badge: {
|
|
473
|
-
label: {
|
|
474
|
-
textStyle: 'badge'
|
|
475
|
-
},
|
|
476
|
-
boxStyle: 'badge'
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
}, {
|
|
480
|
-
name: 'footer',
|
|
481
|
-
type: 'footer',
|
|
482
|
-
label: reactIntl.defineMessage({
|
|
483
|
-
id: "g4nybp",
|
|
484
|
-
defaultMessage: [{
|
|
485
|
-
"type": 0,
|
|
486
|
-
"value": "Footer"
|
|
487
|
-
}]
|
|
488
|
-
}),
|
|
489
|
-
theme: {
|
|
490
|
-
callToAction: {
|
|
491
|
-
label: {
|
|
492
|
-
textStyle: 'cta'
|
|
493
|
-
},
|
|
494
|
-
boxStyle: 'cta'
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
}]
|
|
498
|
-
};
|
|
499
|
-
|
|
500
|
-
exports.VideoScreen = VideoScreen$1;
|
|
501
|
-
exports.default = definition;
|