Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vimeo video autoplay not working in Safari 11: NotAllowedError

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.

like image 551
Mladen Janjetovic Avatar asked Sep 27 '17 09:09

Mladen Janjetovic


People also ask

Why is Vimeo not Autoplaying?

If your webpage has permission to autoplay but your video is still not playing, you may need to add the allow=autoplay parameter to the Vimeo iframe and any iframe in your webpage that the player is contained within.

Does Vimeo work on Safari?

Supported browsers — vimeo.com site Chrome (has automatic updates) Firefox (has automatic updates) Safari.

How do I autoplay videos in Safari?

In the Safari app on your Mac, choose Safari > Preferences, then click Websites. Click Auto-Play in the list on the left. Do any of the following: Choose settings for a website in the list: Select the website on the right, then choose the option you want for it.


1 Answers

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.

enter image description here

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:

enter image description here

like image 127
Mladen Janjetovic Avatar answered Oct 14 '22 23:10

Mladen Janjetovic