I’ve been battling to get autoplay to work on a video modal using a Vimeo video.
I have tracked it down to being a Chrome specific and Vimeo specific issue. You can see in the live link below that the video plays for 1s then pauses itself.
Hi @andyjames because autoplay is restricted and all browsers require user interaction to give them the control if they want to see or hear video and/or audio (willing or health issue reasons) I was curious how you have got over this global autoplay restriction. I have tried your solution in Safari, Chrome, Firefox and you solution fails in all of them.
To be specific this is when using https://video-url&autoplay=1 which is intended to play the video and bypass the restriction. It works fine with youtube and vimeo works in other browsers just not Chrome.
Also since I needed the video to play when a modal opened it is the desired behaviour as the user is clicking a play button on the page and then having to click play again on the video is not ideal UX. This also takes care of pausing the video when the user closes the modal.
I have updated my post to include some additional info, my solution unfortunately does not work with the Webflow Video element, so I added the iframe manually in an HTML embed.
With some more time I could maybe get it to work with the Webflow video element but based on the output when using this, Webflow adds a video iframe wrapper and then inside that iframe the video embed iframe is added. Therefore it needs javascript that will find the parent iframe and then inside that iframe find the vide iframe to trigger play and pause.
Or did you try with the code provided in your own project?
The link I posted will not work… the link was intended to show the issue that it does not autoplay in Chrome. I did not post a link with the solution I only added the code and description I used to resolve it.
Yes @andyjames I did, I have tried now on your a newly posted link with identical result. No. I haven’t applied on my test project as I’m not interested breaking these rules that were set also to protect people with health issues. if I have request like that I will explain client these reasons and they understand why there have to be a play button.
I have tried now on your a newly posted link with identical result
I posted exactly the same link (of it NOT working in chrome) as my original post for reference so yeah it wouldn’t work
@Stan I think you are misunderstanding the implementation and reason for this need. I am well versed in UX and accessibility. This is not breaking any rules nor is it a concern to people with health issues.
I am NOT trying to make a video play when the page loads. Nor is my solution doing so. Notice that ALL code is triggered on a click event. NOT page load.
I clearly stated that in my implementation the user clicks play on an icon on my page… therefore the user shows intent to watch the video. When the modal opens the video should play because the user asked for it to play. If it does not then the user must click play twice which is a much worse user experience.
Here is a youtube video of someone trying to explain how to do this and it works but it is using youtube. This however does not work with Vimeo.
HI @andyjames thanks for video now I finally get it All confusion was that you said that you have solution and post links with example that was not working(that was for me most confusing part) instead of posting working sample as you have in explanation video. Now I see that video is triggered with interaction.