HTML5 event listeners Video on iPad Safari not working?

I have this in <head> :

 <script> function log(event){ var Url = "./log.php?session=<?php echo session_id(); ?>&event=" + event; xmlHttp = new XMLHttpRequest(); xmlHttp.open( "GET", Url, true ); xmlHttp.send( null ); } </script> 

And this is in <body> :

 <video id="video" src="./video/LarryVideo.mp4" controls="controls" poster="./img/video_poster.jpg" onabort="log('onabort');" oncanplay="log('oncanplay');" oncanplaythrough="log('oncanplaythrough');" ondurationchange="log('ondurationchange');" onemptied="log('onemptied');" onended="log('onended');" onerror="log('onerror');" onloadeddata="log('onloadeddata');" onloadedmetadata="log('onloadedmetadata');" onloadstart="log('onloadstart');" onpause="log('onpause');" onplay="log('onplay');" onplaying="log('onplaying');" onprogress="log('onprogress');" onratechange="log('onratechange');" onreadystatechange="log('onreadystatechange');" onseeked="log('onseeked');" onseeking="log('onseeking');" onstalled="log('onstalled');" onsuspend="log('onsuspend');" ontimeupdate="log('ontimeupdate');" onvolumechange="log('onvolumechange');" onwaiting="log('onwaiting');"> <script> QT_WriteOBJECT('./video/LarryVideo.mp4', '380px', '285px', // width & height '', // required version of the ActiveX control, we're OK with the default value 'scale', 'tofit', // scale to fit element size exactly so resizing works 'emb#id', 'video_embed', // ID for embed tag only 'obj#id', 'video_obj'); // ID for object tag only </script> </video> 

My regular Safari creates wonderful log file entries as expected. IPad’s Mobile Safari, however, does nothing.

What could be wrong with this?

Thanks!

+6
html5 safari javascript-events ipad video
source share
1 answer

I also failed to get readstate on ipad, but you can get other events that more or less allow you to output readistate.

 var audio = new Audio("someSource.mp3"); audio.play(); /* you may need to use .load() depending on how the event was initiated */ audio.addEventListener("canplay", handleCanPlay, false); audio.addEventListener("durationchange", handleDurationChange, false); 

But let's be clear, the problem is that Apple says a lot to the whole damn world that they are misusing the Internet. Of course, everyone hates sites that start playing music when they load, but then Apple goes blank and kills ANY / ALL audio / video buffering, which is clearly not triggered by the user's gesture, because Apple seems to think that their users are too lag behind click back if the site bothers them; fans agree too. It basically leaves the rest of us to rip shit out of our apps if we dare to try and control any sound effects. I know this is not a place for ranting ... but I’ll be damned if you build ANY soft interesting / interactive experience in HTML5 on iPad, it’s not one facepalm after another ... whether it’s a 5 MB cache limit, it just leads browser crash if there are too many images on the page (according to Apple) or difficulties with pre-loading any media files to improve the user interface - seriously, outside of blogs and rss-readers for Wordpress, Safari implementation for Safari mobile devices is pretty useless. So, the dream that HTML5 "builds once, plays anywhere", the value proposition is dead, and we are back to developing our own applications ... at least this gives us a good job / rant security / pant

+36
source share

All Articles