Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPad touch events on <video> tag

I'm building a javascript-powered gallery on the iPad that can display both images and video. To browse the gallery, you can swipe left or right (similar to the iPad's Photo application). However, none of my touch events work when swiping over a <video> element. It seems to take over my touch events, even on elements that may have a higher z-index. I have tried adding a touchmove handler that calls e.preventDefault(), but that doesn't seem to work either. Has anyone else run into this problem and found a solution for it?

like image 773
mbxtr Avatar asked Aug 12 '10 16:08

mbxtr


1 Answers

Your touch events are being absorbed by the default controls of the player. If you set the video element's controls to false you can have full control of the events on the video element. But doing this means you'll have to implement your own custom controls, which isn't very hard.

like image 97
Jey Balachandran Avatar answered Nov 13 '22 05:11

Jey Balachandran