HTML5 video on iPad
Posted
by mrollinsiv
on Stack Overflow
See other posts from Stack Overflow
or by mrollinsiv
Published on 2010-05-25T21:38:48Z
Indexed on
2010/05/25
21:41 UTC
Read the original article
Hit count: 445
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();
});
© Stack Overflow or respective owner