Skip to content

Autoplay and Browser Policies

Daniel Neto edited this page Jul 18, 2024 · 8 revisions

In recent years, web browsers have implemented stricter policies regarding automatic video playback. Previously, autoplay was allowed in desktop browsers but not in mobile browsers (primarily to prevent unwanted data consumption over mobile networks). However, the rules have evolved, making the situation more complex.

Unfortunately, none of the HTML5 players on the market have full control over autoplay; the browser ultimately decides whether the video should play automatically or not. Typically, after a video is played manually, the next video in the sequence can start automatically without further user interaction.

Our Solution

Our current solution is as follows: When loading the page with a player, we will attempt to play the video with sound. If the browser prevents this, we will try to play the video again but with the sound muted. This approach aims to provide the best user experience within the constraints imposed by browser policies.

Autoplay Behaviors

  1. When the browser does not allow autoplay with sound: The video is forced to play with the volume muted. For example, if you open a new tab and navigate to a video page, the browser might mute the video by default to prevent an unexpected sound.

  2. When the browser allows autoplay: The video plays automatically with sound. This typically occurs when the user has interacted with the site previously or has allowed autoplay in their browser settings.

  3. When the browser prohibits autoplay altogether: The video will not play until there is user interaction. For instance, a browser might require you to click a play button before any video will start playing, regardless of the sound settings.

Important Note on Browser Control

Please note that we cannot control browser policies regarding autoplay. Browsers have their own mechanisms to decide when and how videos can autoplay. Here are some examples to illustrate this:

  • Example 1: If you visit a site for the first time, the browser might not allow the video to autoplay with sound to prevent unexpected disturbances. In this case, we attempt to play the video muted.
  • Example 2: If you have interacted with the site before (e.g., clicking somewhere on the page), the browser might allow the video to autoplay with sound.
  • Example 3: Some browsers might block autoplay entirely until you manually start the video by clicking the play button.

We always attempt to play videos with sound first. However, if you do not want videos to play muted, you cannot rely on the autoplay feature, as most browsers require user interaction to allow videos to play with sound.

Browser-Specific Autoplay Policies

Each browser has its own set of rules regarding autoplay. Here are the links to learn more about how to change autoplay behavior in different browsers:

Enable or Disable Autoplay by Default

In the site configuration menu, you can set the default behavior for autoplay, choosing whether you want your videos to autoplay or not.

image

User Overrides for Autoplay

By default, the browser will use the autoplay setting chosen by the site administrator. However, individual users can choose whether they want videos to autoplay. To do this, they can toggle the autoplay button available on all videos. This preference will be saved in the browser and used as the default from then on.

image

Clone this wiki locally