player.js icon indicating copy to clipboard operation
player.js copied to clipboard

Vimeo player autoplay feature does not work on mobile devices

Open gary0033 opened this issue 8 years ago • 34 comments

Vimeo's code to automatically start a video on the Vimeo player when loaded without having to press the play button is: autoplay=1. However, Vimeo states that this will not work on mobile devices using Vimeo's player. Autoplay does work on external (third party) players linked to Vimeo.

Two questions: Is there any technological issue that prevents Vimeo from offering an autoplay option on their own embedded player? Second, is there a way to get the Vimeo player to autoplay on mobile devices? A work around?

gary0033 avatar Jan 18 '18 17:01 gary0033

I see https://webkit.org/blog/6784/new-video-policies-for-ios/ We will put this in soon, sorry for the delay on this.

luwes avatar Jan 19 '18 15:01 luwes

Hey luwes, just checking.... did this change rollout in the past few hours (day)? Was troubleshooting the issue and it suddenly went away without any obvious changes to my site or its code... autoplay is working

gldsgns avatar Jan 31 '18 01:01 gldsgns

strange, it's actually not in yet @gldsgns :) it's disabled for most touch devices.

luwes avatar Feb 06 '18 20:02 luwes

Ah, then it must be related to a workaround I inadvertently enabled with the embed. Thanks for the reply.

gldsgns avatar Feb 06 '18 21:02 gldsgns

@gldsgns could you please share some information about the workaround. I need to do it for a client's project. Autoplay works fine on desktop devices but not on mobile devices.

warmac92 avatar Mar 07 '18 17:03 warmac92

@luwes I would be very thankful if you can comment about any updates for this change.

warmac92 avatar Mar 07 '18 17:03 warmac92

I ended up using a wordpress plugin, Revolution Slider

On Wed, Mar 7, 2018 at 9:58 AM Abhishek Shrivsatava < [email protected]> wrote:

@gldsgns https://github.com/gldsgns could you please share some information about the workaround. I need to do it for a client's project. Autoplay works fine on desktop devices but not on mobile devices.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vimeo/player.js/issues/199#issuecomment-371224382, or mute the thread https://github.com/notifications/unsubscribe-auth/AiUFwrhvPzPD7eDMKGZWewCrKFfCEaejks5tcB6GgaJpZM4RjRzR .

-- Patrick David Coan 503.954.8834 [email protected]

gldsgns avatar Mar 07 '18 18:03 gldsgns

@gldsgns can you let me know how you got a vimeo video to autoplay on mobile using Rev Slider?

ActonBV avatar Mar 20 '18 13:03 ActonBV

Hi @luwes and everyone, anything new about this? It would be very useful to have! +1

RiccardoZaffalon avatar Mar 23 '18 12:03 RiccardoZaffalon

Autoplay on mobile works now if muted is enabled.

luwes avatar Mar 23 '18 15:03 luwes

@luwes I've tried everything and it still doesn't work

I'm currently using: api=1&background=1&muted=1&loop=1&autoplay=1

The only way to get the video to play on mobile is to tap and hold for 2+ seconds. Help!

smithsmithsmithsmith avatar Mar 30 '18 18:03 smithsmithsmithsmith

To clarify, it's not true autoplay- simply the ability for my custom button to play the video without pressing the vimeo play button. This wasn't working because of the prohibition of autoplay on mobile, but the RevSlider has a setting "No Poster On Mobile" in the Vimeo layer which allows the Vim. Play to be triggered.

gldsgns avatar Mar 30 '18 18:03 gldsgns

I see, I'm utilizing this video embed in Shopify and don't have access to RevSlider. Any thoughts on how to remove the poster on mobile?

On Fri, Mar 30, 2018 at 11:30 AM, gldsgns [email protected] wrote:

To clarify, it's not true autoplay- simply the ability for my custom button to play the video without pressing the vimeo play button. This wasn't working because of the prohibition of autoplay on mobile, but the RevSlider has a setting "No Poster On Mobile" in the Vimeo layer which allows the Vim. Play to be triggered.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vimeo/player.js/issues/199#issuecomment-377590919, or mute the thread https://github.com/notifications/unsubscribe-auth/AkLnRJr2wcya1LQ-keX04-eygEFyxXi7ks5tjnnUgaJpZM4RjRzR .

smithsmithsmithsmith avatar Mar 30 '18 19:03 smithsmithsmithsmith

@smithsmithsmithsmith I managed to get it working like this: HTML:

<div id="videoblock"></div>

JavaScript:

var options = {
    id: [vimeo-video-id],
    muted: true,
    background: true,
    loop: true,
};
var homeplayer = new Vimeo.Player("videoblock", options);

AdrianMrn avatar Apr 04 '18 12:04 AdrianMrn

@AdrianMrn doesn't seem to work for me, testing on iPhone6 latest iOS. Might just resort to taking a chunk out of our server's bandwidth and uploading the video there in a video wrapper.

pat-sullivan avatar Apr 10 '18 18:04 pat-sullivan

I ran into this issue as well, and not sure if this helps anyone else - but with my player - which has autoplay, background and loop set to true - I ran .setCurrentTime(0) and it played on document ready!

ar9jun avatar Apr 30 '18 18:04 ar9jun

Confused. Did you append .setCurrentTime(0)to the end of the link to your music? If not, where did you put this command?

From: Arjun Srivastava Sent: Monday, April 30, 2018 1:09 PM To: vimeo/player.js Cc: gary0033 ; Mention Subject: Re: [vimeo/player.js] Vimeo player autoplay feature does not work on mobile devices (#199)

I ran into this issue as well, and not sure if this helps anyone else - but with my player - which has autoplay, background and loop set to true - I ran .setCurrentTime(0) and it played on document ready!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

gary0033 avatar Apr 30 '18 18:04 gary0033

@gary0033 So use the Vimeo.Player constructor to create an instance of your player (you can see how in the Getting Started section of the ReadMe and on the player instance (let's say you called it musicPlayer), you would run musicPlayer.setCurrentTime(0);`.

In my case, I'm using jQuery, so I do the following:

var musicVideoIframe = document.querySelector('#music-video');
var musicPlayer = new Vimeo.Player(musicVideoIframe);

$(document).ready(function() {
    musicPlayer.setCurrentTime(0);
});

Check out the ReadMe to figure out how to create an instance for your needs.

ar9jun avatar Apr 30 '18 19:04 ar9jun

Some of this is over my head so I’m going to get some technical help.

Are you saying that when you use the code .setCurrentTime(0) that the Vimeo player will auto play on an iphone?

Thanks.

From: Arjun Srivastava Sent: Monday, April 30, 2018 2:02 PM To: vimeo/player.js Cc: gary0033 ; Mention Subject: Re: [vimeo/player.js] Vimeo player autoplay feature does not work on mobile devices (#199)

@gary0033 So use the Vimeo.Player constructor to create an instance of your player (you can see how in the Getting Started section of the ReadMe and on the player instance (let's say you called it musicPlayer), you would runmusicPlayer.setCurrentTime(0);`.

In my case, I'm using jQuery, so I do the following:

var musicVideoIframe = document.querySelector('#music-video'); var musicPlayer = new Vimeo.Player(musicVideoIframe);

$(document).ready(function() { musicPlayer.setCurrentTime(0); }); Check out the ReadMe to figure out how to create an instance for your needs.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

gary0033 avatar Apr 30 '18 19:04 gary0033

Has there been any progress on this? I'm currently on a plus plan and have a video embedded with background and mute set to 1, but still does not autoplay on mobile.

linuxbastard avatar May 22 '18 01:05 linuxbastard