1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

quality selectors set bitrates and resolution (new values from Tikuf)

This commit is contained in:
Techywarrior 2013-03-27 22:05:26 -07:00
parent 06c6765dda
commit e863a9449d
2 changed files with 15 additions and 13 deletions

View file

@ -473,9 +473,9 @@ _V_.ResolutionMenuItem = _V_.MenuItem.extend({
return; return;
var resolutions = new Array(); var resolutions = new Array();
resolutions['high'] = 1800000; resolutions['high'] = new Array(1500000, 128000, 1920, 1080);
resolutions['medium'] = 500000; resolutions['medium'] = new Array(750000, 128000, 1280, 720);
resolutions['low'] = 150000; resolutions['low'] = new Array(200000, 128000, 720, 480);
var current_time = this.player.currentTime(); 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 // Change the source and make sure we don't start the video over
var currentSrc = this.player.tag.src; 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 (this.player.duration() == "Infinity") {
if (currentSrc.indexOf("StartTimeTicks") >= 0) { if (currentSrc.indexOf("StartTimeTicks") >= 0) {

View file

@ -70,13 +70,12 @@
//display image and title //display image and title
var imageTags = item.ImageTags || {}; var imageTags = item.ImageTags || {};
var html = ''; var html = '';
var url = "";
if (item.BackdropImageTags && item.BackdropImageTags.length) { if (item.BackdropImageTags && item.BackdropImageTags.length) {
url = ApiClient.getImageUrl(item.Id, { url = ApiClient.getImageUrl(item.Id, {
type: "Backdrop", type: "Backdrop",
height: 36, height: 30,
tag: item.BackdropImageTags[0] tag: item.BackdropImageTags[0]
}); });
} }
@ -84,7 +83,7 @@
url = ApiClient.getImageUrl(item.Id, { url = ApiClient.getImageUrl(item.Id, {
type: "Thumb", type: "Thumb",
height: 36, height: 30,
tag: item.ImageTags.Thumb tag: item.ImageTags.Thumb
}); });
} }
@ -92,7 +91,7 @@
url = ApiClient.getImageUrl(item.Id, { url = ApiClient.getImageUrl(item.Id, {
type: "Primary", type: "Primary",
height: 36, height: 30,
tag: item.ImageTags.Primary tag: item.ImageTags.Primary
}); });
}else { }else {
@ -100,7 +99,7 @@
} }
var name = item.Name; var name = item.Name;
var seriesName = ''; var series_name = '';
if (item.IndexNumber != null) { if (item.IndexNumber != null) {
name = item.IndexNumber + " - " + name; name = item.IndexNumber + " - " + name;
@ -109,11 +108,11 @@
name = item.ParentIndexNumber + "." + name; name = item.ParentIndexNumber + "." + name;
} }
if (item.SeriesName || item.Album || item.ProductionYear) { if (item.SeriesName || item.Album || item.ProductionYear) {
seriesName = item.SeriesName || item.Album || item.ProductionYear; series_name = item.SeriesName || item.Album || item.ProductionYear;
} }
html += "<div><img class='nowPlayingBarImage' alt='' title='' src='" + url + "' style='height:36px;display:inline-block;' /></div>"; html += "<div><img class='clientNowPlayingImage' alt='' title='' src='" + url + "' style='height:30px;display:inline-block;' /></div>";
html += '<div>'+name+'<br/>'+seriesName+'</div>'; html += '<div>'+name+'<br/>'+series_name+'</div>';
$('#mediaInfo', nowPlayingBar).html(html); $('#mediaInfo', nowPlayingBar).html(html);
}, },
@ -172,7 +171,7 @@
var baseParams = { var baseParams = {
audioChannels: 2, audioChannels: 2,
audioBitrate: 128000, audioBitrate: 128000,
videoBitrate: 1800000, videoBitrate: 1500000,
maxWidth: screenWidth, maxWidth: screenWidth,
maxHeight: screenHeight, maxHeight: screenHeight,
StartTimeTicks: 0 StartTimeTicks: 0