Vimeo video autoplay not working in Safari 11: NotAllowedError

Mladen Janjetovic picture Mladen Janjetovic · Sep 27, 2017 · Viewed 9.8k times · Source

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.

Answer

Mladen Janjetovic picture Mladen Janjetovic · Sep 27, 2017

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