Skip to content

Commit

Permalink
fix(video): prevent offscreen video slide playback on swipe (fix #316)
Browse files Browse the repository at this point in the history
  • Loading branch information
igordanchenko committed Nov 15, 2024
1 parent e4c4fa1 commit b91a18a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/plugins/video/VideoSlide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ export function VideoSlide({ slide, offset }: VideoSlideProps) {
{...resolveString("crossOrigin")}
{...resolveString("preload")}
onPlay={() => {
if (offset !== 0) {
videoRef.current?.pause();
return;
}

publish(ACTIVE_SLIDE_PLAYING);
}}
onEnded={() => {
Expand Down

0 comments on commit b91a18a

Please sign in to comment.