Tamara
Tamara

Reputation: 2980

Vimeo player js API not working on mobile devices

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:

Example 1 Example 2

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?

Upvotes: 2

Views: 5812

Answers (3)

Binary101010
Binary101010

Reputation: 580

If you look right here it has a table of compatibilities. It looks like mobile with the play option is not supported.

https://developer.vimeo.com/player/js-api#function-compatibility

Upvotes: 1

Mike
Mike

Reputation: 678

I dont think its a vimeo issue - its related to IOS & Android's policies around not playing video without user interaction. See this answer : On iPhone, Vimeo Javascript API .play() function doesn't work until the video has been played

Upvotes: 1

desloovere_j
desloovere_j

Reputation: 756

Vimeo only makes "mobile safe" versions of the movie if you have a "Vimeo Plus" account. So if you don't have a plus account, the video will never be "ready" (= loaded).

Upvotes: 0

Related Questions