Chrome Vimeo Iframe自动播放不再起作用 [英] Chrome Vimeo Iframe autoplay not working anymore

查看:329
本文介绍了Chrome Vimeo Iframe自动播放不再起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从某些天以来,我的vimeo iframe不再自动播放.我知道chrome更新,它将阻止自动播放带有声音的视频.该功能块已经激活了吗?

since some days my vimeo iframe will not autoplay anymore. I know the chrome update, which will block autoplay videos with sound. Is the block already active?

Vimeo示例代码不起作用:

The Vimeo Example code doesn't work:

<iframe src="https://player.vimeo.com/video/12345?autoplay=1&loop=1&autopause=0" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

但是netflix.com和vimeo本身在首页上都有一个自动播放的视频,可以正常播放.

But netflix.com and vimeo itself has an autoplay video on the homepage, which works.

Chrome版本66.0.3359.139 macOS High Sierra 10.13.4

Chrome version 66.0.3359.139 macOS High Sierra 10.13.4

有人有想法或答案吗?

Does anyone have an idea or answer?

谢谢!

推荐答案

是的,根据他们的文档.

yes, according to their documentation it is.

https://help .vimeo.com/hc/zh-CN/articles/115004485728-自动播放和循环嵌入视频

FireFox,Chrome和Safari等高级浏览器现在默认情况下会阻止视频自动播放.

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

CHROME自动播放策略:

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

媒体参与度指数(简称为MEI),Chrome的一种方法是允许页面上的自动播放音频基于您以前作为用户与该网页的互动.您可以通过

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/

chrome://media-engagement/

MEI是根据用户个人资料计算的,并一直保留到隐身模式.

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

WEBKIT/SAFARI自动播放策略:

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

FIREFOX自动播放功能:

FIREFOX Auto-Play Improvements:

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

注意: 不要以为会播放媒体元素,也不要从一开始就显示暂停按钮.查看HTMLMediaElement上play函数返回的Promise,以查看是否被拒绝:

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
    });
}

这篇关于Chrome Vimeo Iframe自动播放不再起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆