Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Controls overlay for video on iPhone/iPad

I am writing a webapp where I need to display a video and some (non standard) controls for it, which should appear in overlay. So create some divs and position them over the video, with a higher z-index.

Still, on iPhone and iPad, it appears those controls are not clickable. I register actions for the click event, but that is not fired at all when I tap on the controls. I understand I can have no control while the video is actually playing (it even goes fullscreen), but the problem is that the controls are unusable even when the video is stopped.

I have also tried to remove the controls attribute from the video, with no effect.

Is there a way to register click events for elements that are positioned over a video on iPhone/iPad?

like image 399
Andrea Avatar asked Nov 30 '11 11:11

Andrea


People also ask

Where is the video overlay settings button in iMovie?

2.2 How to Overlay Videos in iMovie on iPhone/iPad Tap the More Options button (three dots), then you will see the four video overlay options, select an overlay option you need.


1 Answers

I had the same problem and got it working by setting the CSS property of the HTML5 video element while

paused to -webkit-transform:scale(0.01);

playing to -webkit-transform:scale(1);

The problem is that the HTML5 video element on iOS seems to hijack the click events in the areas (of the elements layered on top) that are contained in the bounding box of the video element. If the bounding box is made smaller with scale(0.01) or the bounding box is pushed off the screen with translateX(-2560px), no element areas are directly above the video element and the click events will get fired.

like image 172
luwes Avatar answered Sep 28 '22 08:09

luwes