mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
unify appSettings
This commit is contained in:
parent
5466e3660a
commit
87e23915c8
21 changed files with 208 additions and 408 deletions
|
@ -15,12 +15,12 @@
|
|||
},
|
||||
"devDependencies": {},
|
||||
"ignore": [],
|
||||
"version": "1.1.11",
|
||||
"_release": "1.1.11",
|
||||
"version": "1.1.12",
|
||||
"_release": "1.1.12",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.1.11",
|
||||
"commit": "6ce06fe70a6ae8cdc7c54db290fe192d4cf9656d"
|
||||
"tag": "1.1.12",
|
||||
"commit": "780eab96948c0418dd4e0e158569c4b8873708d6"
|
||||
},
|
||||
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
|
||||
"_target": "~1.1.5",
|
||||
|
|
|
@ -35,6 +35,47 @@ define(['appStorage'], function (appStorage) {
|
|||
|
||||
return parseInt(get('preferredVideoBitrate') || '') || 1500000;
|
||||
},
|
||||
maxChromecastBitrate: function (val) {
|
||||
|
||||
if (val != null) {
|
||||
set('chromecastBitrate1', val);
|
||||
}
|
||||
|
||||
val = get('chromecastBitrate1');
|
||||
|
||||
return val ? parseInt(val) : null;
|
||||
},
|
||||
syncOnlyOnWifi: function (val) {
|
||||
|
||||
if (val != null) {
|
||||
set('syncOnlyOnWifi', val.toString());
|
||||
}
|
||||
|
||||
return get('syncOnlyOnWifi') != 'false';
|
||||
},
|
||||
syncPath: function (val) {
|
||||
|
||||
if (val != null) {
|
||||
set('syncPath', val);
|
||||
}
|
||||
|
||||
return get('syncPath');
|
||||
},
|
||||
|
||||
cameraUploadServers: function (val) {
|
||||
|
||||
if (val != null) {
|
||||
set('cameraUploadServers', val.join(','));
|
||||
}
|
||||
|
||||
val = get('cameraUploadServers');
|
||||
|
||||
if (val) {
|
||||
return val.split(',');
|
||||
}
|
||||
|
||||
return [];
|
||||
},
|
||||
set: set,
|
||||
get: get
|
||||
};
|
||||
|
|
|
@ -29,14 +29,14 @@
|
|||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"ignore": [],
|
||||
"homepage": "https://github.com/polymerelements/iron-behaviors",
|
||||
"homepage": "https://github.com/PolymerElements/iron-behaviors",
|
||||
"_release": "1.0.13",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.13",
|
||||
"commit": "a7bc3428a6da2beed21987b3a8028206826a12bc"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/iron-behaviors.git",
|
||||
"_source": "git://github.com/PolymerElements/iron-behaviors.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "polymerelements/iron-behaviors"
|
||||
"_originalSource": "PolymerElements/iron-behaviors"
|
||||
}
|
|
@ -1620,18 +1620,6 @@ progress {
|
|||
max-width: 200px;
|
||||
}
|
||||
|
||||
.sessionUserInfo {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 11px;
|
||||
padding: .5em;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.sessionUserInfo img {
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.sessionNowPlayingInfo {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
|
@ -1672,7 +1660,7 @@ progress {
|
|||
color: #000;
|
||||
}
|
||||
|
||||
.activeSession:not(.playingSession) .sessionUserInfo, .activeSession:not(.playingSession) .sessionNowPlayingInfo {
|
||||
.activeSession:not(.playingSession) .sessionNowPlayingInfo {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
|
@ -1680,7 +1668,7 @@ progress {
|
|||
color: #fff;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 19px;
|
||||
bottom: 39px;
|
||||
}
|
||||
|
||||
.sessionTranscodingFramerate {
|
||||
|
@ -1693,8 +1681,8 @@ progress {
|
|||
.sessionNowPlayingStreamInfo {
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
bottom: 19px;
|
||||
}
|
||||
|
||||
.activeSession .transcodingProgress {
|
||||
|
|
|
@ -10,60 +10,6 @@
|
|||
<div data-role="content">
|
||||
<form class="displayPreferencesForm userProfileSettingsForm" style="margin: 0 auto;">
|
||||
|
||||
<div class="detailSection languageSection">
|
||||
<h1>
|
||||
${HeaderLanguage}
|
||||
</h1>
|
||||
|
||||
<div class="detailSectionContent">
|
||||
<br />
|
||||
<div>
|
||||
<label for="selectLanguage" class="selectLabel">${LabelPreferredDisplayLanguage}</label>
|
||||
<select id="selectLanguage" data-mini="true">
|
||||
<option value="ar">Arabic</option>
|
||||
<option value="bg-BG">Bulgarian (Bulgaria)</option>
|
||||
<option value="ca">Catalan</option>
|
||||
<option value="zh-CN">Chinese Simplified</option>
|
||||
<option value="zh-TW">Chinese Traditional</option>
|
||||
<option value="hr">Croatian</option>
|
||||
<option value="cs">Czech</option>
|
||||
<option value="da">Danish</option>
|
||||
<option value="nl">Dutch</option>
|
||||
<option value="en-GB">English (United Kingdom)</option>
|
||||
<option value="en-US">English (United States)</option>
|
||||
<option value="fi">Finnish</option>
|
||||
<option value="fr">French</option>
|
||||
<option value="de">German</option>
|
||||
<option value="el">Greek</option>
|
||||
<option value="he">Hebrew</option>
|
||||
<option value="hu">Hungarian</option>
|
||||
<option value="id">Indonesian</option>
|
||||
<option value="it">Italian</option>
|
||||
<option value="kk">Kazakh</option>
|
||||
<option value="nb">Norwegian Bokmål</option>
|
||||
<option value="pl">Polish</option>
|
||||
<option value="pt-BR">Portuguese (Brazil)</option>
|
||||
<option value="pt-PT">Portuguese (Portugal)</option>
|
||||
<option value="ru">Russian</option>
|
||||
<option value="sl-SI">Slovenian (Slovenia)</option>
|
||||
<option value="es-ES">Spanish</option>
|
||||
<option value="es-MX">Spanish (Mexico)</option>
|
||||
<option value="sv">Swedish</option>
|
||||
<option value="tr">Turkish</option>
|
||||
<option value="uk">Ukrainian</option>
|
||||
<option value="vi">Vietnamese</option>
|
||||
</select>
|
||||
<div class="fieldDescription">
|
||||
<div>${LabelPreferredDisplayLanguageHelp}</div>
|
||||
<div style="margin-top: .25em;">
|
||||
<a href="http://emby.media/community/index.php?/topic/5727-join-our-translation-team/" target="_blank">${LabelReadHowYouCanContribute}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detailSection">
|
||||
<h1>
|
||||
${HeaderNavigation}
|
||||
|
|
|
@ -1,130 +0,0 @@
|
|||
(function (window) {
|
||||
|
||||
function update(key, val) {
|
||||
appStorage.setItem(key, val);
|
||||
|
||||
Events.trigger(AppSettings, 'settingupdated', [key]);
|
||||
}
|
||||
|
||||
window.AppSettings = {
|
||||
|
||||
enableAutomaticBitrateDetection: function (val) {
|
||||
|
||||
if (val != null) {
|
||||
update('enableAutomaticBitrateDetection', val.toString());
|
||||
}
|
||||
|
||||
var savedVal = appStorage.getItem('enableAutomaticBitrateDetection');
|
||||
|
||||
if (!savedVal) {
|
||||
if (AppInfo.isNativeApp) {
|
||||
//return false;
|
||||
}
|
||||
}
|
||||
|
||||
return appStorage.getItem('enableAutomaticBitrateDetection') != 'false';
|
||||
},
|
||||
maxStreamingBitrate: function (val) {
|
||||
|
||||
if (val != null) {
|
||||
update('preferredVideoBitrate', val);
|
||||
}
|
||||
|
||||
return parseInt(appStorage.getItem('preferredVideoBitrate') || '') || 1500000;
|
||||
},
|
||||
maxChromecastBitrate: function (val) {
|
||||
|
||||
if (val != null) {
|
||||
update('chromecastBitrate1', val);
|
||||
}
|
||||
|
||||
val = appStorage.getItem('chromecastBitrate1');
|
||||
|
||||
return val ? parseInt(val) : null;
|
||||
},
|
||||
enableExternalPlayers: function (val) {
|
||||
|
||||
if (val != null) {
|
||||
update('externalplayers', val.toString());
|
||||
}
|
||||
|
||||
return appStorage.getItem('externalplayers') == 'true';
|
||||
},
|
||||
enableCinemaMode: function (val) {
|
||||
|
||||
if (val != null) {
|
||||
update('enableCinemaMode', val.toString());
|
||||
}
|
||||
|
||||
val = appStorage.getItem('enableCinemaMode');
|
||||
|
||||
if (val) {
|
||||
return val != 'false';
|
||||
}
|
||||
|
||||
if (browserInfo.mobile) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
enableFullScreen: function (val) {
|
||||
|
||||
if (val != null) {
|
||||
update('enableFullScreen', val.toString());
|
||||
}
|
||||
|
||||
return appStorage.getItem('enableFullScreen') == 'true';
|
||||
},
|
||||
syncOnlyOnWifi: function (val) {
|
||||
|
||||
if (val != null) {
|
||||
update('syncOnlyOnWifi', val.toString());
|
||||
}
|
||||
|
||||
return appStorage.getItem('syncOnlyOnWifi') != 'false';
|
||||
},
|
||||
syncPath: function (val) {
|
||||
|
||||
if (val != null) {
|
||||
update('syncPath', val);
|
||||
}
|
||||
|
||||
return appStorage.getItem('syncPath');
|
||||
},
|
||||
|
||||
displayLanguage: function (val) {
|
||||
|
||||
if (val != null) {
|
||||
update('displayLanguage', val);
|
||||
}
|
||||
|
||||
return appStorage.getItem('displayLanguage') || navigator.language || navigator.userLanguage || 'en-US';
|
||||
},
|
||||
|
||||
cameraUploadServers: function (val) {
|
||||
|
||||
if (val != null) {
|
||||
update('cameraUploadServers', val.join(','));
|
||||
}
|
||||
|
||||
val = appStorage.getItem('cameraUploadServers');
|
||||
|
||||
if (val) {
|
||||
return val.split(',');
|
||||
}
|
||||
|
||||
return [];
|
||||
},
|
||||
|
||||
displayPreferencesKey: function () {
|
||||
if (AppInfo.isNativeApp) {
|
||||
return 'Emby Mobile';
|
||||
}
|
||||
|
||||
return 'webclient';
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
})(window);
|
|
@ -1,4 +1,4 @@
|
|||
define([], function () {
|
||||
define(['appSettings'], function (appSettings) {
|
||||
|
||||
// Based on https://github.com/googlecast/CastVideos-chrome/blob/master/CastVideos.js
|
||||
var currentResolve;
|
||||
|
@ -350,7 +350,7 @@
|
|||
receiverName: receiverName
|
||||
});
|
||||
|
||||
var bitrateSetting = AppSettings.maxChromecastBitrate();
|
||||
var bitrateSetting = appSettings.maxChromecastBitrate();
|
||||
if (bitrateSetting) {
|
||||
message.maxBitrate = bitrateSetting;
|
||||
}
|
||||
|
|
|
@ -330,22 +330,16 @@
|
|||
|
||||
html += '</div>';
|
||||
|
||||
html += '<div class="sessionUserInfo">';
|
||||
html += '<div class="sessionNowPlayingTime">' + DashboardPage.getSessionNowPlayingTime(session) + '</div>';
|
||||
|
||||
var userImage = DashboardPage.getUserImage(session);
|
||||
if (userImage) {
|
||||
html += '<div class="sessionUserImage" data-src="' + userImage + '">';
|
||||
html += '<img src="' + userImage + '" />';
|
||||
} else {
|
||||
html += '<div class="sessionUserImage">';
|
||||
}
|
||||
html += '</div>';
|
||||
html += '<div class="sessionNowPlayingStreamInfo">' + DashboardPage.getSessionNowPlayingStreamInfo(session) + '</div>';
|
||||
|
||||
html += '<div class="sessionUserName">';
|
||||
html += DashboardPage.getUsersHtml(session);
|
||||
html += '</div>';
|
||||
//if (session.TranscodingInfo && session.TranscodingInfo.Framerate) {
|
||||
|
||||
html += '</div>';
|
||||
// html += '<div class="sessionTranscodingFramerate">' + session.TranscodingInfo.Framerate + ' fps</div>';
|
||||
//} else {
|
||||
// html += '<div class="sessionTranscodingFramerate"></div>';
|
||||
//}
|
||||
|
||||
var nowPlayingName = DashboardPage.getNowPlayingName(session);
|
||||
|
||||
|
@ -372,33 +366,33 @@
|
|||
|
||||
html += '</div>';
|
||||
|
||||
html += '<div class="cardOverlayTarget">';
|
||||
|
||||
html += '<div class="sessionNowPlayingStreamInfo">' + DashboardPage.getSessionNowPlayingStreamInfo(session) + '</div>';
|
||||
html += '<div class="sessionNowPlayingTime">' + DashboardPage.getSessionNowPlayingTime(session) + '</div>';
|
||||
|
||||
if (session.TranscodingInfo && session.TranscodingInfo.Framerate) {
|
||||
|
||||
html += '<div class="sessionTranscodingFramerate">' + session.TranscodingInfo.Framerate + ' fps</div>';
|
||||
} else {
|
||||
html += '<div class="sessionTranscodingFramerate"></div>';
|
||||
}
|
||||
html += '</div>';
|
||||
|
||||
html += '</div>';
|
||||
|
||||
// cardScalable
|
||||
html += '</div>';
|
||||
|
||||
html += '<div style="padding:1em;border-top:1px solid #eee;background:#fff;text-align:center;text-transform:uppercase;display:flex;align-items:center;justify-content:center;">';
|
||||
|
||||
var userImage = DashboardPage.getUserImage(session);
|
||||
if (userImage) {
|
||||
html += '<img style="border-radius:50px;margin-right:.5em;" src="' + userImage + '" />';
|
||||
} else {
|
||||
html += '<div style="height:24px;"></div>';
|
||||
}
|
||||
|
||||
html += '<div class="sessionUserName">';
|
||||
html += DashboardPage.getUsersHtml(session) || ' ';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
|
||||
// cardBox
|
||||
html += '</div>';
|
||||
|
||||
// card
|
||||
html += '</div>';
|
||||
|
||||
}
|
||||
|
||||
parentElement.append(html).createSessionItemMenus().trigger('create');
|
||||
parentElement.append(html);
|
||||
|
||||
$('.deadSession', parentElement).remove();
|
||||
},
|
||||
|
@ -407,7 +401,7 @@
|
|||
|
||||
var html = '';
|
||||
|
||||
html += '<div>';
|
||||
//html += '<div>';
|
||||
|
||||
if (session.TranscodingInfo && session.TranscodingInfo.IsAudioDirect && session.TranscodingInfo.IsVideoDirect) {
|
||||
html += Globalize.translate('LabelPlayMethodDirectStream');
|
||||
|
@ -416,47 +410,47 @@
|
|||
html += Globalize.translate('LabelPlayMethodTranscoding');
|
||||
}
|
||||
else if (session.PlayState.PlayMethod == 'DirectStream') {
|
||||
html += Globalize.translate('LabelPlayMethodDirectStream');
|
||||
html += Globalize.translate('LabelPlayMethodDirectPlay');
|
||||
}
|
||||
else if (session.PlayState.PlayMethod == 'DirectPlay') {
|
||||
html += Globalize.translate('LabelPlayMethodDirectPlay');
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
//html += '</div>';
|
||||
|
||||
if (session.TranscodingInfo) {
|
||||
//if (session.TranscodingInfo) {
|
||||
|
||||
html += '<br/>';
|
||||
// html += '<br/>';
|
||||
|
||||
var line = [];
|
||||
// var line = [];
|
||||
|
||||
if (session.TranscodingInfo.Container) {
|
||||
// if (session.TranscodingInfo.Container) {
|
||||
|
||||
line.push(session.TranscodingInfo.Container);
|
||||
}
|
||||
if (session.TranscodingInfo.Bitrate) {
|
||||
// line.push(session.TranscodingInfo.Container);
|
||||
// }
|
||||
// if (session.TranscodingInfo.Bitrate) {
|
||||
|
||||
if (session.TranscodingInfo.Bitrate > 1000000) {
|
||||
line.push((session.TranscodingInfo.Bitrate / 1000000).toFixed(1) + ' Mbps');
|
||||
} else {
|
||||
line.push(Math.floor(session.TranscodingInfo.Bitrate / 1000) + ' kbps');
|
||||
}
|
||||
}
|
||||
if (line.length) {
|
||||
// if (session.TranscodingInfo.Bitrate > 1000000) {
|
||||
// line.push((session.TranscodingInfo.Bitrate / 1000000).toFixed(1) + ' Mbps');
|
||||
// } else {
|
||||
// line.push(Math.floor(session.TranscodingInfo.Bitrate / 1000) + ' kbps');
|
||||
// }
|
||||
// }
|
||||
// if (line.length) {
|
||||
|
||||
html += '<div>' + line.join(' ') + '</div>';
|
||||
}
|
||||
// html += '<div>' + line.join(' ') + '</div>';
|
||||
// }
|
||||
|
||||
if (session.TranscodingInfo.VideoCodec) {
|
||||
// if (session.TranscodingInfo.VideoCodec) {
|
||||
|
||||
html += '<div>' + Globalize.translate('LabelVideoCodec').replace('{0}', session.TranscodingInfo.VideoCodec) + '</div>';
|
||||
}
|
||||
if (session.TranscodingInfo.AudioCodec && session.TranscodingInfo.AudioCodec != session.TranscodingInfo.Container) {
|
||||
// html += '<div>' + Globalize.translate('LabelVideoCodec').replace('{0}', session.TranscodingInfo.VideoCodec) + '</div>';
|
||||
// }
|
||||
// if (session.TranscodingInfo.AudioCodec && session.TranscodingInfo.AudioCodec != session.TranscodingInfo.Container) {
|
||||
|
||||
html += '<div>' + Globalize.translate('LabelAudioCodec').replace('{0}', session.TranscodingInfo.AudioCodec) + '</div>';
|
||||
}
|
||||
// html += '<div>' + Globalize.translate('LabelAudioCodec').replace('{0}', session.TranscodingInfo.AudioCodec) + '</div>';
|
||||
// }
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
return html;
|
||||
},
|
||||
|
@ -587,7 +581,7 @@
|
|||
$('.sessionNowPlayingStreamInfo', row).html(DashboardPage.getSessionNowPlayingStreamInfo(session));
|
||||
$('.sessionNowPlayingTime', row).html(DashboardPage.getSessionNowPlayingTime(session));
|
||||
|
||||
$('.sessionUserName', row).html(DashboardPage.getUsersHtml(session));
|
||||
$('.sessionUserName', row).html(DashboardPage.getUsersHtml(session) || ' ');
|
||||
|
||||
$('.sessionAppSecondaryText', row).html(DashboardPage.getAppSecondaryText(session));
|
||||
|
||||
|
@ -998,77 +992,6 @@
|
|||
|
||||
$(document).on('pageshow', "#dashboardPage", DashboardPage.onPageShow).on('pagebeforehide', "#dashboardPage", DashboardPage.onPageHide);
|
||||
|
||||
(function ($, document, window) {
|
||||
|
||||
var showOverlayTimeout;
|
||||
|
||||
function onHoverOut() {
|
||||
|
||||
if (showOverlayTimeout) {
|
||||
clearTimeout(showOverlayTimeout);
|
||||
showOverlayTimeout = null;
|
||||
}
|
||||
|
||||
var elem = this.querySelector('.cardOverlayTarget');
|
||||
|
||||
if ($(elem).is(':visible')) {
|
||||
require(["jquery", "velocity"], function ($, Velocity) {
|
||||
|
||||
Velocity.animate(elem, { "height": "0" },
|
||||
{
|
||||
complete: function () {
|
||||
$(elem).hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$.fn.createSessionItemMenus = function () {
|
||||
|
||||
function onShowTimerExpired(elem) {
|
||||
|
||||
if ($('.itemSelectionPanel:visible', elem).length) {
|
||||
return;
|
||||
}
|
||||
|
||||
var innerElem = $('.cardOverlayTarget', elem);
|
||||
|
||||
innerElem.show().each(function () {
|
||||
|
||||
this.style.height = 0;
|
||||
|
||||
}).animate({ "height": "100%" }, "fast");
|
||||
}
|
||||
|
||||
function onHoverIn() {
|
||||
|
||||
if (showOverlayTimeout) {
|
||||
clearTimeout(showOverlayTimeout);
|
||||
showOverlayTimeout = null;
|
||||
}
|
||||
|
||||
var elem = this;
|
||||
|
||||
showOverlayTimeout = setTimeout(function () {
|
||||
|
||||
onShowTimerExpired(elem);
|
||||
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
if (AppInfo.isTouchPreferred) {
|
||||
/* browser with either Touch Events of Pointer Events
|
||||
running on touch-capable device */
|
||||
return this;
|
||||
}
|
||||
|
||||
return this.off('mouseenter', '.playingSession', onHoverIn).off('mouseleave', '.playingSession', onHoverOut).on('mouseenter', '.playingSession', onHoverIn).on('mouseleave', '.playingSession', onHoverOut);
|
||||
};
|
||||
|
||||
})(jQuery, document, window);
|
||||
|
||||
|
||||
(function ($, document, window) {
|
||||
|
||||
function getEntryHtml(entry) {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
define(['paper-slider', 'paper-button'], function () {
|
||||
define(['appSettings', 'paper-slider', 'paper-button'], function (appSettings) {
|
||||
|
||||
function getDeviceProfile(serverAddress, deviceId, item, startPositionTicks, maxBitrate, mediaSourceId, audioStreamIndex, subtitleStreamIndex) {
|
||||
|
||||
var bitrateSetting = AppSettings.maxStreamingBitrate();
|
||||
var bitrateSetting = appSettings.maxStreamingBitrate();
|
||||
|
||||
var profile = {};
|
||||
|
||||
|
|
|
@ -102,16 +102,10 @@
|
|||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
if (AppInfo.isNativeApp) {
|
||||
if (Dashboard.isConnectMode()) {
|
||||
|
||||
resolve(navigator.language || navigator.userLanguage);
|
||||
|
||||
} else if (AppInfo.supportsUserDisplayLanguageSetting) {
|
||||
|
||||
console.log('AppInfo.supportsUserDisplayLanguageSetting is true');
|
||||
|
||||
resolve(AppSettings.displayLanguage());
|
||||
|
||||
} else {
|
||||
|
||||
console.log('Getting culture from document');
|
||||
|
|
|
@ -132,12 +132,20 @@
|
|||
var homePageDismissValue = '14';
|
||||
var homePageTourKey = 'homePageTour';
|
||||
|
||||
function displayPreferencesKey() {
|
||||
if (AppInfo.isNativeApp) {
|
||||
return 'Emby Mobile';
|
||||
}
|
||||
|
||||
return 'webclient';
|
||||
}
|
||||
|
||||
function dismissWelcome(page, userId) {
|
||||
|
||||
getDisplayPreferences('home', userId).then(function (result) {
|
||||
|
||||
result.CustomPrefs[homePageTourKey] = homePageDismissValue;
|
||||
ApiClient.updateDisplayPreferences('home', result, userId, AppSettings.displayPreferencesKey());
|
||||
ApiClient.updateDisplayPreferences('home', result, userId, displayPreferencesKey());
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -316,7 +324,7 @@
|
|||
|
||||
function getDisplayPreferences(key, userId) {
|
||||
|
||||
return ApiClient.getDisplayPreferences(key, userId, AppSettings.displayPreferencesKey());
|
||||
return ApiClient.getDisplayPreferences(key, userId, displayPreferencesKey());
|
||||
}
|
||||
|
||||
window.HomePage = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(['playlistManager'], function (playlistManager) {
|
||||
define(['playlistManager', 'appSettings'], function (playlistManager, appSettings) {
|
||||
|
||||
var libraryBrowser = (function (window, document, screen) {
|
||||
|
||||
|
@ -666,7 +666,7 @@
|
|||
|
||||
showPlayMenu: function (positionTo, itemId, itemType, isFolder, mediaType, resumePositionTicks) {
|
||||
|
||||
var externalPlayers = AppInfo.supportsExternalPlayers && AppSettings.enableExternalPlayers();
|
||||
var externalPlayers = AppInfo.supportsExternalPlayers && appSettings.enableExternalPlayers();
|
||||
|
||||
if (!resumePositionTicks && mediaType != "Audio" && !isFolder) {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
(function ($, document, window) {
|
||||
define(['appSettings'], function (appSettings) {
|
||||
|
||||
var showOverlayTimeout;
|
||||
|
||||
|
@ -338,7 +338,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
if (mediaType == 'Video' && AppInfo.supportsExternalPlayers && AppSettings.enableExternalPlayers()) {
|
||||
if (mediaType == 'Video' && AppInfo.supportsExternalPlayers && appSettings.enableExternalPlayers()) {
|
||||
items.push({
|
||||
name: Globalize.translate('ButtonPlayExternalPlayer'),
|
||||
id: 'externalplayer',
|
||||
|
@ -1496,4 +1496,4 @@
|
|||
Events.on(ConnectionManager, 'localusersignedin', clearRefreshTimes);
|
||||
Events.on(ConnectionManager, 'localusersignedout', clearRefreshTimes);
|
||||
|
||||
})(jQuery, document, window);
|
||||
});
|
|
@ -1,4 +1,4 @@
|
|||
(function () {
|
||||
define(['appSettings'], function (appSettings) {
|
||||
|
||||
var syncPromise;
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
|||
|
||||
LocalSync.normalizeSyncOptions(options);
|
||||
|
||||
options.cameraUploadServers = AppSettings.cameraUploadServers();
|
||||
options.cameraUploadServers = appSettings.cameraUploadServers();
|
||||
|
||||
syncPromise = new MediaBrowser.MultiServerSync(ConnectionManager).sync(options).then(function () {
|
||||
|
||||
|
@ -50,4 +50,5 @@
|
|||
return 'Idle';
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
});
|
|
@ -1,4 +1,4 @@
|
|||
(function () {
|
||||
define(['appSettings'], function (appSettings) {
|
||||
|
||||
function createVideoPlayer(self) {
|
||||
|
||||
|
@ -152,7 +152,7 @@
|
|||
})[0];
|
||||
var videoWidth = videoStream ? videoStream.Width : null;
|
||||
|
||||
var options = qualityoptions.getVideoQualityOptions(AppSettings.maxStreamingBitrate(), videoWidth);
|
||||
var options = qualityoptions.getVideoQualityOptions(appSettings.maxStreamingBitrate(), videoWidth);
|
||||
|
||||
if (isStatic) {
|
||||
options[0].name = "Direct";
|
||||
|
@ -602,8 +602,8 @@
|
|||
|
||||
self.onQualityOptionSelected = function (bitrate) {
|
||||
|
||||
AppSettings.maxStreamingBitrate(bitrate);
|
||||
AppSettings.enableAutomaticBitrateDetection(false);
|
||||
appSettings.maxStreamingBitrate(bitrate);
|
||||
appSettings.enableAutomaticBitrateDetection(false);
|
||||
|
||||
self.changeStream(self.getCurrentTicks(), {
|
||||
Bitrate: bitrate
|
||||
|
@ -1271,4 +1271,4 @@
|
|||
|
||||
createVideoPlayer(MediaPlayer);
|
||||
|
||||
})();
|
||||
});
|
|
@ -1,4 +1,4 @@
|
|||
(function (document, setTimeout, clearTimeout, screen, setInterval, window) {
|
||||
define(['appSettings'], function (appSettings) {
|
||||
|
||||
function mediaPlayer() {
|
||||
|
||||
|
@ -189,7 +189,7 @@
|
|||
|
||||
require(['browserdeviceprofile', 'qualityoptions'], function (profile, qualityoptions) {
|
||||
|
||||
var bitrateSetting = AppSettings.maxStreamingBitrate();
|
||||
var bitrateSetting = appSettings.maxStreamingBitrate();
|
||||
|
||||
if (!maxHeight) {
|
||||
maxHeight = qualityoptions.getVideoQualityOptions(bitrateSetting).filter(function (q) {
|
||||
|
@ -600,7 +600,7 @@
|
|||
Dashboard.showLoadingMsg();
|
||||
}
|
||||
|
||||
if (options.startPositionTicks || firstItem.MediaType !== 'Video' || !AppSettings.enableCinemaMode()) {
|
||||
if (options.startPositionTicks || firstItem.MediaType !== 'Video' || !appSettings.enableCinemaMode()) {
|
||||
|
||||
self.playInternal(firstItem, options.startPositionTicks, function () {
|
||||
self.setPlaylistState(0, items);
|
||||
|
@ -825,14 +825,14 @@
|
|||
|
||||
var bitrateDetectionKey = ApiClient.serverAddress();
|
||||
|
||||
if (item.MediaType == 'Video' && AppSettings.enableAutomaticBitrateDetection() && (new Date().getTime() - (self.lastBitrateDetections[bitrateDetectionKey] || 0)) > 300000) {
|
||||
if (item.MediaType == 'Video' && appSettings.enableAutomaticBitrateDetection() && (new Date().getTime() - (self.lastBitrateDetections[bitrateDetectionKey] || 0)) > 300000) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.detectBitrate().then(function (bitrate) {
|
||||
console.log('Max bitrate auto detected to ' + bitrate);
|
||||
self.lastBitrateDetections[bitrateDetectionKey] = new Date().getTime();
|
||||
AppSettings.maxStreamingBitrate(bitrate);
|
||||
appSettings.maxStreamingBitrate(bitrate);
|
||||
|
||||
onBitrateDetected();
|
||||
|
||||
|
@ -1732,5 +1732,4 @@
|
|||
window.MediaController.registerPlayer(window.MediaPlayer);
|
||||
window.MediaController.setActivePlayer(window.MediaPlayer, window.MediaPlayer.getTargetsInternal()[0]);
|
||||
|
||||
|
||||
})(document, setTimeout, clearTimeout, screen, setInterval, window);
|
||||
});
|
|
@ -9,8 +9,6 @@
|
|||
$('#selectThemeSong', page).val(appStorage.getItem('enableThemeSongs-' + user.Id) || '');
|
||||
$('#selectBackdrop', page).val(appStorage.getItem('enableBackdrops-' + user.Id) || '');
|
||||
|
||||
$('#selectLanguage', page).val(AppSettings.displayLanguage());
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
|
@ -20,8 +18,6 @@
|
|||
user.Configuration.DisplayUnairedEpisodes = page.querySelector('.chkDisplayUnairedEpisodes').checked;
|
||||
user.Configuration.GroupMoviesIntoBoxSets = page.querySelector('.chkGroupMoviesIntoCollections').checked;
|
||||
|
||||
AppSettings.displayLanguage(page.querySelector('#selectLanguage').value);
|
||||
|
||||
appStorage.setItem('enableThemeSongs-' + user.Id, $('#selectThemeSong', page).val());
|
||||
appStorage.setItem('enableBackdrops-' + user.Id, $('#selectBackdrop', page).val());
|
||||
|
||||
|
@ -98,12 +94,6 @@
|
|||
|
||||
$('.fldEnableBackdrops', page).show();
|
||||
|
||||
if (AppInfo.supportsUserDisplayLanguageSetting) {
|
||||
$('.languageSection', page).show();
|
||||
} else {
|
||||
$('.languageSection', page).hide();
|
||||
}
|
||||
|
||||
});
|
||||
pageIdOn('pagebeforehide', "displayPreferencesPage", function () {
|
||||
|
||||
|
|
|
@ -154,6 +154,13 @@
|
|||
});
|
||||
}
|
||||
|
||||
function displayPreferencesKey() {
|
||||
if (AppInfo.isNativeApp) {
|
||||
return 'Emby Mobile';
|
||||
}
|
||||
|
||||
return 'webclient';
|
||||
}
|
||||
function saveUser(page, user, displayPreferences) {
|
||||
|
||||
user.Configuration.DisplayCollectionsView = page.querySelector('.chkDisplayCollectionView').checked;
|
||||
|
@ -200,7 +207,7 @@
|
|||
displayPreferences.CustomPrefs.home2 = $('#selectHomeSection3', page).val();
|
||||
displayPreferences.CustomPrefs.home3 = $('#selectHomeSection4', page).val();
|
||||
|
||||
return ApiClient.updateDisplayPreferences('home', displayPreferences, user.Id, AppSettings.displayPreferencesKey()).then(function () {
|
||||
return ApiClient.updateDisplayPreferences('home', displayPreferences, user.Id, displayPreferencesKey()).then(function () {
|
||||
|
||||
return ApiClient.updateUserConfiguration(user.Id, user.Configuration);
|
||||
});
|
||||
|
@ -218,7 +225,7 @@
|
|||
|
||||
ApiClient.getUser(userId).then(function (user) {
|
||||
|
||||
ApiClient.getDisplayPreferences('home', user.Id, AppSettings.displayPreferencesKey()).then(function (displayPreferences) {
|
||||
ApiClient.getDisplayPreferences('home', user.Id, displayPreferencesKey()).then(function (displayPreferences) {
|
||||
|
||||
saveUser(page, user, displayPreferences).then(function () {
|
||||
|
||||
|
@ -308,7 +315,7 @@
|
|||
|
||||
ApiClient.getUser(userId).then(function (user) {
|
||||
|
||||
ApiClient.getDisplayPreferences('home', user.Id, AppSettings.displayPreferencesKey()).then(function (result) {
|
||||
ApiClient.getDisplayPreferences('home', user.Id, displayPreferencesKey()).then(function (result) {
|
||||
|
||||
loadForm(page, user, result);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
(function ($, window, document) {
|
||||
define(['appSettings'], function (appSettings) {
|
||||
|
||||
function populateLanguages(select, languages) {
|
||||
|
||||
|
@ -31,12 +31,12 @@
|
|||
$('#selectSubtitlePlaybackMode', page).val(user.Configuration.SubtitleMode || "").trigger('change');
|
||||
|
||||
page.querySelector('.chkPlayDefaultAudioTrack').checked = user.Configuration.PlayDefaultAudioTrack || false;
|
||||
page.querySelector('.chkEnableCinemaMode').checked = AppSettings.enableCinemaMode();
|
||||
page.querySelector('.chkExternalVideoPlayer').checked = AppSettings.enableExternalPlayers();
|
||||
page.querySelector('.chkEnableCinemaMode').checked = appSettings.enableCinemaMode();
|
||||
page.querySelector('.chkExternalVideoPlayer').checked = appSettings.enableExternalPlayers();
|
||||
|
||||
require(['qualityoptions'], function (qualityoptions) {
|
||||
|
||||
var bitrateOptions = qualityoptions.getVideoQualityOptions(AppSettings.maxStreamingBitrate()).map(function (i) {
|
||||
var bitrateOptions = qualityoptions.getVideoQualityOptions(appSettings.maxStreamingBitrate()).map(function (i) {
|
||||
|
||||
return '<option value="' + i.bitrate + '">' + i.name + '</option>';
|
||||
|
||||
|
@ -47,13 +47,13 @@
|
|||
$('#selectMaxBitrate', page).html(bitrateOptions);
|
||||
$('#selectMaxChromecastBitrate', page).html(bitrateOptions);
|
||||
|
||||
if (AppSettings.enableAutomaticBitrateDetection()) {
|
||||
if (appSettings.enableAutomaticBitrateDetection()) {
|
||||
$('#selectMaxBitrate', page).val('');
|
||||
} else {
|
||||
$('#selectMaxBitrate', page).val(AppSettings.maxStreamingBitrate());
|
||||
$('#selectMaxBitrate', page).val(appSettings.maxStreamingBitrate());
|
||||
}
|
||||
|
||||
$('#selectMaxChromecastBitrate', page).val(AppSettings.maxChromecastBitrate());
|
||||
$('#selectMaxChromecastBitrate', page).val(appSettings.maxChromecastBitrate());
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
|
@ -95,23 +95,23 @@
|
|||
user.Configuration.SubtitleMode = $('#selectSubtitlePlaybackMode', page).val();
|
||||
user.Configuration.PlayDefaultAudioTrack = page.querySelector('.chkPlayDefaultAudioTrack').checked;
|
||||
user.Configuration.EnableNextEpisodeAutoPlay = page.querySelector('.chkEpisodeAutoPlay').checked;
|
||||
|
||||
AppSettings.enableCinemaMode(page.querySelector('.chkEnableCinemaMode').checked);
|
||||
appSettings.enableCinemaMode(page.querySelector('.chkEnableCinemaMode').checked);
|
||||
|
||||
return ApiClient.updateUserConfiguration(user.Id, user.Configuration);
|
||||
}
|
||||
|
||||
function save(page) {
|
||||
AppSettings.enableExternalPlayers(page.querySelector('.chkExternalVideoPlayer').checked);
|
||||
|
||||
appSettings.enableExternalPlayers(page.querySelector('.chkExternalVideoPlayer').checked);
|
||||
|
||||
if ($('#selectMaxBitrate', page).val()) {
|
||||
AppSettings.maxStreamingBitrate($('#selectMaxBitrate', page).val());
|
||||
AppSettings.enableAutomaticBitrateDetection(false);
|
||||
appSettings.maxStreamingBitrate($('#selectMaxBitrate', page).val());
|
||||
appSettings.enableAutomaticBitrateDetection(false);
|
||||
} else {
|
||||
AppSettings.enableAutomaticBitrateDetection(true);
|
||||
appSettings.enableAutomaticBitrateDetection(true);
|
||||
}
|
||||
|
||||
AppSettings.maxChromecastBitrate($('#selectMaxChromecastBitrate', page).val());
|
||||
appSettings.maxChromecastBitrate($('#selectMaxChromecastBitrate', page).val());
|
||||
|
||||
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
|
||||
|
||||
|
@ -196,4 +196,4 @@
|
|||
}
|
||||
});
|
||||
|
||||
})(jQuery, window, document);
|
||||
});
|
|
@ -1,11 +1,11 @@
|
|||
(function ($, window, document) {
|
||||
define(['appSettings'], function (appSettings) {
|
||||
|
||||
function loadForm(page, user) {
|
||||
|
||||
page.querySelector('#txtSyncPath').value = AppSettings.syncPath();
|
||||
page.querySelector('#chkWifi').checked = AppSettings.syncOnlyOnWifi();
|
||||
page.querySelector('#txtSyncPath').value = appSettings.syncPath();
|
||||
page.querySelector('#chkWifi').checked = appSettings.syncOnlyOnWifi();
|
||||
|
||||
var uploadServers = AppSettings.cameraUploadServers();
|
||||
var uploadServers = appSettings.cameraUploadServers();
|
||||
|
||||
page.querySelector('.uploadServerList').innerHTML = ConnectionManager.getSavedServers().map(function (s) {
|
||||
|
||||
|
@ -21,10 +21,10 @@
|
|||
|
||||
function saveUser(page, user) {
|
||||
|
||||
AppSettings.syncPath(page.querySelector('#txtSyncPath').value);
|
||||
AppSettings.syncOnlyOnWifi(page.querySelector('#chkWifi').checked);
|
||||
appSettings.syncPath(page.querySelector('#txtSyncPath').value);
|
||||
appSettings.syncOnlyOnWifi(page.querySelector('#chkWifi').checked);
|
||||
|
||||
AppSettings.cameraUploadServers($(".chkUploadServer", page).get().filter(function (i) {
|
||||
appSettings.cameraUploadServers($(".chkUploadServer", page).get().filter(function (i) {
|
||||
|
||||
return i.checked;
|
||||
|
||||
|
@ -92,4 +92,4 @@
|
|||
}
|
||||
});
|
||||
|
||||
})(jQuery, window, document);
|
||||
});
|
|
@ -1500,7 +1500,6 @@ var AppInfo = {};
|
|||
AppInfo.enableBackButton = isIOS && (window.navigator.standalone || AppInfo.isNativeApp);
|
||||
|
||||
AppInfo.supportsSyncPathSetting = isCordova && isAndroid;
|
||||
AppInfo.supportsUserDisplayLanguageSetting = Dashboard.isConnectMode() && !isCordova;
|
||||
|
||||
if (isCordova && isIOS) {
|
||||
AppInfo.moreIcon = 'more-horiz';
|
||||
|
@ -1903,6 +1902,8 @@ var AppInfo = {};
|
|||
define("toast", [embyWebComponentsBowerPath + "/toast/toast"], returnFirstDependency);
|
||||
define("scrollHelper", [embyWebComponentsBowerPath + "/scrollhelper"], returnFirstDependency);
|
||||
|
||||
define("appSettings", [embyWebComponentsBowerPath + "/appsettings"], updateAppSettings);
|
||||
|
||||
// alias
|
||||
define("historyManager", [], function () {
|
||||
return {
|
||||
|
@ -1935,6 +1936,39 @@ var AppInfo = {};
|
|||
define('dialogText', ['globalize'], getDialogText());
|
||||
}
|
||||
|
||||
function updateAppSettings(appSettings) {
|
||||
|
||||
appSettings.enableExternalPlayers = function (val) {
|
||||
|
||||
if (val != null) {
|
||||
appSettings.set('externalplayers', val.toString());
|
||||
}
|
||||
|
||||
return appSettings.get('externalplayers') == 'true';
|
||||
};
|
||||
|
||||
appSettings.enableCinemaMode = function (val) {
|
||||
|
||||
if (val != null) {
|
||||
appSettings.set('enableCinemaMode', val.toString());
|
||||
}
|
||||
|
||||
val = appSettings.get('enableCinemaMode');
|
||||
|
||||
if (val) {
|
||||
return val != 'false';
|
||||
}
|
||||
|
||||
if (browserInfo.mobile) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
return appSettings;
|
||||
}
|
||||
|
||||
function getDialogText() {
|
||||
return function (globalize) {
|
||||
return {
|
||||
|
@ -2067,7 +2101,6 @@ var AppInfo = {};
|
|||
deps.push('connectionmanagerfactory');
|
||||
deps.push('credentialprovider');
|
||||
|
||||
deps.push('scripts/appsettings');
|
||||
deps.push('scripts/extensions');
|
||||
|
||||
require(deps, function (connectionManagerExports, credentialProviderFactory) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue