@trafilea/afrodita-components 6.34.9 → 6.35.0
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/index.d.ts +1 -0
- package/build/index.esm.js +6 -7
- package/build/index.esm.js.map +1 -1
- package/build/index.js +6 -7
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -3804,6 +3804,7 @@ declare type VideoProps = {
|
|
|
3804
3804
|
height?: string;
|
|
3805
3805
|
hasAudioControl?: boolean;
|
|
3806
3806
|
withProgressBar?: boolean;
|
|
3807
|
+
isSlideActive?: boolean;
|
|
3807
3808
|
} & DetailedHTMLProps<VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
|
|
3808
3809
|
declare const Video: React.FC<VideoProps>;
|
|
3809
3810
|
|
package/build/index.esm.js
CHANGED
|
@@ -12172,7 +12172,7 @@ var templateObject_1$1a, templateObject_2$T, templateObject_3$J, templateObject_
|
|
|
12172
12172
|
|
|
12173
12173
|
var Video$1 = function (_a) {
|
|
12174
12174
|
var _b, _c, _d, _e;
|
|
12175
|
-
var source = _a.source, thumbnail = _a.thumbnail, height = _a.height, className = _a.className, _f = _a.withProgressBar, withProgressBar = _f === void 0 ? true : _f, hasAudioControl = _a.hasAudioControl, muted = _a.muted, rest = __rest(_a, ["source", "thumbnail", "height", "className", "withProgressBar", "hasAudioControl", "muted"]);
|
|
12175
|
+
var source = _a.source, thumbnail = _a.thumbnail, height = _a.height, className = _a.className, _f = _a.withProgressBar, withProgressBar = _f === void 0 ? true : _f, hasAudioControl = _a.hasAudioControl, muted = _a.muted, isSlideActive = _a.isSlideActive, rest = __rest(_a, ["source", "thumbnail", "height", "className", "withProgressBar", "hasAudioControl", "muted", "isSlideActive"]);
|
|
12176
12176
|
var videoRef = useRef(null);
|
|
12177
12177
|
var _g = useState(true), isLoading = _g[0], setIsLoading = _g[1];
|
|
12178
12178
|
var _h = useState(false), isPlaying = _h[0], setIsPlaying = _h[1];
|
|
@@ -12182,11 +12182,11 @@ var Video$1 = function (_a) {
|
|
|
12182
12182
|
var isStarted = videoProgress > 0;
|
|
12183
12183
|
var progress = videoProgress / ((_c = (_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.duration) !== null && _c !== void 0 ? _c : 0);
|
|
12184
12184
|
var hideProgressBar = videoProgress === ((_e = (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.duration) !== null && _e !== void 0 ? _e : 0) || videoProgress === 0;
|
|
12185
|
-
|
|
12186
|
-
if (videoRef.current) {
|
|
12187
|
-
|
|
12185
|
+
if (isSlideActive !== undefined) {
|
|
12186
|
+
if (!isMuted && !isSlideActive && videoRef.current) {
|
|
12187
|
+
setIsMuted(true);
|
|
12188
12188
|
}
|
|
12189
|
-
}
|
|
12189
|
+
}
|
|
12190
12190
|
var handlePlayClick = function () {
|
|
12191
12191
|
if (videoRef.current && !debouncePlay) {
|
|
12192
12192
|
setDebouncePlay(true);
|
|
@@ -12210,7 +12210,6 @@ var Video$1 = function (_a) {
|
|
|
12210
12210
|
};
|
|
12211
12211
|
var handleMuteToggle = function () {
|
|
12212
12212
|
if (videoRef.current) {
|
|
12213
|
-
videoRef.current.muted = !videoRef.current.muted;
|
|
12214
12213
|
setIsMuted(function (prevState) { return !prevState; });
|
|
12215
12214
|
}
|
|
12216
12215
|
};
|
|
@@ -12219,7 +12218,7 @@ var Video$1 = function (_a) {
|
|
|
12219
12218
|
setVideoProgress(videoRef.current.currentTime);
|
|
12220
12219
|
}
|
|
12221
12220
|
};
|
|
12222
|
-
return (jsxs$1(Container$S, __assign$1({ className: className }, { children: [!isLoading && withProgressBar && jsx$1(ProgressBar$1, { progress: progress, hide: hideProgressBar }, void 0), !isPlaying ? (jsx$1(PlayContainer, __assign$1({ "data-testid": "play", onClick: handlePlayClick }, { children: isStarted && jsx$1(PlayIcon, {}, void 0) }), void 0)) : (jsx$1(PauseContainer, { "data-testid": "pause", onClick: handlePauseClick }, void 0)), hasAudioControl && (jsxs$1(MuteButton, __assign$1({ onClick: handleMuteToggle }, { children: [isMuted && jsx$1(Icon$1, { name: "custom/sound_off" }, void 0), !isMuted && jsx$1(Icon$1, { name: "custom/sound_on" }, void 0)] }), void 0)), jsxs$1(HTMLVideo, __assign$1({}, rest, { muted:
|
|
12221
|
+
return (jsxs$1(Container$S, __assign$1({ className: className }, { children: [!isLoading && withProgressBar && jsx$1(ProgressBar$1, { progress: progress, hide: hideProgressBar }, void 0), !isPlaying ? (jsx$1(PlayContainer, __assign$1({ "data-testid": "play", onClick: handlePlayClick }, { children: isStarted && jsx$1(PlayIcon, {}, void 0) }), void 0)) : (jsx$1(PauseContainer, { "data-testid": "pause", onClick: handlePauseClick }, void 0)), hasAudioControl && (jsxs$1(MuteButton, __assign$1({ onClick: handleMuteToggle }, { children: [isMuted && jsx$1(Icon$1, { name: "custom/sound_off" }, void 0), !isMuted && jsx$1(Icon$1, { name: "custom/sound_on" }, void 0)] }), void 0)), jsxs$1(HTMLVideo, __assign$1({}, rest, { muted: isMuted, "data-testid": "video", poster: thumbnail, playsInline: true, ref: videoRef, onTimeUpdate: onTimeUpdate, onCanPlay: function () { return setIsLoading(false); }, onLoadedData: function () { return setIsLoading(false); }, onPause: function () { return setIsPlaying(false); }, onPlaying: function () { return setIsPlaying(true); }, height: height || 'auto' }, { children: [jsx$1("track", { kind: "captions" }, void 0), jsx$1("source", { src: source }, void 0)] }), void 0)] }), void 0));
|
|
12223
12222
|
};
|
|
12224
12223
|
|
|
12225
12224
|
var propTypes = {exports: {}};
|