Autoplay video, audio and GIFs
Iframely lets you safely autoplay embedded players. It works as “play-on-scroll”: playback starts when/if user sees the media. Player pauses or stops when it leaves the viewport or another player is started.
To start media playback when player is visible.
To mute the players on start for supported publishers on desktop (plus see Chrome browser below).
HTML code in API response will point to Iframely iFrame and will also include the
embed.js script. You can omit the script, as with any other API call.
The combination of
&mute=1is ambiguous for audio. Iframely will return a regular player instead so you can safely make API calls targeting only muted video.
First and foremost, Autoplay feature relies on Intersection Observer to detect when media is visible to your user.
Most modern browsers support the observers. See the coverage.
We deliberately do not fall back to the old school of visibility detections for the legacy browsers. The intention is to be gentle on end-user’s CPU and not to render your site sluggish with constant synchronous visibility checks.
If we cannot run visibility checks, Iframely will simply fall back to non-autoplaying media variants.
Chrome’s Autoplay Policy checks Media Engagement Index (MEI). It is calculated individually for your web domain.
Muted autoplay is always allowed. Autoplay with sound is allowed if user has interacted with the domain (click, tap, etc.) or if MEI threshold has been crossed.
In other words, whether a media will autoplay or not depends on your site’s user experience and engagement of an individual user.
&mute=1and have all playback muted if most of your visitors are first-timers with no prior domain interactions.
For development and debugging purposes, you may also opt to change Autoplay-Policy via developer switches in
Most mobile platforms require a user gesture to autoplay a media with sound. Iframely will therefore try and mute media playback on mobile for all publishers that allow such control (see below).
For publishers that don’t provide such mute control, Iframely will simply fall back to non-autoplaying media variants.
Additionally, WebKit has released the support of intersection observers in iOS 12.2. Older browser versions will fall back to non-autoplaying media.
Supported media publishers
“Autoplay” requires playback sync so to pause/stop a playing video when another one on the page starts. Therefore, the list of supported media publishers for “Autoplay” is the same our list of publishers for “Playback sync”. See here.