@@ -94,7 +94,7 @@ export function VideoSlide({ slide, offset }: VideoSlideProps) {
9494 const scaleWidthAndHeight = ( ) => {
9595 const scalingProps : React . ComponentProps < "video" > = { } ;
9696
97- // to prevent video element overflow from its container
97+ // to prevent the video element overflow from its container
9898 scalingProps . style = { maxWidth : "100%" , maxHeight : "100%" } ;
9999
100100 if ( width && height && containerRect ) {
@@ -126,6 +126,13 @@ export function VideoSlide({ slide, offset }: VideoSlideProps) {
126126 return null ;
127127 } ;
128128
129+ // avoid conflicts with swipe navigation in Safari
130+ const stopPropagationInSafari = ( event : React . PointerEvent ) => {
131+ if ( / ^ ( (? ! c h r o m e | a n d r o i d ) .) * ( s a f a r i | m o b i l e ) / i. test ( navigator . userAgent ) ) {
132+ event . stopPropagation ( ) ;
133+ }
134+ } ;
135+
129136 return (
130137 < >
131138 { sources && (
@@ -167,6 +174,9 @@ export function VideoSlide({ slide, offset }: VideoSlideProps) {
167174 onEnded = { ( ) => {
168175 publish ( ACTIVE_SLIDE_COMPLETE ) ;
169176 } }
177+ onPointerUp = { stopPropagationInSafari }
178+ onPointerDown = { stopPropagationInSafari }
179+ onPointerMove = { stopPropagationInSafari }
170180 >
171181 { sources . map ( ( { src, type, media } ) => (
172182 < source key = { [ src , type , media ] . filter ( Boolean ) . join ( "|" ) } src = { src } type = { type } media = { media } />
0 commit comments