Browser chrome prevents automatic playback

you visit a website and immediately a sound is heard or a video is played automatically, although you did not want to see it at all?

Well, if google has its way, these scenarios will soon be a thing of the past. what is called autoplay in the technical jargon, is widely prevented with the release of the latest browser version of google chrome.

We explain what criteria must be met for autoplay to work anyway and how developers and website owners can react.

Google chrome and the autoplay policy

On 18. April 2018 google released version 66 of its in-house browser chrome. Among other things, all SSL certificates from symantec have since been classified as insecure. In addition, a separate autoplay policy was also introduced, a separate set of rules.

Say google does not want to prevent autoplay per se. However, various criteria apply for this to be permitted.

  • Automatic playback of muted content is always allowed
  • Autoplay with sound is allowed if:
  • The user has already interacted with the page (click, tap, etc).)
  • The user has already played a video with sound
  • mobile, when the user has added the web page to his home screen

Generally, autoplay is already prevented in all mobile browsers to conserve data consumption.

Instead of automatic playback, the first frame of the video is displayed as a still image.

Approaches for developers

Developers should respond to the policy and show a button for manual playback. Otherwise, the user does not see the media content until he or she visits the page again.

Whether the autoplay policy takes effect can be seen in the chrome console. This can be easily opened with the F12 key. if you now visit a page where autoplay is prevented, you will see the following error message.

error message about autoplay policy in google chrome

this error message can be avoided as a javascript developer by asking if the policy is followed

if autoplay was prevented, a button should be shown to the visitor. So he can start the playback manually.

Another solution is to mute the videos in the first place. If the videos actually have a sound, then it should be made possible for the user that he can switch on the sound manually. For this it is recommended to display a button again.

audio content should generally only start when the user explicitly requests it to do so. Here you could consider to integrate a general button on the page, with which the user allows the audio playback.

Update: firefox also prevents autoplay

With version 66, the firefox browser now also blocks autoplay content. Whether a content was blocked can be seen in the browser line.

The developer still has the possibility to mute the video from the beginning.

Outlook

As we are users of websites ourselves, we welcome the step by google. An unwanted audio playback is unpleasant when surfing the net. We hope, however, that there will be a general solution, perhaps also from the W3C, and not again each browser has its own requirements.

We report again and again about measures which affect the websites of our customers, e.g.B. about the DSGVO or google maps. So we try to keep you up to date.

If you have any suggestions about these or other topics, please feel free to leave a comment or contact us.

Leave a Reply

Your email address will not be published.