Chrome Vimeo Iframe autoplay not working anymore

ぃ、小莉子 提交于 2019-12-02 20:50:57

yes, according to their documentation it is.

https://help.vimeo.com/hc/en-us/articles/115004485728-Autoplaying-and-looping-embedded-videos

EDIT:

Advance browsers like FireFox, Chrome and Safari are now blocking video autoplay by default.

CHROME Auto-Play Policy:

https://developers.google.com/web/updates/2017/09/autoplay-policy-changes

The Media Engagement Index, or MEI for short, a way of Chrome is to allow AutoPlay audio on your page to be based on your previous interactions with this webpage as a user. You can see what this looks like by going to

chrome://media-engagement/

MEI is calculated per user profile, and is persisted to incognito mode.

WEBKIT/SAFARI Auto-Play Policy:

https://webkit.org/blog/7734/auto-play-policy-changes-for-macos/

FIREFOX Auto-Play Improvements:

https://www.ghacks.net/2018/09/21/firefox-improved-autoplay-blocking/

NOTE: Don’t assume a media element will play, and don’t show the pause button from the start. Look at the Promise returned by the play function on HTMLMediaElement to see if it was rejected:

var promise = document.querySelector('video').play();

if (promise !== undefined) {
    promise.catch(error => {
        // Auto-play was prevented
        // Show a UI element to let the user manually start playback
    }).then(() => {
        // Auto-play started
    });
}

Annotating the <iframe> with an allow attribute worked for me:

<iframe ... allow="autoplay; fullscreen"></iframe>

It's called "Iframe delegation" and is described here: https://developers.google.com/web/updates/2017/09/autoplay-policy-changes.

You need to add &muted=1 to the iFrame src path and you need to add the attribute allow="autoplay" to the iFrame. Now the Vimeo video starts automatically again in Chrome.

Now the autoplay video just works if the audio is muted, you need to add the muted parameter into your api or iframe code &muted=1, you can change your browser preferences to allow autoplay unmuted videos: chrome://flags/#autoplay-policy Change the default option to "No user gesture is required"

If the user clicks the video you can unmuted it!!

bcartign

Autoplay + Mute + Start at time x sec =

<div>
    <iframe src="https://player.vimeo.com/video/342787403?&autoplay=1&loop=1&title=0&byline=0&portrait=0&muted=1&#t=235s" style="position:absolute;top:0;left:0;width:100%;height:100%;" width="1400" height="900" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen>
    </iframe>
</div>

#t parameter must be the last one.

If you are paid member and want to use video as a background, this is probably what you need:

?background=1: This parameter automatically disables all elements in the player (play bar, buttons, etc), autoplays, loops, and mutes your video on load. Please note: the background parameter is only supported for videos hosted by paid members. Learn more here.

Or, if you are not:

?muted=1 This parameter will automatically mute your video on load. Once your video plays, viewers can manually un-mute by clicking on the volume bar within the player.

BUT, I still can't make it work on the phone.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!