From 27265f3bcad9357ec0758e3d47e5697e7cac3414 Mon Sep 17 00:00:00 2001 From: Hubbe Date: Mon, 16 Nov 2020 13:58:51 +0200 Subject: [PATCH] Set video.js volume to 50% by default When the video.js player is ready, set its volume to 50% --- thrimbletrimmer/scripts/playerSetup.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/thrimbletrimmer/scripts/playerSetup.js b/thrimbletrimmer/scripts/playerSetup.js index 75a47d1..71b1f3c 100644 --- a/thrimbletrimmer/scripts/playerSetup.js +++ b/thrimbletrimmer/scripts/playerSetup.js @@ -30,6 +30,10 @@ function setupPlayer(isEditor, source, startTrim, endTrim) { } player = videojs('my-player', options, function onPlayerReady() { 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. this.on('ready', function() {