Autoplay Demo 2

Back to first example ?
Yep !

All the setup is done through javascript.
This time, rather than giving the choice between several qualities, we are offering two languages : French and German, which is the default.
In the settings panel, we change the qualityLabel from QUALITY to LANGUAGE and set the playbackRates option as an empty array, so the user can't modify the playback speed.
As for the first example, we use the callback function to hide the controls when the player is ready and starts playing.

HTML

<div class="video-container"> <video><!--Our video--></video> </div>

JAVASCRIPT

new AmstramgramMediaPlayer(document.querySelector('video'), { autoplay: true, src: [ { src: 'assets/video/Castors-720p.mp4', quality: 'Français' }, { src: 'assets/video/Castors-720p-de.mp4', quality: 'Deutsch', default: true, } ], thumbnails: { src: 'assets/video/Castors-thumbnails.jpg', int: 2.12 }, settings: { qualityLabel: 'LANGUAGE', playbackRates: [] }, subtitles: { sources: [ { src: 'assets/video/Castors-fr.vtt', label: 'Français', srclang: 'fr', }, { src: 'assets/video/Castors-en.vtt', label: 'English', srclang: 'en', }, ], default: 'en' }, volume: 0, volumeGroup: 2, volumeForced: true, }, function () { //this = our player //Start listening to amst__play event this.on('amst__play', function hideControlsWhenPlayBegin() { //this = our player //Stop listening this.off('amst__play', hideControlsWhenPlayBegin) //Hide the controls this.hideControls() }) } )