@gravity-ui/page-constructor 5.14.1 → 5.14.3

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.
@@ -130,6 +130,7 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
130
130
  const changeMute = (0, react_1.useCallback)((isMuted) => {
131
131
  if (isMuted &&
132
132
  playerRef &&
133
+ controls === models_1.MediaVideoControlsType.Custom &&
133
134
  customControlsType === models_1.CustomControlsType.WithMuteButton) {
134
135
  playerRef.seekTo(0);
135
136
  setPlayedPercent(0);
@@ -141,7 +142,15 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
141
142
  }
142
143
  // In order to the progress bar to update (equals 0) before displaying
143
144
  setTimeout(() => setMuted(!isMuted), 0);
144
- }, [playerRef, customControlsType, playEvents, stopEvents, handleAnalytics, setProps]);
145
+ }, [
146
+ playerRef,
147
+ customControlsType,
148
+ playEvents,
149
+ stopEvents,
150
+ handleAnalytics,
151
+ setProps,
152
+ controls,
153
+ ]);
145
154
  const handleClickPreview = (0, react_1.useCallback)(() => {
146
155
  setIsPlaying(true);
147
156
  onClickPreview === null || onClickPreview === void 0 ? void 0 : onClickPreview();
@@ -198,13 +207,15 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
198
207
  }
199
208
  }, [isPlaying, onPlay, onPause]);
200
209
  const handleClick = (0, react_1.useCallback)(() => {
201
- if (customControlsType === models_1.CustomControlsType.WithMuteButton) {
202
- changeMute(muted);
203
- }
204
- else {
205
- onPlayClick();
210
+ if (controls === models_1.MediaVideoControlsType.Custom) {
211
+ if (customControlsType === models_1.CustomControlsType.WithMuteButton) {
212
+ changeMute(muted);
213
+ }
214
+ else {
215
+ onPlayClick();
216
+ }
206
217
  }
207
- }, [changeMute, customControlsType, muted, onPlayClick]);
218
+ }, [changeMute, customControlsType, muted, onPlayClick, controls]);
208
219
  const onFocusIn = (0, react_1.useCallback)(() => setHovered(true), []);
209
220
  const onFocusOut = (0, react_1.useCallback)(() => setHovered(false), []);
210
221
  return (react_1.default.createElement("div", { className: b({
@@ -127,6 +127,7 @@ export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
127
127
  const changeMute = useCallback((isMuted) => {
128
128
  if (isMuted &&
129
129
  playerRef &&
130
+ controls === MediaVideoControlsType.Custom &&
130
131
  customControlsType === CustomControlsType.WithMuteButton) {
131
132
  playerRef.seekTo(0);
132
133
  setPlayedPercent(0);
@@ -138,7 +139,15 @@ export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
138
139
  }
139
140
  // In order to the progress bar to update (equals 0) before displaying
140
141
  setTimeout(() => setMuted(!isMuted), 0);
141
- }, [playerRef, customControlsType, playEvents, stopEvents, handleAnalytics, setProps]);
142
+ }, [
143
+ playerRef,
144
+ customControlsType,
145
+ playEvents,
146
+ stopEvents,
147
+ handleAnalytics,
148
+ setProps,
149
+ controls,
150
+ ]);
142
151
  const handleClickPreview = useCallback(() => {
143
152
  setIsPlaying(true);
144
153
  onClickPreview === null || onClickPreview === void 0 ? void 0 : onClickPreview();
@@ -195,13 +204,15 @@ export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
195
204
  }
196
205
  }, [isPlaying, onPlay, onPause]);
197
206
  const handleClick = useCallback(() => {
198
- if (customControlsType === CustomControlsType.WithMuteButton) {
199
- changeMute(muted);
200
- }
201
- else {
202
- onPlayClick();
207
+ if (controls === MediaVideoControlsType.Custom) {
208
+ if (customControlsType === CustomControlsType.WithMuteButton) {
209
+ changeMute(muted);
210
+ }
211
+ else {
212
+ onPlayClick();
213
+ }
203
214
  }
204
- }, [changeMute, customControlsType, muted, onPlayClick]);
215
+ }, [changeMute, customControlsType, muted, onPlayClick, controls]);
205
216
  const onFocusIn = useCallback(() => setHovered(true), []);
206
217
  const onFocusOut = useCallback(() => setHovered(false), []);
207
218
  return (React.createElement("div", { className: b({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "5.14.1",
3
+ "version": "5.14.3",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {