From e863a9449d419875c9e364c487fc91ea18d8fed8 Mon Sep 17 00:00:00 2001 From: Techywarrior Date: Wed, 27 Mar 2013 22:05:26 -0700 Subject: [PATCH] quality selectors set bitrates and resolution (new values from Tikuf) --- dashboard-ui/scripts/extensions.js | 11 +++++++---- dashboard-ui/scripts/mediaplayer.js | 17 ++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/dashboard-ui/scripts/extensions.js b/dashboard-ui/scripts/extensions.js index 0eed03cff4..52c056f254 100644 --- a/dashboard-ui/scripts/extensions.js +++ b/dashboard-ui/scripts/extensions.js @@ -473,9 +473,9 @@ _V_.ResolutionMenuItem = _V_.MenuItem.extend({ return; var resolutions = new Array(); - resolutions['high'] = 1800000; - resolutions['medium'] = 500000; - resolutions['low'] = 150000; + resolutions['high'] = new Array(1500000, 128000, 1920, 1080); + resolutions['medium'] = new Array(750000, 128000, 1280, 720); + resolutions['low'] = new Array(200000, 128000, 720, 480); var current_time = this.player.currentTime(); @@ -484,7 +484,10 @@ _V_.ResolutionMenuItem = _V_.MenuItem.extend({ // Change the source and make sure we don't start the video over var currentSrc = this.player.tag.src; - var newSrc = currentSrc.replace("videoBitrate="+resolutions[this.player.options.currentResolution],"videoBitrate="+resolutions[this.options.src[0].res]); + var newSrc = currentSrc.replace(new RegExp("videoBitrate=[0-9]+","g"),"videoBitrate="+resolutions[this.options.src[0].res][0]); + newSrc = newSrc.replace(new RegExp("audioBitrate=[0-9]+","g"),"audioBitrate="+resolutions[this.options.src[0].res][1]); + newSrc = newSrc.replace(new RegExp("maxWidth=[0-9]+","g"),"maxWidth="+resolutions[this.options.src[0].res][2]); + newSrc = newSrc.replace(new RegExp("maxHeight=[0-9]+","g"),"maxHeight="+resolutions[this.options.src[0].res][3]); if (this.player.duration() == "Infinity") { if (currentSrc.indexOf("StartTimeTicks") >= 0) { diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index f76ef00344..47caa8ad60 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -70,13 +70,12 @@ //display image and title var imageTags = item.ImageTags || {}; var html = ''; - var url = ""; if (item.BackdropImageTags && item.BackdropImageTags.length) { url = ApiClient.getImageUrl(item.Id, { type: "Backdrop", - height: 36, + height: 30, tag: item.BackdropImageTags[0] }); } @@ -84,7 +83,7 @@ url = ApiClient.getImageUrl(item.Id, { type: "Thumb", - height: 36, + height: 30, tag: item.ImageTags.Thumb }); } @@ -92,7 +91,7 @@ url = ApiClient.getImageUrl(item.Id, { type: "Primary", - height: 36, + height: 30, tag: item.ImageTags.Primary }); }else { @@ -100,7 +99,7 @@ } var name = item.Name; - var seriesName = ''; + var series_name = ''; if (item.IndexNumber != null) { name = item.IndexNumber + " - " + name; @@ -109,11 +108,11 @@ name = item.ParentIndexNumber + "." + name; } if (item.SeriesName || item.Album || item.ProductionYear) { - seriesName = item.SeriesName || item.Album || item.ProductionYear; + series_name = item.SeriesName || item.Album || item.ProductionYear; } - html += "
"; - html += '
'+name+'
'+seriesName+'
'; + html += "
"; + html += '
'+name+'
'+series_name+'
'; $('#mediaInfo', nowPlayingBar).html(html); }, @@ -172,7 +171,7 @@ var baseParams = { audioChannels: 2, audioBitrate: 128000, - videoBitrate: 1800000, + videoBitrate: 1500000, maxWidth: screenWidth, maxHeight: screenHeight, StartTimeTicks: 0