Set video.js volume to 50% by default

When the video.js player is ready, set its volume to 50%
pull/210/head
Hubbe 4 years ago committed by Christopher Usher
parent f8c877775d
commit 27265f3bca

@ -30,6 +30,10 @@ function setupPlayer(isEditor, source, startTrim, endTrim) {
} }
player = videojs('my-player', options, function onPlayerReady() { player = videojs('my-player', options, function onPlayerReady() {
videojs.log('Your player is ready!'); videojs.log('Your player is ready!');
// Set player volume to 50% by default
var defaultVolume = 0.5;
this.volume(defaultVolume);
// In this context, `this` is the player that was created by Video.js. // In this context, `this` is the player that was created by Video.js.
this.on('ready', function() { this.on('ready', function() {

Loading…
Cancel
Save