add bitrate setting to preferences

This commit is contained in:
Luke Pulverenti 2014-09-16 21:38:50 -04:00
parent 22dcbe1211
commit 6a1701ff3c
7 changed files with 207 additions and 97 deletions

View File

@ -88,6 +88,30 @@
</div>
<br />
<ul data-role="listview" class="ulForm">
<li>
<label for="selectMaxBitrate">${LabelMaxStreamingBitrate}</label>
<select id="selectMaxBitrate" data-mini="true">
<option value="30000000">30Mbps</option>
<option value="25000000">25Mbps</option>
<option value="20000000">20Mbps</option>
<option value="15000000">15Mbps</option>
<option value="10000000">10Mbps</option>
<option value="8000000">8Mbps</option>
<option value="6000000">6Mbps</option>
<option value="5000000">5Mbps</option>
<option value="4000000">4Mbps</option>
<option value="3500000">3.5Mbps</option>
<option value="3000000">3Mbps</option>
<option value="2500000">2.5Mbps</option>
<option value="2000000">2Mbps</option>
<option value="1500000">1.5Mbps</option>
<option value="1000000">1Mbps</option>
<option value="720000">720kbps</option>
<option value="420000">420kbps</option>
<option value="400000">400kbps</option>
<option value="320000">320kbps</option>
</select>
</li>
<li>
<label for="selectThemeSong">${LabelEnableThemeSongs}</label>
<select id="selectThemeSong" data-mini="true">
@ -111,7 +135,9 @@
<div style="margin: 0 1em;">
<fieldset data-role="controlgroup">
<legend>${LabelExternalPlayers}</legend>
<input type="checkbox" id="chkVlc" class="chkExternalPlayer" data-name="vlc" data-scheme="vlc://{0}" />
<input type="checkbox" id="chkGoodplayer" class="chkExternalPlayer" data-name="GoodPlayer" data-scheme="goodplayer://{0}" />
<label for="chkGoodplayer">GoodPlayer</label>
<input type="checkbox" id="chkVlc" class="chkExternalPlayer" data-name="Vlc" data-scheme="vlc://{0}" />
<label for="chkVlc">Vlc</label>
</fieldset>
<div style="padding: 0 2px;">${LabelExternalPlayersHelp}</div>

View File

@ -313,7 +313,7 @@
var player = this;
var bitrateSetting = MediaPlayer.getBitrateSetting();
var bitrateSetting = AppSettings.maxStreamingBitrate();
bitrateSetting = Math.min(bitrateSetting, 10000000);
var receiverName = null;

View File

@ -49,6 +49,10 @@
return false;
}
if (mediaSource.VideoType != 'VideoFile') {
return false;
}
return mediaSource.Protocol == 'File';
}
@ -159,7 +163,7 @@
return false;
}
if (m.subtitleStream) {
if (m.subtitleStream && m.subtitleStream.IsExternal) {
return false;
}
@ -200,7 +204,7 @@
var url = getStreamUrl(serverAddress, deviceId, item.MediaType, item.Id, mediaSourceInfo, startPositionTicks, maxBitrate);
if (mediaSourceInfo.subtitleStream) {
if (mediaSourceInfo.subtitleStream && mediaSourceInfo.subtitleStream.IsExternal) {
url += "&SubtitleStreamIndex=" + mediaSourceInfo.Index;
}
@ -280,7 +284,7 @@
function getVideoUrl(item) {
var maxBitrate = parseInt(store.getItem('preferredVideoBitrate') || '') || 1500000;
var maxBitrate = AppSettings.maxStreamingBitrate();
var info = getStreamInfo(ApiClient.serverAddress(), ApiClient.deviceId(), item, null, maxBitrate);
@ -304,12 +308,30 @@
html += '<div style="padding:1em;">';
if (item.RunTimeTicks) {
html += '<div>';
html += '<label for="chkMarkWatched">' + Globalize.translate('OptionMarkWatched') + '</label>';
html += '<input type="checkbox" id="chkMarkWatched" checked="checked" />';
html += '<div class="fieldDescription">' + Globalize.translate('OptionMarkWatchedHelp') + '</div>';
var autoMarkWatched = item.RunTimeTicks;
if (item.RunTimeTicks && item.RunTimeTicks >= 3000000000) {
autoMarkWatched = false;
html += '<fieldset data-role="controlgroup">';
html += '<legend>' + Globalize.translate('LabelMarkAs') + '</legend>';
html += '<label for="radioMarkUnwatched">' + Globalize.translate('OptionUnwatched') + '</label>';
html += '<input type="radio" id="radioMarkUnwatched" name="radioGroupMarkPlaystate" class="radioPlaystate" />';
html += '<label for="radioMarkWatched">' + Globalize.translate('OptionWatched') + '</label>';
html += '<input type="radio" id="radioMarkWatched" checked="checked" name="radioGroupMarkPlaystate" class="radioPlaystate" />';
html += '<label for="radioMarkInProgress">' + Globalize.translate('OptionInProgress') + '</label>';
html += '<input type="radio" id="radioMarkInProgress" name="radioGroupMarkPlaystate" class="radioPlaystate" />';
html += '</fieldset>';
html += '<br/>';
html += '<p style="margin-top: 0;">' + Globalize.translate('LabelResumePoint') + '</p>';
html += '<div class="sliderContainer" style="display:block;margin-top:4px;">';
html += '<input class="playstateSlider" type="range" step=".001" min="0" max="100" value="0" style="display:none;" data-theme="a" data-highlight="true" />';
html += '</div>';
html += '<div class="sliderValue" style="text-align:center;margin:2px 0 4px;">0:00:00</div>';
html += '<br/>';
}
@ -328,19 +350,55 @@
});
$('.radioPlaystate', elem).on('change', function () {
if ($('#radioMarkInProgress', elem).checked()) {
$('.playstateSlider', elem).slider('enable');
} else {
$('.playstateSlider', elem).slider('disable');
}
}).trigger('change');
$('.btnDone', elem).on('click', function () {
$('.externalPlayerPostPlayFlyout').popup("close").remove();
ApiClient.stopActiveEncodings();
if ($('#chkMarkWatched', elem).checked()) {
if ($('#radioMarkInProgress', elem).checked()) {
var pct = $(".playstateSlider", elem).val();
var ticks = item.RunTimeTicks * (Number(pct) * .01);
ApiClient.markPlayed(userId, item.Id, new Date());
}
else if (autoMarkWatched || $('#radioMarkWatched', elem).checked()) {
ApiClient.markPlayed(userId, item.Id, new Date());
}
else if ($('#radioMarkUnwatched', elem).checked()) {
ApiClient.markUnplayed(userId, item.Id);
}
});
$(".playstateSlider", elem).on("change", function (e) {
var pct = $(this).val();
var time = item.RunTimeTicks * (Number(pct) * .01);
var tooltext = Dashboard.getDisplayTime(time);
$('.sliderValue', elem).html(tooltext);
console.log("slidin", pct, self.currentDurationTicks, time);
});
}
function closePlayMenu() {
@ -354,7 +412,7 @@
var html = '<div data-role="popup" class="externalPlayerFlyout" data-history="false" data-theme="a">';
html += '<ul data-role="listview" style="min-width: 200px;">';
html += '<li data-role="list-divider" style="padding: 1em;">' + Globalize.translate('HeaderSelectExternalPlayer') + '</li>';
html += '<li data-role="list-divider" style="padding: 1em;text-align:center;">' + Globalize.translate('HeaderSelectExternalPlayer') + '</li>';
html += '</ul>';
html += '<div style="padding:1em;">';

View File

@ -160,13 +160,17 @@
if (item.MovieCount) {
childText = item.MovieCount == 1 ? "1 movie" : item.MovieCount + " movies";
childText = item.MovieCount == 1 ?
Globalize.translate('ValueOneMovie') :
Globalize.translate('ValueMovieCount', item.MovieCount);
counts.push(childText);
}
if (item.TrailerCount) {
childText = item.TrailerCount == 1 ? "1 trailer" : item.TrailerCount + " trailers";
childText = item.TrailerCount == 1 ?
Globalize.translate('ValueOneTrailer') :
Globalize.translate('ValueTrailerCount', item.TrailerCount);
counts.push(childText);
}
@ -175,13 +179,17 @@
if (item.SeriesCount) {
childText = item.SeriesCount == 1 ? "1 show" : item.SeriesCount + " shows";
childText = item.SeriesCount == 1 ?
Globalize.translate('ValueOneSeries') :
Globalize.translate('ValueSeriesCount', item.SeriesCount);
counts.push(childText);
}
if (item.EpisodeCount) {
childText = item.EpisodeCount == 1 ? "1 episode" : item.EpisodeCount + " episodes";
childText = item.EpisodeCount == 1 ?
Globalize.translate('ValueOneEpisode') :
Globalize.translate('ValueEpisodeCount', item.EpisodeCount);
counts.push(childText);
}
@ -190,7 +198,9 @@
if (item.GameCount) {
childText = item.GameCount == 1 ? "1 game" : item.GameCount + " games";
childText = item.GameCount == 1 ?
Globalize.translate('ValueOneGame') :
Globalize.translate('ValueGameCount', item.GameCount);
counts.push(childText);
}
@ -198,19 +208,25 @@
if (item.AlbumCount) {
childText = item.AlbumCount == 1 ? "1 album" : item.AlbumCount + " albums";
childText = item.AlbumCount == 1 ?
Globalize.translate('ValueOneAlbum') :
Globalize.translate('ValueAlbumCount', item.AlbumCount);
counts.push(childText);
}
if (item.SongCount) {
childText = item.SongCount == 1 ? "1 song" : item.SongCount + " songs";
childText = item.SongCount == 1 ?
Globalize.translate('ValueOneSong') :
Globalize.translate('ValueSongCount', item.SongCount);
counts.push(childText);
}
if (item.MusicVideoCount) {
childText = item.MusicVideoCount == 1 ? "1 music video" : item.MusicVideoCount + " music videos";
childText = item.MusicVideoCount == 1 ?
Globalize.translate('ValueOneMusicVideo') :
Globalize.translate('ValueMusicVideoCount', item.MusicVideoCount);
counts.push(childText);
}
@ -1317,41 +1333,16 @@
return html;
},
isYesterday: function (date1) {
var today = new Date();
today.setDate(today.getDate() - 1);
return date1.getFullYear() == today.getFullYear() && date1.getDate() == today.getDate();
},
isSameDay: function (date1, date2) {
return date1.getFullYear() == date2.getFullYear() && date1.getDate() == date2.getDate();
},
getFutureDateText: function (date, includeDayNamesInFuture) {
getFutureDateText: function (date) {
var weekday = [];
weekday[0] = "Sunday";
weekday[1] = "Monday";
weekday[2] = "Tuesday";
weekday[3] = "Wednesday";
weekday[4] = "Thursday";
weekday[5] = "Friday";
weekday[6] = "Saturday";
var currentDate = new Date();
if (LibraryBrowser.isSameDay(date, currentDate)) {
return "Today";
}
if (LibraryBrowser.isYesterday(date)) {
return "Yesterday";
}
weekday[0] = Globalize.translate('OptionSunday');
weekday[1] = Globalize.translate('OptionMonday');
weekday[2] = Globalize.translate('OptionTuesday');
weekday[3] = Globalize.translate('OptionWednesday');
weekday[4] = Globalize.translate('OptionThursday');
weekday[5] = Globalize.translate('OptionFriday');
weekday[6] = Globalize.translate('OptionSaturday');
var day = weekday[date.getDay()];
date = date.toLocaleDateString();
@ -1411,7 +1402,7 @@
}
if (displayAsSpecial && item.Type == "Episode" && item.ParentIndexNumber == 0) {
name = "Special - " + name;
name = Globalize.translate('ValueSpecialEpisodeName', name);
} else if (item.Type == "Episode" && item.IndexNumber != null && item.ParentIndexNumber != null) {
@ -1439,7 +1430,7 @@
getOfflineIndicatorHtml: function (item) {
if (item.LocationType == "Offline") {
return '<div class="posterRibbon offlinePosterRibbon">Offline</div>';
return '<div class="posterRibbon offlinePosterRibbon">' + Globalize.translate('HeaderOffline') + '</div>';
}
try {
@ -1447,7 +1438,7 @@
var date = parseISO8601Date(item.PremiereDate, { toLocal: true });
if (item.PremiereDate && (new Date().getTime() < date.getTime())) {
return '<div class="posterRibbon unairedPosterRibbon">Unaired</div>';
return '<div class="posterRibbon unairedPosterRibbon">' + Globalize.translate('HeaderUnaired') + '</div>';
}
} catch (err) {
@ -1456,7 +1447,7 @@
if (item.IsFolder) {
return '';
}
return '<div class="posterRibbon missingPosterRibbon">Missing</div>';
return '<div class="posterRibbon missingPosterRibbon">' + Globalize.translate('HeaderMissing') + '</div>';
},
getPlayedIndicatorHtml: function (item) {
@ -1596,9 +1587,11 @@
if (item.SeriesName && item.Type == "Season") {
html.push('<a class="detailPageParentLink" href="itemdetails.html?id=' + item.SeriesId + '">' + item.SeriesName + '</a>');
} else if (item.ParentIndexNumber != null && item.Type == "Episode") {
html.push('<a class="detailPageParentLink" href="itemdetails.html?id=' + item.SeasonId + '">Season ' + item.ParentIndexNumber + '</a>');
html.push('<a class="detailPageParentLink" href="itemdetails.html?id=' + item.SeasonId + '">' + item.SeasonName + '</a>');
} else if (item.Album && item.Type == "Audio" && (item.AlbumId || item.ParentId)) {
html.push('<a class="detailPageParentLink" href="itemdetails.html?id=' + (item.AlbumId || item.ParentId) + '">' + item.Album + '</a>');
@ -1624,7 +1617,7 @@
var links = [];
if (item.HomePageUrl) {
links.push('<a class="textlink" href="' + item.HomePageUrl + '" target="_blank">Website</a>');
links.push('<a class="textlink" href="' + item.HomePageUrl + '" target="_blank">' + Globalize.translate('ButtonWebsite') + '</a>');
}
if (item.ExternalUrls) {
@ -1639,7 +1632,9 @@
if (links.length) {
var html = 'Links:&nbsp;&nbsp;' + links.join('&nbsp;&nbsp;/&nbsp;&nbsp;');
var html = links.join('&nbsp;&nbsp;/&nbsp;&nbsp;');
html = Globalize.translate('ValueLinks', html);
$(linksElem).html(html).trigger('create');
@ -1689,9 +1684,9 @@
if (showControls) {
html += '<button data-icon="arrow-l" data-iconpos="notext" data-inline="true" data-mini="true" class="btnPreviousPage" ' + (startIndex ? '' : 'disabled') + '>Previous Page</button>';
html += '<button data-icon="arrow-l" data-iconpos="notext" data-inline="true" data-mini="true" class="btnPreviousPage" ' + (startIndex ? '' : 'disabled') + '>' + Globalize.translate('ButtonPreviousPage') + '</button>';
html += '<button data-icon="arrow-r" data-iconpos="notext" data-inline="true" data-mini="true" class="btnNextPage" ' + (startIndex + limit >= totalRecordCount ? 'disabled' : '') + '>Next Page</button>';
html += '<button data-icon="arrow-r" data-iconpos="notext" data-inline="true" data-mini="true" class="btnNextPage" ' + (startIndex + limit >= totalRecordCount ? 'disabled' : '') + '>' + Globalize.translate('ButtonNextPage') + '</button>';
}
html += (options.additionalButtonsHtml || '');
@ -1702,7 +1697,7 @@
if (options.viewButton) {
html += '<button data-icon="ellipsis-v" data-iconpos="notext" data-inline="true" data-mini="true" onclick="$(\'.viewPanel\', $(this).parents(\'.page\')).panel(\'toggle\');">View</button>';
html += '<button data-icon="ellipsis-v" data-iconpos="notext" data-inline="true" data-mini="true" onclick="$(\'.viewPanel\', $(this).parents(\'.page\')).panel(\'toggle\');">' + Globalize.translate('ButtonView') + '</button>';
}
html += '</div>';
@ -1724,7 +1719,7 @@
}).join('');
// Add styles to defeat jquery mobile
html += '<div class="pageSizeContainer"><label style="font-size:inherit;" class="labelPageSize" for="' + id + '">Limit: </label><select class="selectPageSize" id="' + id + '" data-inline="true" data-mini="true">' + optionsHtml + '</select></div>';
html += '<div class="pageSizeContainer"><label style="font-size:inherit;" class="labelPageSize" for="' + id + '">' + Globalize.translate('LabelLimit') + '</label><select class="selectPageSize" id="' + id + '" data-inline="true" data-mini="true">' + optionsHtml + '</select></div>';
}
}
@ -1762,9 +1757,9 @@
if (showControls) {
html += '<div data-role="controlgroup" data-type="horizontal" style="display:inline-block;">';
html += '<button type="button" data-icon="arrow-l" data-iconpos="notext" data-inline="true" data-mini="true" class="btnPreviousPage" ' + (query.StartIndex ? '' : 'disabled') + '>Previous Page</button>';
html += '<button type="button" data-icon="arrow-l" data-iconpos="notext" data-inline="true" data-mini="true" class="btnPreviousPage" ' + (query.StartIndex ? '' : 'disabled') + '>' + Globalize.translate('ButtonPreviousPage') + '</button>';
html += '<button type="button" data-icon="arrow-r" data-iconpos="notext" data-inline="true" data-mini="true" class="btnNextPage" ' + (query.StartIndex + query.Limit >= totalRecordCount ? 'disabled' : '') + '>Next Page</button>';
html += '<button type="button" data-icon="arrow-r" data-iconpos="notext" data-inline="true" data-mini="true" class="btnNextPage" ' + (query.StartIndex + query.Limit >= totalRecordCount ? 'disabled' : '') + '>' + Globalize.translate('ButtonNextPage') + '</button>';
html += '</div>';
if (showLimit !== false) {
@ -1790,7 +1785,7 @@
}
// Add styles to defeat jquery mobile
html += '<div class="pageSizeContainer"><label style="font-size:inherit;" class="labelPageSize" for="' + id + '">Limit: </label><select class="selectPageSize" id="' + id + '" data-inline="true" data-mini="true">' + options + '</select></div>';
html += '<div class="pageSizeContainer"><label style="font-size:inherit;" class="labelPageSize" for="' + id + '">' + Globalize.translate('LabelLimit') + '</label><select class="selectPageSize" id="' + id + '" data-inline="true" data-mini="true">' + options + '</select></div>';
}
}
@ -1814,9 +1809,9 @@
if (item.CriticRating != null) {
if (item.CriticRating >= 60) {
html += '<div class="fresh rottentomatoesicon" title="fresh"></div>';
html += '<div class="fresh rottentomatoesicon"></div>';
} else {
html += '<div class="rotten rottentomatoesicon" title="rotten"></div>';
html += '<div class="rotten rottentomatoesicon"></div>';
}
html += '<div class="criticRating">' + item.CriticRating + '%</div>';
@ -1864,31 +1859,38 @@
var itemId = item.Id;
var type = item.Type;
var tooltipPlayed = Globalize.translate('TooltipPlayed');
if ((item.MediaType || item.IsFolder) && item.Type != "TvChannel" && item.Type != "MusicArtist") {
if (userData.Played) {
html += '<img data-type="' + type + '" data-itemid="' + itemId + '" class="imgUserItemRating imgPlayed" src="css/images/userdata/checkedon.png" alt="Played" title="Played" onclick="LibraryBrowser.markPlayed(this);return false;" />';
html += '<img data-type="' + type + '" data-itemid="' + itemId + '" class="imgUserItemRating imgPlayed" src="css/images/userdata/checkedon.png" alt="' + tooltipPlayed + '" title="' + tooltipPlayed + '" onclick="LibraryBrowser.markPlayed(this);return false;" />';
} else {
html += '<img data-type="' + type + '" data-itemid="' + itemId + '" class="imgUserItemRating imgPlayedOff" src="css/images/userdata/checkedoff.png" alt="Played" title="Played" onclick="LibraryBrowser.markPlayed(this);return false;" />';
html += '<img data-type="' + type + '" data-itemid="' + itemId + '" class="imgUserItemRating imgPlayedOff" src="css/images/userdata/checkedoff.png" alt="' + tooltipPlayed + '" title="' + tooltipPlayed + '" onclick="LibraryBrowser.markPlayed(this);return false;" />';
}
}
var tooltipLike = Globalize.translate('TooltipLike');
var tooltipDislike = Globalize.translate('TooltipDislike');
if (typeof userData.Likes == "undefined") {
html += '<img onclick="LibraryBrowser.markDislike(this);return false;" data-itemid="' + itemId + '" class="imgUserItemRating imgDislikeOff" src="css/images/userdata/thumbs_down_off.png" alt="Dislike" title="Dislike" />';
html += '<img onclick="LibraryBrowser.markLike(this);return false;" data-itemid="' + itemId + '" class="imgUserItemRating imgLikeOff" src="css/images/userdata/thumbs_up_off.png" alt="Like" title="Like" />';
html += '<img onclick="LibraryBrowser.markDislike(this);return false;" data-itemid="' + itemId + '" class="imgUserItemRating imgDislikeOff" src="css/images/userdata/thumbs_down_off.png" alt="' + tooltipDislike + '" title="' + tooltipDislike + '" />';
html += '<img onclick="LibraryBrowser.markLike(this);return false;" data-itemid="' + itemId + '" class="imgUserItemRating imgLikeOff" src="css/images/userdata/thumbs_up_off.png" alt="' + tooltipLike + '" title="' + tooltipLike + '" />';
}
else if (userData.Likes) {
html += '<img onclick="LibraryBrowser.markDislike(this);return false;" data-itemid="' + itemId + '" class="imgUserItemRating imgDislikeOff" src="css/images/userdata/thumbs_down_off.png" alt="Dislike" title="Dislike" />';
html += '<img onclick="LibraryBrowser.markLike(this);return false;" data-itemid="' + itemId + '" class="imgUserItemRating imgLike" src="css/images/userdata/thumbs_up_on.png" alt="Like" title="Like" />';
html += '<img onclick="LibraryBrowser.markLike(this);return false;" data-itemid="' + itemId + '" class="imgUserItemRating imgLike" src="css/images/userdata/thumbs_up_on.png" alt="' + tooltipLike + '" title="' + tooltipLike + '" />';
}
else {
html += '<img onclick="LibraryBrowser.markDislike(this);return false;" data-itemid="' + itemId + '" class="imgUserItemRating imgDislike" src="css/images/userdata/thumbs_down_on.png" alt="Dislike" title="Dislike" />';
html += '<img onclick="LibraryBrowser.markLike(this);return false;" data-itemid="' + itemId + '" class="imgUserItemRating imgLikeOff" src="css/images/userdata/thumbs_up_off.png" alt="Like" title="Like" />';
html += '<img onclick="LibraryBrowser.markLike(this);return false;" data-itemid="' + itemId + '" class="imgUserItemRating imgLikeOff" src="css/images/userdata/thumbs_up_off.png" alt="' + tooltipLike + '" title="' + tooltipLike + '" />';
}
var tooltipFavorite = Globalize.translate('TooltipFavorite');
if (userData.IsFavorite) {
html += '<img onclick="LibraryBrowser.markFavorite(this);return false;" data-itemid="' + itemId + '" class="imgUserItemRating imgFavorite" src="css/images/userdata/heart_on.png" alt="Favorite" title="Favorite" />';
html += '<img onclick="LibraryBrowser.markFavorite(this);return false;" data-itemid="' + itemId + '" class="imgUserItemRating imgFavorite" src="css/images/userdata/heart_on.png" alt="' + tooltipFavorite + '" title="' + tooltipFavorite + '" />';
} else {
html += '<img onclick="LibraryBrowser.markFavorite(this);return false;" data-itemid="' + itemId + '" class="imgUserItemRating imgFavoriteOff" src="css/images/userdata/heart_off.png" alt="Favorite" title="Favorite" />';
html += '<img onclick="LibraryBrowser.markFavorite(this);return false;" data-itemid="' + itemId + '" class="imgUserItemRating imgFavoriteOff" src="css/images/userdata/heart_off.png" alt="' + tooltipFavorite + '" title="' + tooltipFavorite + '" />';
}
return html;
@ -2142,7 +2144,7 @@
if (item.ProductionYear && item.Type == "Series") {
if (item.Status == "Continuing") {
miscInfo.push(item.ProductionYear + "-Present");
miscInfo.push(Globalize.translate('ValueSeriesYearToPresent', item.ProductionYear));
}
else if (item.ProductionYear) {
@ -2241,8 +2243,7 @@
if (item.Studios && item.Studios.length && item.Type != "Series") {
var prefix = item.Studios.length > 1 ? "Studios" : "Studio";
var html = prefix + ':&nbsp;&nbsp;';
var html = '';
for (var i = 0, length = item.Studios.length; i < length; i++) {
@ -2253,6 +2254,10 @@
html += '<a class="textlink" href="itembynamedetails.html?context=' + context + '&id=' + item.Studios[i].Id + '">' + item.Studios[i].Name + '</a>';
}
var translationKey = item.Studios.length > 1 ? "ValueStudios" : "ValueStudio";
html = Globalize.translate(translationKey, html);
elem.show().html(html).trigger('create');
@ -2291,9 +2296,10 @@
var date = parseISO8601Date(item.PremiereDate, { toLocal: true });
var text = new Date().getTime() > date.getTime() ? "Premiered" : "Premieres";
var translationKey = new Date().getTime() > date.getTime() ? "ValuePremiered" : "ValuePremieres";
elem.show().html(Globalize.translate(translationKey, date.toLocaleDateString()));
elem.show().html(text + '&nbsp;&nbsp;' + date.toLocaleDateString());
} catch (err) {
elem.hide();
}
@ -2303,18 +2309,20 @@
},
renderBudget: function (elem, item) {
if (item.Budget) {
elem.show().html('Budget:&nbsp;&nbsp;$<span>' + item.Budget + '</span>');
elem.show().html(Globalize.translate('ValueBudget', '$' + item.Budget));
} else {
elem.hide();
}
},
renderRevenue: function (elem, item) {
if (item.Revenue) {
elem.show().html('Revenue:&nbsp;&nbsp;$<span>' + item.Revenue + '</span>');
elem.show().html(Globalize.translate('ValueRevenue', '$' + item.Revenue));
} else {
elem.hide();
}
@ -2322,7 +2330,7 @@
renderAwardSummary: function (elem, item) {
if (item.AwardSummary) {
elem.show().html('Awards:&nbsp;&nbsp;' + item.AwardSummary);
elem.show().html(Globalize.translate('ValueAwards', item.AwardSummary));
} else {
elem.hide();
}
@ -2505,7 +2513,7 @@
html += '</div>';
html += '<div class="galleryPopup" id="pop_' + index + '_' + tag + '" data-role="popup">';
html += '<a href="#" data-rel="back" data-role="button" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a>';
html += '<a href="#" data-rel="back" data-role="button" data-icon="delete" data-iconpos="notext" class="ui-btn-right">' + Globalize.translate('ButtonClose') + '</a>';
html += '<img class="" src="' + LibraryBrowser.getImageUrl(item, type, index, {
maxWidth: screenWidth,

View File

@ -427,7 +427,7 @@
var maxWidth = parseInt(this.getAttribute('data-maxwidth'));
var bitrate = parseInt(this.getAttribute('data-bitrate'));
store.setItem('preferredVideoBitrate', bitrate);
AppSettings.maxStreamingBitrate(bitrate);
self.changeStream(self.getCurrentTicks(), {
@ -849,7 +849,7 @@
return stream.Type == "Video";
})[0];
var bitrateSetting = self.getBitrateSetting();
var bitrateSetting = AppSettings.maxStreamingBitrate();
var maxAllowedWidth = Math.max(screen.height, screen.width);
@ -897,8 +897,8 @@
}
options.push({ name: '480p - 1.0Mbps', maxWidth: 720, bitrate: 1000000 });
options.push({ name: '480p - 720 kbps', maxWidth: 720, bitrate: 700000 });
options.push({ name: '480p - 420 kbps', maxWidth: 720, bitrate: 420000 });
options.push({ name: '480p - 720kbps', maxWidth: 720, bitrate: 720000 });
options.push({ name: '480p - 420kbps', maxWidth: 720, bitrate: 420000 });
options.push({ name: '360p', maxWidth: 640, bitrate: 400000 });
options.push({ name: '240p', maxWidth: 426, bitrate: 320000 });

View File

@ -455,17 +455,13 @@
});
};
self.getBitrateSetting = function () {
return parseInt(store.getItem('preferredVideoBitrate') || '') || 1500000;
};
function getOptimalMediaSource(mediaType, versions) {
var optimalVersion;
if (mediaType == 'Video') {
var bitrateSetting = self.getBitrateSetting();
var bitrateSetting = AppSettings.maxStreamingBitrate();
var maxAllowedWidth = Math.max(screen.height, screen.width);

View File

@ -4,6 +4,8 @@
var externalPlayers = JSON.parse(store.getItem('externalplayers') || '[]');
$('#selectMaxBitrate', page).val(AppSettings.maxStreamingBitrate()).selectmenu("refresh");
$('.chkExternalPlayer', page).each(function () {
var chk = this;
@ -60,6 +62,8 @@
store.setItem('externalplayers', JSON.stringify(externalPlayers));
AppSettings.maxStreamingBitrate($('#selectMaxBitrate', page).val());
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
ApiClient.getDisplayPreferences('home', userId, 'webclient').done(function (result) {
@ -102,4 +106,22 @@
onSubmit: onSubmit
};
})(jQuery, window, document);
})(jQuery, window, document);
(function (window, store) {
window.AppSettings = {
maxStreamingBitrate: function (val) {
if (val != null) {
store.setItem('preferredVideoBitrate', val);
}
return parseInt(store.getItem('preferredVideoBitrate') || '') || 1500000;
}
};
})(window, window.store);