diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index 4f248d3bf1..a61831f062 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -117,6 +117,8 @@ var screenWidth = Math.max(screen.height, screen.width); var screenHeight = Math.min(screen.height, screen.width); + var volume = localStorage.getItem("volume") || 0.5; + var baseParams = { audioChannels: 2, audioBitrate: 128000, @@ -167,7 +169,8 @@ { type: "video/mp4", src: mp4VideoUrl }, { type: "video/mp2t; codecs='h264, aac'", src: tsVideoUrl }, { type: "application/x-mpegURL", src: hlsVideoUrl }, - { type: "video/ogg", src: ogvVideoUrl }]); + { type: "video/ogg", src: ogvVideoUrl }] + ).volume(volume); videoJSextension.setup_video( $( '#videoWindow' ), item ); @@ -180,6 +183,10 @@ $(".vjs-remaining-time-display").show(); }); + (this).addEvent("volumechange",function(){ + localStorage.setItem("volume", (this).volume()); + }); + (this).addEvent("play", MediaPlayer.updateProgress); ApiClient.reportPlaybackStart(Dashboard.getCurrentUserId(), item.Id);