Skip to content

Instantly share code, notes, and snippets.

@gsemino
Last active July 13, 2018 09:00
Show Gist options
  • Save gsemino/34bfd74c744ca7b8f83905822a0b8edc to your computer and use it in GitHub Desktop.
Save gsemino/34bfd74c744ca7b8f83905822a0b8edc to your computer and use it in GitHub Desktop.
Bitmovin HTML5 Player configuration (mute, autoplay and loop video)
var conf = {
key: '<your-license-key-here>',
source: {
dash: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd',
hls: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8',
progressive: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/MI201109210084_mpeg-4_hd_high_1080p25_10mbits.mp4',
poster: 'https://media.giphy.com/media/5wFGNEqoIuQlwyjxOB/giphy.gif'
},
playback: {
//bellow will autoplay video and mute it
autoplay: true,
muted: true
},
events: {
//will start playback again when video finishes playing
onPlaybackFinished: function () {
this.play();
}
}
};
var player = bitmovin.player('player');
player.setup(conf).then(
function(value) {
// Success
console.log('Successfully created bitmovin player instance');
},
function(reason) {
// Error!
console.log('Error while creating bitmovin player instance');
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment