@micromag/screen-video 0.3.128 → 0.3.131
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 +74 -51
- package/lib/index.js +73 -50
- package/package.json +2 -2
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, useLongPress, useMediaThumbnail } 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';
|
|
@@ -54,7 +54,7 @@ var defaultProps = {
|
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
var VideoScreen = function VideoScreen(_ref) {
|
|
57
|
-
var
|
|
57
|
+
var _ref13;
|
|
58
58
|
|
|
59
59
|
var layout = _ref.layout,
|
|
60
60
|
video = _ref.video,
|
|
@@ -109,16 +109,24 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
109
109
|
_ref2$progressColor = _ref2.progressColor,
|
|
110
110
|
progressColor = _ref2$progressColor === void 0 ? null : _ref2$progressColor;
|
|
111
111
|
|
|
112
|
+
var _useResizeObserver = useResizeObserver(),
|
|
113
|
+
controlsRef = _useResizeObserver.ref,
|
|
114
|
+
contentRect = _useResizeObserver.entry.contentRect;
|
|
115
|
+
|
|
116
|
+
var _ref3 = contentRect || {},
|
|
117
|
+
_ref3$height = _ref3.height,
|
|
118
|
+
controlsHeight = _ref3$height === void 0 ? null : _ref3$height;
|
|
119
|
+
|
|
112
120
|
var apiRef = useRef();
|
|
113
121
|
|
|
114
|
-
var
|
|
115
|
-
togglePlay =
|
|
116
|
-
toggleMute =
|
|
117
|
-
seek =
|
|
118
|
-
play =
|
|
119
|
-
pause =
|
|
120
|
-
|
|
121
|
-
apiMediaRef =
|
|
122
|
+
var _ref4 = apiRef.current || {},
|
|
123
|
+
togglePlay = _ref4.togglePlay,
|
|
124
|
+
toggleMute = _ref4.toggleMute,
|
|
125
|
+
seek = _ref4.seek,
|
|
126
|
+
play = _ref4.play,
|
|
127
|
+
pause = _ref4.pause,
|
|
128
|
+
_ref4$mediaRef = _ref4.mediaRef,
|
|
129
|
+
apiMediaRef = _ref4$mediaRef === void 0 ? null : _ref4$mediaRef;
|
|
122
130
|
|
|
123
131
|
useEffect(function () {
|
|
124
132
|
if (apiMediaRef !== null && getMediaRef !== null) {
|
|
@@ -130,28 +138,33 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
130
138
|
var _useState = useState(false),
|
|
131
139
|
_useState2 = _slicedToArray(_useState, 2),
|
|
132
140
|
showMediaControls = _useState2[0],
|
|
133
|
-
setShowMediaControls = _useState2[1];
|
|
134
|
-
|
|
141
|
+
setShowMediaControls = _useState2[1];
|
|
135
142
|
|
|
136
|
-
var _useState3 = useState(
|
|
143
|
+
var _useState3 = useState(false),
|
|
137
144
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
138
|
-
|
|
139
|
-
|
|
145
|
+
playOnFirstTap = _useState4[0],
|
|
146
|
+
setPlayOnFirstTap = _useState4[1]; // Get api state updates from callback
|
|
147
|
+
|
|
140
148
|
|
|
141
149
|
var _useState5 = useState(null),
|
|
142
150
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
143
|
-
|
|
144
|
-
|
|
151
|
+
currentTime = _useState6[0],
|
|
152
|
+
setCurrentTime = _useState6[1];
|
|
145
153
|
|
|
146
|
-
var _useState7 = useState(
|
|
154
|
+
var _useState7 = useState(null),
|
|
147
155
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
148
|
-
|
|
149
|
-
|
|
156
|
+
duration = _useState8[0],
|
|
157
|
+
setDuration = _useState8[1];
|
|
150
158
|
|
|
151
159
|
var _useState9 = useState(false),
|
|
152
160
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
153
|
-
|
|
154
|
-
|
|
161
|
+
playing = _useState10[0],
|
|
162
|
+
setPlaying = _useState10[1];
|
|
163
|
+
|
|
164
|
+
var _useState11 = useState(false),
|
|
165
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
166
|
+
muted = _useState12[0],
|
|
167
|
+
setMuted = _useState12[1];
|
|
155
168
|
|
|
156
169
|
var onTimeUpdate = useCallback(function (time) {
|
|
157
170
|
setCurrentTime(time);
|
|
@@ -162,13 +175,13 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
162
175
|
var onDurationChanged = useCallback(function (dur) {
|
|
163
176
|
setDuration(dur);
|
|
164
177
|
}, [setDuration]);
|
|
165
|
-
var onPlay = useCallback(function (
|
|
166
|
-
var initial =
|
|
178
|
+
var onPlay = useCallback(function (_ref5) {
|
|
179
|
+
var initial = _ref5.initial;
|
|
167
180
|
setPlaying(true);
|
|
168
181
|
trackScreenMedia(video, initial ? 'play' : 'resume');
|
|
169
182
|
}, [trackScreenMedia, video]);
|
|
170
|
-
var onPause = useCallback(function (
|
|
171
|
-
var midway =
|
|
183
|
+
var onPause = useCallback(function (_ref6) {
|
|
184
|
+
var midway = _ref6.midway;
|
|
172
185
|
setPlaying(false);
|
|
173
186
|
trackScreenMedia(video, midway ? 'pause' : 'ended');
|
|
174
187
|
}, [trackScreenMedia, video]);
|
|
@@ -226,10 +239,6 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
226
239
|
}, [play, playing, pause, onMouseMove, withControls, setShowMediaControls]);
|
|
227
240
|
var onShowControls = useCallback(function (e) {
|
|
228
241
|
onMouseMove(e, 3000);
|
|
229
|
-
|
|
230
|
-
if (autoPlay && !playing) {
|
|
231
|
-
play();
|
|
232
|
-
}
|
|
233
242
|
}, [play, onMouseMove]);
|
|
234
243
|
var longPressBind = useLongPress({
|
|
235
244
|
onLongPress: onLongPress,
|
|
@@ -239,10 +248,10 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
239
248
|
var hasCallToAction = callToAction !== null && callToAction.active === true;
|
|
240
249
|
var hasVideo = video !== null;
|
|
241
250
|
|
|
242
|
-
var
|
|
243
|
-
|
|
244
|
-
ready =
|
|
245
|
-
setReady =
|
|
251
|
+
var _useState13 = useState(hasVideo),
|
|
252
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
253
|
+
ready = _useState14[0],
|
|
254
|
+
setReady = _useState14[1]; // useState(!hasVideo);
|
|
246
255
|
|
|
247
256
|
|
|
248
257
|
var transitionPlaying = current && ready;
|
|
@@ -253,20 +262,20 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
253
262
|
}) : null;
|
|
254
263
|
}, [hasVideo, video, isPreview, isStatic, isCapture, autoPlay, current]);
|
|
255
264
|
|
|
256
|
-
var
|
|
257
|
-
|
|
258
|
-
videoMetadata =
|
|
259
|
-
|
|
260
|
-
videoUrl =
|
|
265
|
+
var _ref7 = videoMedia || {},
|
|
266
|
+
_ref7$metadata = _ref7.metadata,
|
|
267
|
+
videoMetadata = _ref7$metadata === void 0 ? null : _ref7$metadata,
|
|
268
|
+
_ref7$url = _ref7.url,
|
|
269
|
+
videoUrl = _ref7$url === void 0 ? null : _ref7$url;
|
|
261
270
|
|
|
262
271
|
var thumbnailUrl = useMediaThumbnail(videoMedia, thumbnailFile);
|
|
263
272
|
var hasVideoUrl = videoUrl !== null;
|
|
264
273
|
|
|
265
|
-
var
|
|
266
|
-
|
|
267
|
-
videoWidth =
|
|
268
|
-
|
|
269
|
-
videoHeight =
|
|
274
|
+
var _ref8 = videoMetadata || {},
|
|
275
|
+
_ref8$width = _ref8.width,
|
|
276
|
+
videoWidth = _ref8$width === void 0 ? 0 : _ref8$width,
|
|
277
|
+
_ref8$height = _ref8.height,
|
|
278
|
+
videoHeight = _ref8$height === void 0 ? 0 : _ref8$height;
|
|
270
279
|
|
|
271
280
|
var _getSizeWithinBounds = getSizeWithinBounds(videoWidth, videoHeight, width, height, {
|
|
272
281
|
cover: fullscreen
|
|
@@ -287,6 +296,10 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
287
296
|
}, [videoUrl, hasVideoUrl, setReady]);
|
|
288
297
|
var onVideoReady = useCallback(function () {
|
|
289
298
|
setReady(true);
|
|
299
|
+
|
|
300
|
+
if (autoPlay && !playing) {
|
|
301
|
+
setPlayOnFirstTap(true); // @note: this sets up a button that plays the video on click for folks who are low on battery on their device: e.g. ios stops the autoplay of videos in that case...
|
|
302
|
+
}
|
|
290
303
|
}, [setReady]);
|
|
291
304
|
var visibleControls = !autoPlay && !playing || muted || showMediaControls;
|
|
292
305
|
var items = [/*#__PURE__*/React.createElement(ScreenElement, {
|
|
@@ -341,11 +354,11 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
341
354
|
onVolumeChanged: onVolumeChanged,
|
|
342
355
|
focusable: current && isView,
|
|
343
356
|
shouldLoad: mediaShouldLoad
|
|
344
|
-
}))) : null),
|
|
345
|
-
key: "
|
|
357
|
+
}))) : null), playOnFirstTap && !playing ? /*#__PURE__*/React.createElement("button", {
|
|
358
|
+
key: "first-tap-button",
|
|
346
359
|
type: "button",
|
|
347
|
-
onClick:
|
|
348
|
-
className: classNames([styles.videoButton
|
|
360
|
+
onClick: onPlay,
|
|
361
|
+
className: classNames([styles.videoButton])
|
|
349
362
|
}) : null, !isPlaceholder ? /*#__PURE__*/React.createElement("div", {
|
|
350
363
|
key: "bottom-content",
|
|
351
364
|
className: styles.bottomContent
|
|
@@ -359,7 +372,9 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
359
372
|
currentTime: currentTime
|
|
360
373
|
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
361
374
|
className: classNames([styles.bottom, _defineProperty({}, styles.withGradient, withSeekBar || withControls || muted)])
|
|
362
|
-
}, hasVideoUrl ? /*#__PURE__*/React.createElement(
|
|
375
|
+
}, hasVideoUrl ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
376
|
+
ref: controlsRef
|
|
377
|
+
}, /*#__PURE__*/React.createElement(MediaControls, {
|
|
363
378
|
className: classNames([styles.mediaControls, _defineProperty({}, styles.visible, visibleControls)]),
|
|
364
379
|
withControls: withControls,
|
|
365
380
|
withSeekBar: withSeekBar,
|
|
@@ -373,7 +388,15 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
373
388
|
onToggleMute: onToggleMute,
|
|
374
389
|
onSeek: onSeek,
|
|
375
390
|
focusable: current && isView
|
|
376
|
-
})
|
|
391
|
+
})), /*#__PURE__*/React.createElement("button", {
|
|
392
|
+
key: "video-button",
|
|
393
|
+
style: {
|
|
394
|
+
height: controlsHeight
|
|
395
|
+
},
|
|
396
|
+
type: "button",
|
|
397
|
+
onPointerDown: onShowControls,
|
|
398
|
+
className: classNames([styles.videoButton, _defineProperty({}, styles.visible, !visibleControls)])
|
|
399
|
+
})) : null, hasCallToAction ? /*#__PURE__*/React.createElement("div", {
|
|
377
400
|
style: {
|
|
378
401
|
marginTop: -spacing / 2
|
|
379
402
|
}
|
|
@@ -399,7 +422,7 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
399
422
|
isSmall: true
|
|
400
423
|
}) : null))) : null];
|
|
401
424
|
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
402
|
-
className: classNames([styles.container, (
|
|
425
|
+
className: classNames([styles.container, (_ref13 = {}, _defineProperty(_ref13, className, className !== null), _defineProperty(_ref13, styles.fullscreen, fullscreen), _ref13)]),
|
|
403
426
|
"data-screen-ready": isStatic || isCapture || ready
|
|
404
427
|
}, longPressBind, {
|
|
405
428
|
onMouseMove: onMouseMove
|
package/lib/index.js
CHANGED
|
@@ -75,7 +75,7 @@ var defaultProps = {
|
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
var VideoScreen = function VideoScreen(_ref) {
|
|
78
|
-
var
|
|
78
|
+
var _ref13;
|
|
79
79
|
|
|
80
80
|
var layout = _ref.layout,
|
|
81
81
|
video = _ref.video,
|
|
@@ -130,16 +130,24 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
130
130
|
_ref2$progressColor = _ref2.progressColor,
|
|
131
131
|
progressColor = _ref2$progressColor === void 0 ? null : _ref2$progressColor;
|
|
132
132
|
|
|
133
|
+
var _useResizeObserver = hooks.useResizeObserver(),
|
|
134
|
+
controlsRef = _useResizeObserver.ref,
|
|
135
|
+
contentRect = _useResizeObserver.entry.contentRect;
|
|
136
|
+
|
|
137
|
+
var _ref3 = contentRect || {},
|
|
138
|
+
_ref3$height = _ref3.height,
|
|
139
|
+
controlsHeight = _ref3$height === void 0 ? null : _ref3$height;
|
|
140
|
+
|
|
133
141
|
var apiRef = React.useRef();
|
|
134
142
|
|
|
135
|
-
var
|
|
136
|
-
togglePlay =
|
|
137
|
-
toggleMute =
|
|
138
|
-
seek =
|
|
139
|
-
play =
|
|
140
|
-
pause =
|
|
141
|
-
|
|
142
|
-
apiMediaRef =
|
|
143
|
+
var _ref4 = apiRef.current || {},
|
|
144
|
+
togglePlay = _ref4.togglePlay,
|
|
145
|
+
toggleMute = _ref4.toggleMute,
|
|
146
|
+
seek = _ref4.seek,
|
|
147
|
+
play = _ref4.play,
|
|
148
|
+
pause = _ref4.pause,
|
|
149
|
+
_ref4$mediaRef = _ref4.mediaRef,
|
|
150
|
+
apiMediaRef = _ref4$mediaRef === void 0 ? null : _ref4$mediaRef;
|
|
143
151
|
|
|
144
152
|
React.useEffect(function () {
|
|
145
153
|
if (apiMediaRef !== null && getMediaRef !== null) {
|
|
@@ -151,28 +159,33 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
151
159
|
var _useState = React.useState(false),
|
|
152
160
|
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
153
161
|
showMediaControls = _useState2[0],
|
|
154
|
-
setShowMediaControls = _useState2[1];
|
|
155
|
-
|
|
162
|
+
setShowMediaControls = _useState2[1];
|
|
156
163
|
|
|
157
|
-
var _useState3 = React.useState(
|
|
164
|
+
var _useState3 = React.useState(false),
|
|
158
165
|
_useState4 = _slicedToArray__default["default"](_useState3, 2),
|
|
159
|
-
|
|
160
|
-
|
|
166
|
+
playOnFirstTap = _useState4[0],
|
|
167
|
+
setPlayOnFirstTap = _useState4[1]; // Get api state updates from callback
|
|
168
|
+
|
|
161
169
|
|
|
162
170
|
var _useState5 = React.useState(null),
|
|
163
171
|
_useState6 = _slicedToArray__default["default"](_useState5, 2),
|
|
164
|
-
|
|
165
|
-
|
|
172
|
+
currentTime = _useState6[0],
|
|
173
|
+
setCurrentTime = _useState6[1];
|
|
166
174
|
|
|
167
|
-
var _useState7 = React.useState(
|
|
175
|
+
var _useState7 = React.useState(null),
|
|
168
176
|
_useState8 = _slicedToArray__default["default"](_useState7, 2),
|
|
169
|
-
|
|
170
|
-
|
|
177
|
+
duration = _useState8[0],
|
|
178
|
+
setDuration = _useState8[1];
|
|
171
179
|
|
|
172
180
|
var _useState9 = React.useState(false),
|
|
173
181
|
_useState10 = _slicedToArray__default["default"](_useState9, 2),
|
|
174
|
-
|
|
175
|
-
|
|
182
|
+
playing = _useState10[0],
|
|
183
|
+
setPlaying = _useState10[1];
|
|
184
|
+
|
|
185
|
+
var _useState11 = React.useState(false),
|
|
186
|
+
_useState12 = _slicedToArray__default["default"](_useState11, 2),
|
|
187
|
+
muted = _useState12[0],
|
|
188
|
+
setMuted = _useState12[1];
|
|
176
189
|
|
|
177
190
|
var onTimeUpdate = React.useCallback(function (time) {
|
|
178
191
|
setCurrentTime(time);
|
|
@@ -183,13 +196,13 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
183
196
|
var onDurationChanged = React.useCallback(function (dur) {
|
|
184
197
|
setDuration(dur);
|
|
185
198
|
}, [setDuration]);
|
|
186
|
-
var onPlay = React.useCallback(function (
|
|
187
|
-
var initial =
|
|
199
|
+
var onPlay = React.useCallback(function (_ref5) {
|
|
200
|
+
var initial = _ref5.initial;
|
|
188
201
|
setPlaying(true);
|
|
189
202
|
trackScreenMedia(video, initial ? 'play' : 'resume');
|
|
190
203
|
}, [trackScreenMedia, video]);
|
|
191
|
-
var onPause = React.useCallback(function (
|
|
192
|
-
var midway =
|
|
204
|
+
var onPause = React.useCallback(function (_ref6) {
|
|
205
|
+
var midway = _ref6.midway;
|
|
193
206
|
setPlaying(false);
|
|
194
207
|
trackScreenMedia(video, midway ? 'pause' : 'ended');
|
|
195
208
|
}, [trackScreenMedia, video]);
|
|
@@ -247,10 +260,6 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
247
260
|
}, [play, playing, pause, onMouseMove, withControls, setShowMediaControls]);
|
|
248
261
|
var onShowControls = React.useCallback(function (e) {
|
|
249
262
|
onMouseMove(e, 3000);
|
|
250
|
-
|
|
251
|
-
if (autoPlay && !playing) {
|
|
252
|
-
play();
|
|
253
|
-
}
|
|
254
263
|
}, [play, onMouseMove]);
|
|
255
264
|
var longPressBind = hooks.useLongPress({
|
|
256
265
|
onLongPress: onLongPress,
|
|
@@ -260,10 +269,10 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
260
269
|
var hasCallToAction = callToAction !== null && callToAction.active === true;
|
|
261
270
|
var hasVideo = video !== null;
|
|
262
271
|
|
|
263
|
-
var
|
|
264
|
-
|
|
265
|
-
ready =
|
|
266
|
-
setReady =
|
|
272
|
+
var _useState13 = React.useState(hasVideo),
|
|
273
|
+
_useState14 = _slicedToArray__default["default"](_useState13, 2),
|
|
274
|
+
ready = _useState14[0],
|
|
275
|
+
setReady = _useState14[1]; // useState(!hasVideo);
|
|
267
276
|
|
|
268
277
|
|
|
269
278
|
var transitionPlaying = current && ready;
|
|
@@ -274,20 +283,20 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
274
283
|
}) : null;
|
|
275
284
|
}, [hasVideo, video, isPreview, isStatic, isCapture, autoPlay, current]);
|
|
276
285
|
|
|
277
|
-
var
|
|
278
|
-
|
|
279
|
-
videoMetadata =
|
|
280
|
-
|
|
281
|
-
videoUrl =
|
|
286
|
+
var _ref7 = videoMedia || {},
|
|
287
|
+
_ref7$metadata = _ref7.metadata,
|
|
288
|
+
videoMetadata = _ref7$metadata === void 0 ? null : _ref7$metadata,
|
|
289
|
+
_ref7$url = _ref7.url,
|
|
290
|
+
videoUrl = _ref7$url === void 0 ? null : _ref7$url;
|
|
282
291
|
|
|
283
292
|
var thumbnailUrl = hooks.useMediaThumbnail(videoMedia, thumbnailFile);
|
|
284
293
|
var hasVideoUrl = videoUrl !== null;
|
|
285
294
|
|
|
286
|
-
var
|
|
287
|
-
|
|
288
|
-
videoWidth =
|
|
289
|
-
|
|
290
|
-
videoHeight =
|
|
295
|
+
var _ref8 = videoMetadata || {},
|
|
296
|
+
_ref8$width = _ref8.width,
|
|
297
|
+
videoWidth = _ref8$width === void 0 ? 0 : _ref8$width,
|
|
298
|
+
_ref8$height = _ref8.height,
|
|
299
|
+
videoHeight = _ref8$height === void 0 ? 0 : _ref8$height;
|
|
291
300
|
|
|
292
301
|
var _getSizeWithinBounds = size.getSizeWithinBounds(videoWidth, videoHeight, width, height, {
|
|
293
302
|
cover: fullscreen
|
|
@@ -308,6 +317,10 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
308
317
|
}, [videoUrl, hasVideoUrl, setReady]);
|
|
309
318
|
var onVideoReady = React.useCallback(function () {
|
|
310
319
|
setReady(true);
|
|
320
|
+
|
|
321
|
+
if (autoPlay && !playing) {
|
|
322
|
+
setPlayOnFirstTap(true); // @note: this sets up a button that plays the video on click for folks who are low on battery on their device: e.g. ios stops the autoplay of videos in that case...
|
|
323
|
+
}
|
|
311
324
|
}, [setReady]);
|
|
312
325
|
var visibleControls = !autoPlay && !playing || muted || showMediaControls;
|
|
313
326
|
var items = [/*#__PURE__*/React__default["default"].createElement(components.ScreenElement, {
|
|
@@ -362,11 +375,11 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
362
375
|
onVolumeChanged: onVolumeChanged,
|
|
363
376
|
focusable: current && isView,
|
|
364
377
|
shouldLoad: mediaShouldLoad
|
|
365
|
-
}))) : null),
|
|
366
|
-
key: "
|
|
378
|
+
}))) : null), playOnFirstTap && !playing ? /*#__PURE__*/React__default["default"].createElement("button", {
|
|
379
|
+
key: "first-tap-button",
|
|
367
380
|
type: "button",
|
|
368
|
-
onClick:
|
|
369
|
-
className: classNames__default["default"]([styles.videoButton
|
|
381
|
+
onClick: onPlay,
|
|
382
|
+
className: classNames__default["default"]([styles.videoButton])
|
|
370
383
|
}) : null, !isPlaceholder ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
371
384
|
key: "bottom-content",
|
|
372
385
|
className: styles.bottomContent
|
|
@@ -380,7 +393,9 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
380
393
|
currentTime: currentTime
|
|
381
394
|
}) : null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
382
395
|
className: classNames__default["default"]([styles.bottom, _defineProperty__default["default"]({}, styles.withGradient, withSeekBar || withControls || muted)])
|
|
383
|
-
}, hasVideoUrl ? /*#__PURE__*/React__default["default"].createElement(
|
|
396
|
+
}, hasVideoUrl ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
397
|
+
ref: controlsRef
|
|
398
|
+
}, /*#__PURE__*/React__default["default"].createElement(MediaControls__default["default"], {
|
|
384
399
|
className: classNames__default["default"]([styles.mediaControls, _defineProperty__default["default"]({}, styles.visible, visibleControls)]),
|
|
385
400
|
withControls: withControls,
|
|
386
401
|
withSeekBar: withSeekBar,
|
|
@@ -394,7 +409,15 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
394
409
|
onToggleMute: onToggleMute,
|
|
395
410
|
onSeek: onSeek,
|
|
396
411
|
focusable: current && isView
|
|
397
|
-
})
|
|
412
|
+
})), /*#__PURE__*/React__default["default"].createElement("button", {
|
|
413
|
+
key: "video-button",
|
|
414
|
+
style: {
|
|
415
|
+
height: controlsHeight
|
|
416
|
+
},
|
|
417
|
+
type: "button",
|
|
418
|
+
onPointerDown: onShowControls,
|
|
419
|
+
className: classNames__default["default"]([styles.videoButton, _defineProperty__default["default"]({}, styles.visible, !visibleControls)])
|
|
420
|
+
})) : null, hasCallToAction ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
398
421
|
style: {
|
|
399
422
|
marginTop: -spacing / 2
|
|
400
423
|
}
|
|
@@ -420,7 +443,7 @@ var VideoScreen = function VideoScreen(_ref) {
|
|
|
420
443
|
isSmall: true
|
|
421
444
|
}) : null))) : null];
|
|
422
445
|
return /*#__PURE__*/React__default["default"].createElement("div", Object.assign({
|
|
423
|
-
className: classNames__default["default"]([styles.container, (
|
|
446
|
+
className: classNames__default["default"]([styles.container, (_ref13 = {}, _defineProperty__default["default"](_ref13, className, className !== null), _defineProperty__default["default"](_ref13, styles.fullscreen, fullscreen), _ref13)]),
|
|
424
447
|
"data-screen-ready": isStatic || isCapture || ready
|
|
425
448
|
}, longPressBind, {
|
|
426
449
|
onMouseMove: onMouseMove
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-video",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.131",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "36022ce41c8564ba276666e48795aa2f47cac492"
|
|
72
72
|
}
|