Alex Rivera | Logout

HTML5 video on iPad

Asked 2010-05-25T21:38:48.203
17

I have a dynamic video gallery and it works great on a computer. When moving to an iPad, the video starts loading and it shows the cannot play icon. Instead of this I'd rather the video not show until it's ready to play. I have tried to add events listeners for "canplaythrough" and "canplay" and when they occur for the video to fade in then play. Does the iPad not support these events?

new_video = document.createElement('video');
new_video.setAttribute('class', 'none');
new_video.setAttribute('width', '568');
new_video.setAttribute('height', '269');
new_video.setAttribute('id', 'video'+video_num);
current_video.insertBefore(new_video, video_controls);
new_video.load();
new_video.addEventListener('canplaythrough', function() {
     $('#video'+video_num').fadeIn(100);
     new_video.play();
});
Edit
Report

1 Answer

1

the problem seems to be dynamically creating the video object - that somehow breaks the code on the iPad. I wrote a video player that moves the alreay present video element into an container and immediately the video stops working. no problem on other systems though... guess you gotta find a way to have the video element already in place and then add all your other code above and below it....

answered 2011-06-28T07:55:10.737

Your Answer