Merge branch 'play-pause-yandex-triggers' into 'develop'

play-pause-yandex-triggers

See merge request witapp/aura-webapp!198
This commit is contained in:
Daniil Chemerkin 2024-06-24 22:45:44 +00:00
commit 9f25146c95

View File

@ -31,6 +31,12 @@ const PersonalVideo = React.memo<IPersonalVideoProps>(({ url, gender }) => {
metricService.reachGoal(EGoals.ROSE_VIDEO_PLAY_END);
};
const handlePlayPause = () => {
setIsPlaying((prev) => !prev);
if (isPlaying) metricService.reachGoal(EGoals.ROSE_VIDEO_PLAY_USER_PLAY);
if (!isPlaying) metricService.reachGoal(EGoals.ROSE_VIDEO_PLAY_USER_STOP);
};
return (
<div className={`${styles.container} ym-hide-content`}>
{!isPlaying && !isError && !isStarted && (
@ -67,7 +73,7 @@ const PersonalVideo = React.memo<IPersonalVideoProps>(({ url, gender }) => {
{!isError && isStarted && (
<PlayPauseButton
state={isPlaying ? "pause" : "play"}
onClick={() => setIsPlaying((prev) => !prev)}
onClick={handlePlayPause}
className={styles["play-pause-button"]}
/>
)}