@gravity-ui/page-constructor 4.25.0 → 4.25.1
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/build/cjs/components/ReactPlayer/CustomBarControls.css +1 -0
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +10 -2
- package/build/esm/components/ReactPlayer/CustomBarControls.css +1 -0
- package/build/esm/components/ReactPlayer/ReactPlayer.js +10 -2
- package/package.json +1 -1
- package/widget/index.js +1 -1
|
@@ -38,7 +38,7 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
|
38
38
|
const [started, setStarted] = (0, react_1.useState)(autoPlay);
|
|
39
39
|
const [ended, setEnded] = (0, react_1.useState)(false);
|
|
40
40
|
const [isMounted, setIsMounted] = (0, react_1.useState)(false);
|
|
41
|
-
const [hovered, setHovered] = (0, react_1.useState)(
|
|
41
|
+
const [hovered, setHovered] = (0, react_1.useState)(isMobile);
|
|
42
42
|
(0, hooks_1.useMount)(() => setIsMounted(true));
|
|
43
43
|
const videoSrc = (0, react_1.useMemo)(() => (0, utils_2.checkYoutubeVideos)(src), [src]);
|
|
44
44
|
const eventsArray = (0, react_1.useMemo)(() => {
|
|
@@ -219,7 +219,15 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
|
219
219
|
}, className), ref: ref, onClick: handleClick, onMouseEnter: onFocusIn, onMouseLeave: onFocusOut, onFocus: onFocusIn, onBlur: onFocusOut }, isMounted ? (react_1.default.createElement(react_1.Fragment, null,
|
|
220
220
|
react_1.default.createElement(react_player_1.default, { className: b('player'), url: videoSrc, muted: muted, controls: controls === models_1.MediaVideoControlsType.Default, height: currentHeight || '100%', width: width || '100%', light: previewImgUrl, playing: isPlaying, playIcon: playIcon, progressInterval: FPS, onClickPreview: handleClickPreview, onStart: onStart, onReady: setPlayerRef, onPlay: onPlay, onPause: autoPlay && customControlsType !== models_1.CustomControlsType.WithMuteButton
|
|
221
221
|
? undefined
|
|
222
|
-
: onPause, onProgress: onProgress, onEnded: onEnded, "aria-label": ariaLabel
|
|
222
|
+
: onPause, onProgress: onProgress, onEnded: onEnded, "aria-label": ariaLabel, config: {
|
|
223
|
+
file: {
|
|
224
|
+
attributes: {
|
|
225
|
+
pip: isMobile ? 'false' : undefined,
|
|
226
|
+
playsinline: isMobile ? '' : undefined,
|
|
227
|
+
disablepictureinpicture: isMobile ? '' : undefined,
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
} }),
|
|
223
231
|
controls === models_1.MediaVideoControlsType.Custom && (react_1.default.createElement(CustomBarControls_1.default, { className: customBarControlsClassName, mute: {
|
|
224
232
|
isMuted: muted,
|
|
225
233
|
changeMute: (event) => {
|
|
@@ -35,7 +35,7 @@ export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
|
|
|
35
35
|
const [started, setStarted] = useState(autoPlay);
|
|
36
36
|
const [ended, setEnded] = useState(false);
|
|
37
37
|
const [isMounted, setIsMounted] = useState(false);
|
|
38
|
-
const [hovered, setHovered] = useState(
|
|
38
|
+
const [hovered, setHovered] = useState(isMobile);
|
|
39
39
|
useMount(() => setIsMounted(true));
|
|
40
40
|
const videoSrc = useMemo(() => checkYoutubeVideos(src), [src]);
|
|
41
41
|
const eventsArray = useMemo(() => {
|
|
@@ -216,7 +216,15 @@ export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
|
|
|
216
216
|
}, className), ref: ref, onClick: handleClick, onMouseEnter: onFocusIn, onMouseLeave: onFocusOut, onFocus: onFocusIn, onBlur: onFocusOut }, isMounted ? (React.createElement(Fragment, null,
|
|
217
217
|
React.createElement(ReactPlayer, { className: b('player'), url: videoSrc, muted: muted, controls: controls === MediaVideoControlsType.Default, height: currentHeight || '100%', width: width || '100%', light: previewImgUrl, playing: isPlaying, playIcon: playIcon, progressInterval: FPS, onClickPreview: handleClickPreview, onStart: onStart, onReady: setPlayerRef, onPlay: onPlay, onPause: autoPlay && customControlsType !== CustomControlsType.WithMuteButton
|
|
218
218
|
? undefined
|
|
219
|
-
: onPause, onProgress: onProgress, onEnded: onEnded, "aria-label": ariaLabel
|
|
219
|
+
: onPause, onProgress: onProgress, onEnded: onEnded, "aria-label": ariaLabel, config: {
|
|
220
|
+
file: {
|
|
221
|
+
attributes: {
|
|
222
|
+
pip: isMobile ? 'false' : undefined,
|
|
223
|
+
playsinline: isMobile ? '' : undefined,
|
|
224
|
+
disablepictureinpicture: isMobile ? '' : undefined,
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
} }),
|
|
220
228
|
controls === MediaVideoControlsType.Custom && (React.createElement(CustomBarControls, { className: customBarControlsClassName, mute: {
|
|
221
229
|
isMuted: muted,
|
|
222
230
|
changeMute: (event) => {
|