@@ -94,7 +94,7 @@ export function VideoSlide({ slide, offset }: VideoSlideProps) {
94
94
const scaleWidthAndHeight = ( ) => {
95
95
const scalingProps : React . ComponentProps < "video" > = { } ;
96
96
97
- // to prevent video element overflow from its container
97
+ // to prevent the video element overflow from its container
98
98
scalingProps . style = { maxWidth : "100%" , maxHeight : "100%" } ;
99
99
100
100
if ( width && height && containerRect ) {
@@ -126,6 +126,13 @@ export function VideoSlide({ slide, offset }: VideoSlideProps) {
126
126
return null ;
127
127
} ;
128
128
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
+
129
136
return (
130
137
< >
131
138
{ sources && (
@@ -167,6 +174,9 @@ export function VideoSlide({ slide, offset }: VideoSlideProps) {
167
174
onEnded = { ( ) => {
168
175
publish ( ACTIVE_SLIDE_COMPLETE ) ;
169
176
} }
177
+ onPointerUp = { stopPropagationInSafari }
178
+ onPointerDown = { stopPropagationInSafari }
179
+ onPointerMove = { stopPropagationInSafari }
170
180
>
171
181
{ sources . map ( ( { src, type, media } ) => (
172
182
< source key = { [ src , type , media ] . filter ( Boolean ) . join ( "|" ) } src = { src } type = { type } media = { media } />
0 commit comments