How can I enable autoplay for a video?
Starting the playback automatically as soon as Bitmovin Player is loaded is possible via the player configuration:
var config = {
key: 'PLAYER_API_KEY',
source: {
dash: '//URL/stream.mpd',
hls: '//URL/stream.m3u8',
progressive: '//URL/file.mp4'
},
playback: {
autoplay: true
}
}
This works on mobile devices as well, as long as the player is muted from the beginning:
var config = {
key: 'PLAYER_API_KEY',
source: {
dash: '//URL/stream.mpd',
hls: '//URL/stream.m3u8',
progressive: '//URL/file.mp4'
},
playback: {
autoplay: true,
muted: true
}
}
More information regarding browsers autoplay policies can be found in our according blog post.
Updated about 1 year ago