I'm using vimeo player js API with froogaloop library for starting video when user clicks on the specific button on the site.
Here is how I embed video:
<iframe id="my_video" src="video_source?title=0&byline=0&portrait=0&color=fd735b&api=1&player_id=my_video" width="940" height="529" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
And here is how I use js API:
var iframe = $('#my_video')[0];
var player = $f(iframe);
player.addEvent('ready', function() {
$("#watch_video_wrapper").bind('click', function(){
$("html, body").animate({ scrollTop: $('#video_page').offset().top }, 3500);
player.api('play');
});
});
So when player is ready I bind 'click' event to the "Watch Video" parent container. It works on the desktops. But when I tried it on iPhone 3GS or iPad simulator video is not starting. Also I checked vimeo example on the site:
and they do not work on mobile devices too.
On mobile devices this API will work only after you have started video manually with play button in player. But if you load page, do not start video manually and try to play it with JS - it will not work.
Did anybody face with this problem? Or I'm doing something wrong?