Vimeo 视频自动播放在 Safari 11 中不起作用:NotAllowedError [英] Vimeo video autoplay not working in Safari 11: NotAllowedError
问题描述
自从上次 Safari 更新到版本 11 以来,一些视频停止播放.最糟糕的是,有时,就像五次尝试一样,它会起作用.我认为原因是我的 JS 脚本集成了 Vimeo Player API,但最终甚至 Vimeo 的嵌入链接根本不起作用.
因此,当您在 Safari 11 中打开嵌入视频时,它不会启动并完全阻止.你可以通过打开看到它,即
即使视频(如我的情况)没有声音级别,但导出时没有音量.可以在地址栏看到sovolume图标:
Since the last Safari update to version 11, some videos stopped working. The worst is that sometimes, like once in five attempts, it works. I thought that the reason is my JS script that integrates Vimeo Player API but it ends up that even Vimeo's embed link doesn't work at all.
So, when you open embed video in Safari 11 it won't start and it blocks completely. You can see it by opening i.e. https://player.vimeo.com/video/XXXXXXXX?autoplay=1
In console log you can get something like:
Unhandled Promise Rejection: NotAllowedError (DOM Exception 35): The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.
You can add background
URL param to iframe src
:
<iframe src="https://player.vimeo.com/video/XXXXXXXX?autoplay=1&background=1>
If your video has a sound you can also export your video again with no sound track at all. Than you probably don't need the background
param at all.
The catch is that Safari 11 is blocking all videos autoplay if they have sound in it.
Even when video, like in my case, doesn't have sound level but it is exported with sound with no volume. You can see the sovolume icon in address bar:
这篇关于Vimeo 视频自动播放在 Safari 11 中不起作用:NotAllowedError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!