diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index bb15d92952..767971d8e6 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -11,6 +11,8 @@ function playAudio(items, params) { var item = items[0]; + var volume = localStorage.getItem("volume") || 0.5; + var baseParams = { audioChannels: 2, audioBitrate: 128000 @@ -50,10 +52,16 @@ $('#mediaElement', nowPlayingBar).html(html); + $(".itemAudio").volume = volume; + $(".itemAudio").on("ended",function(){ Playlist.playNext(); }); + $(".itemAudio").on("volumechange", function () { + localStorage.setItem("volume", (this).volume); + }); + return $('audio', nowPlayingBar)[0]; }