Autostart
How to work with autostart.
You are reading API v2 documentationStill using the Legacy API? Access the Legacy API documentation.
In recent years, browsers have been setting stricter policies regarding autostart behavior on videos. Although you can activate the autostart behavior in the Player's configuration, full control over autostart behavior isn't possible, as it ultimately depends on each user's browser settings.
The playback.autostart Player parameter accepts the following values:
first_time_viewable: Playback starts as soon as the Player enters the viewport for the first time.on: Playback starts as soon as the Player is loaded.off: Playback starts only on user interaction.
TipWe advise using the autostart mode
first_time_viewable: it helps safeguard viewability and monetization.
first_time_viewableis available when embedding the Player on web using the Embed Script or Library Script. It is not available with the iFrame embed method.
You can set this parameter when creating or updating a Player via the API:
curl --request POST \
--url https://api.dailymotion.com/v2/profiles/<YOUR_PROFILE_ID>/players \
--header 'accept: application/json' \
--header 'authorization: Bearer ${ACCESS_TOKEN}' \
--header 'content-type: application/json' \
--data '{
"name": "My Player",
"playback": {
"autostart": "first_time_viewable"
}
}'Our Player includes smart autostart behavior engineered to maximize the chances of automatically playing a video in all browser conditions.
When autostart is enabled, the Player goes through the following waterfall:
- If the browser allows autostart, the Player will automatically play with sound on.
- If autostart is prevented by the browser, it will attempt to play the video again but will automatically mute itself. In this case on mobile devices, the Player will display a "Tap to unmute" call to action that allows users to unmute with a single tap anywhere on the Player.
- If the browser doesn't allow autostart, the Player will display a start screen and wait for the user's interaction to start video playback.
Updated 6 days ago
