FIX: Set volume only if it exists in localstorage

This commit is contained in:
Edgardo Ramírez 2020-10-06 15:03:15 -05:00
parent e2200f09d7
commit 66db710761

View file

@ -80,7 +80,9 @@ class OwncastPlayer {
startPlayer() {
this.log('Start playing');
const source = { ...VIDEO_SRC };
this.vjsPlayer.volume(localStorage.getItem('owncastVolume'));
if (localStorage.getItem('owncastVolume') !== null)
this.vjsPlayer.volume(localStorage.getItem('owncastVolume'));
this.vjsPlayer.src(source);
// this.vjsPlayer.play();
}