diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index 767971d8e6..3549b8aa30 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -11,7 +11,7 @@ function playAudio(items, params) { var item = items[0]; - var volume = localStorage.getItem("volume") || 0.5; + var volume = localStorage.getItem("volume") || 0.5; var baseParams = { audioChannels: 2, @@ -52,15 +52,18 @@ $('#mediaElement', nowPlayingBar).html(html); - $(".itemAudio").volume = volume; + $(".itemAudio").each(function () { + this.volume = volume; + }); - $(".itemAudio").on("ended",function(){ - Playlist.playNext(); - }); + $(".itemAudio").on("ended", function () { + Playlist.playNext(); + }); - $(".itemAudio").on("volumechange", function () { - localStorage.setItem("volume", (this).volume); - }); + $(".itemAudio").on("volumechange", function () { + + localStorage.setItem("volume", this.volume); + }); return $('audio', nowPlayingBar)[0]; } @@ -157,14 +160,14 @@ videoCodec: 'theora', audioCodec: 'Vorbis' })); - + // HLS must be at the top for safari // Webm must be ahead of mp4 due to the issue of mp4 playing too fast in chrome - var mkvVideoUrl = ApiClient.getUrl('Videos/' + item.Id + '/stream.mkv', $.extend({}, baseParams, { - videoCodec: 'h264', - audioCodec: 'aac' - })); + var mkvVideoUrl = ApiClient.getUrl('Videos/' + item.Id + '/stream.mkv', $.extend({}, baseParams, { + videoCodec: 'h264', + audioCodec: 'aac' + })); (this).src([ { type: "application/x-mpegURL", src: hlsVideoUrl }, @@ -187,16 +190,16 @@ }); (this).addEvent("volumechange", function () { - localStorage.setItem("volume", (this).volume()); + localStorage.setItem("volume", this.volume()); }); (this).addEvent("play", updateProgress); - (this).addEvent("ended", function () { - MediaPlayer.stopVideo(); + (this).addEvent("ended", function () { + MediaPlayer.stopVideo(); - Playlist.playNext(); - }); + Playlist.playNext(); + }); ApiClient.reportPlaybackStart(Dashboard.getCurrentUserId(), item.Id); }); @@ -324,7 +327,7 @@ seriesName = item.SeriesName || item.Album || item.ProductionYear; } - html += "
"; + html += ""; if (item.Type == "Movie") html += '