mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge remote-tracking branch 'upstream/master' into no-limits
This commit is contained in:
commit
d9c9a05b09
101 changed files with 2998 additions and 2752 deletions
|
@ -271,6 +271,9 @@ define([], function () {
|
|||
|
||||
if (!browser.tizen) {
|
||||
browser.orsay = userAgent.toLowerCase().indexOf('smarthub') !== -1;
|
||||
} else {
|
||||
var v = (navigator.appVersion).match(/Tizen (\d+).(\d+)/);
|
||||
browser.tizenVersion = parseInt(v[1]);
|
||||
}
|
||||
|
||||
if (browser.edgeUwp) {
|
||||
|
|
|
@ -214,6 +214,15 @@ define(['browser'], function (browser) {
|
|||
break;
|
||||
case 'avi':
|
||||
supported = browser.tizen || browser.orsay || browser.web0s || browser.edgeUwp;
|
||||
// New Samsung TV don't support XviD/DivX
|
||||
// Explicitly add supported codecs to make other codecs be transcoded
|
||||
if (browser.tizenVersion >= 4) {
|
||||
videoCodecs.push('h264');
|
||||
if (canPlayH265(videoTestElement, options)) {
|
||||
videoCodecs.push('h265');
|
||||
videoCodecs.push('hevc');
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'mpg':
|
||||
case 'mpeg':
|
||||
|
@ -424,13 +433,9 @@ define(['browser'], function (browser) {
|
|||
|
||||
var supportsDts = browser.tizen || browser.orsay || browser.web0s || options.supportsDts;
|
||||
|
||||
if (self.tizen && self.tizen.systeminfo) {
|
||||
var v = tizen.systeminfo.getCapability('http://tizen.org/feature/platform.version');
|
||||
|
||||
// DTS audio not supported in 2018 models (Tizen 4.0)
|
||||
if (v && parseFloat(v) >= parseFloat('4.0')) {
|
||||
supportsDts = false;
|
||||
}
|
||||
// DTS audio not supported in 2018 models (Tizen 4.0)
|
||||
if (browser.tizenVersion >= 4) {
|
||||
supportsDts = false;
|
||||
}
|
||||
|
||||
if (supportsDts) {
|
||||
|
@ -757,6 +762,11 @@ define(['browser'], function (browser) {
|
|||
maxH264Level = 51;
|
||||
}
|
||||
|
||||
// Support H264 Level 52 (Tizen 5.0) - app only
|
||||
if (browser.tizenVersion >= 5 && window.NativeShell) {
|
||||
maxH264Level = 52;
|
||||
}
|
||||
|
||||
if (browser.tizen || browser.orsay ||
|
||||
videoTestElement.canPlayType('video/mp4; codecs="avc1.6e0033"').replace(/no/, '')) {
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
|
|||
}
|
||||
|
||||
if (user && user.localUser) {
|
||||
if (headerHomeButton) {
|
||||
if (headerHomeButton && !layoutManager.mobile) {
|
||||
headerHomeButton.classList.remove("hide");
|
||||
}
|
||||
|
||||
|
@ -243,15 +243,20 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
|
|||
html += '<a is="emby-linkbutton" class="navMenuOption lnkMediaFolder" data-itemid="selectserver" href="selectserver.html?showuser=1"><i class="material-icons navMenuOptionIcon">wifi</i><span class="navMenuOptionText">' + globalize.translate("ButtonSelectServer") + "</span></a>";
|
||||
}
|
||||
|
||||
html += '<a is="emby-linkbutton" class="navMenuOption lnkMediaFolder btnSettings" data-itemid="settings" href="#"><i class="material-icons navMenuOptionIcon settings"></i><span class="navMenuOptionText">' + globalize.translate("ButtonSettings") + "</span></a>";
|
||||
html += '<a is="emby-linkbutton" class="navMenuOption lnkMediaFolder btnLogout" data-itemid="logout" href="#"><i class="material-icons navMenuOptionIcon exit_to_app"></i><span class="navMenuOptionText">' + globalize.translate("ButtonSignOut") + "</span></a>";
|
||||
html += "</div>";
|
||||
}
|
||||
|
||||
// add buttons to navigation drawer
|
||||
navDrawerScrollContainer.innerHTML = html;
|
||||
// bind logout button click to method
|
||||
var btnLogout = navDrawerScrollContainer.querySelector(".btnLogout");
|
||||
|
||||
var btnSettings = navDrawerScrollContainer.querySelector(".btnSettings");
|
||||
if (btnSettings) {
|
||||
btnSettings.addEventListener("click", onSettingsClick);
|
||||
}
|
||||
|
||||
var btnLogout = navDrawerScrollContainer.querySelector(".btnLogout");
|
||||
if (btnLogout) {
|
||||
btnLogout.addEventListener("click", onLogoutClick);
|
||||
}
|
||||
|
@ -598,6 +603,10 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
|
|||
}
|
||||
}
|
||||
|
||||
function onSettingsClick() {
|
||||
Dashboard.navigate("mypreferencesmenu.html");
|
||||
}
|
||||
|
||||
function onLogoutClick() {
|
||||
Dashboard.logout();
|
||||
}
|
||||
|
@ -788,7 +797,7 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
|
|||
var headerCastButton;
|
||||
var headerSearchButton;
|
||||
var headerAudioPlayerButton;
|
||||
var enableLibraryNavDrawer = !layoutManager.tv;
|
||||
var enableLibraryNavDrawer = layoutManager.desktop;
|
||||
var skinHeader = document.querySelector(".skinHeader");
|
||||
var requiresUserRefresh = true;
|
||||
var lastOpenTime = new Date().getTime();
|
||||
|
@ -863,6 +872,7 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
|
|||
pageClassOn("pageshow", "page", function (e) {
|
||||
var page = this;
|
||||
var isDashboardPage = page.classList.contains("type-interior");
|
||||
var isHomePage = page.classList.contains("homePage");
|
||||
var isLibraryPage = !isDashboardPage && page.classList.contains("libraryPage");
|
||||
var apiClient = getCurrentApiClient();
|
||||
|
||||
|
@ -874,7 +884,7 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
|
|||
refreshDashboardInfoInDrawer(apiClient);
|
||||
} else {
|
||||
if (mainDrawerButton) {
|
||||
if (enableLibraryNavDrawer) {
|
||||
if (enableLibraryNavDrawer || isHomePage) {
|
||||
mainDrawerButton.classList.remove("hide");
|
||||
} else {
|
||||
mainDrawerButton.classList.add("hide");
|
||||
|
|
|
@ -20,6 +20,14 @@ define(['appStorage', 'events'], function (appStorage, events) {
|
|||
return this.get('enableAutoLogin') !== 'false';
|
||||
};
|
||||
|
||||
AppSettings.prototype.enableSystemExternalPlayers = function (val) {
|
||||
if (val !== null) {
|
||||
this.set('enableSystemExternalPlayers', val.toString());
|
||||
}
|
||||
|
||||
return this.get('enableSystemExternalPlayers') === 'true';
|
||||
};
|
||||
|
||||
AppSettings.prototype.enableAutomaticBitrateDetection = function (isInNetwork, mediaType, val) {
|
||||
var key = 'enableautobitratebitrate-' + mediaType + '-' + isInNetwork;
|
||||
if (val != null) {
|
||||
|
@ -123,13 +131,5 @@ define(['appStorage', 'events'], function (appStorage, events) {
|
|||
return appStorage.getItem(getKey(name, userId));
|
||||
};
|
||||
|
||||
AppSettings.prototype.enableSystemExternalPlayers = function (val) {
|
||||
if (val != null) {
|
||||
this.set('enableSystemExternalPlayers', val.toString());
|
||||
}
|
||||
|
||||
return this.get('enableSystemExternalPlayers') === 'true';
|
||||
};
|
||||
|
||||
return new AppSettings();
|
||||
});
|
||||
|
|
15
src/scripts/settings/webSettings.js
Normal file
15
src/scripts/settings/webSettings.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
let data;
|
||||
|
||||
function getConfig() {
|
||||
if (data) return Promise.resolve(data);
|
||||
return fetch("/config.json?nocache=" + new Date().getUTCMilliseconds()).then(function (response) {
|
||||
data = response.json();
|
||||
return data;
|
||||
});
|
||||
}
|
||||
|
||||
export function enableMultiServer() {
|
||||
return getConfig().then(config => {
|
||||
return config.multiserver;
|
||||
});
|
||||
}
|
|
@ -355,39 +355,6 @@ var AppInfo = {};
|
|||
return headroom;
|
||||
}
|
||||
|
||||
function getCastSenderApiLoader() {
|
||||
var ccLoaded = false;
|
||||
return {
|
||||
load: function () {
|
||||
if (ccLoaded) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
var fileref = document.createElement("script");
|
||||
fileref.setAttribute("type", "text/javascript");
|
||||
|
||||
fileref.onload = function () {
|
||||
ccLoaded = true;
|
||||
resolve();
|
||||
};
|
||||
|
||||
fileref.setAttribute("src", "https://www.gstatic.com/cv/js/sender/v1/cast_sender.js");
|
||||
document.querySelector("head").appendChild(fileref);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function getDummyCastSenderApiLoader() {
|
||||
return {
|
||||
load: function () {
|
||||
window.chrome = window.chrome || {};
|
||||
return Promise.resolve();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function createSharedAppFooter(appFooter) {
|
||||
return new appFooter({});
|
||||
}
|
||||
|
@ -439,28 +406,16 @@ var AppInfo = {};
|
|||
defineResizeObserver();
|
||||
define("dialog", [componentsPath + "/dialog/dialog"], returnFirstDependency);
|
||||
|
||||
if (preferNativeAlerts && window.confirm) {
|
||||
define("confirm", [componentsPath + "/confirm/nativeconfirm"], returnFirstDependency);
|
||||
} else {
|
||||
define("confirm", [componentsPath + "/confirm/confirm"], returnFirstDependency);
|
||||
}
|
||||
define("confirm", [componentsPath + "/confirm/confirm"], returnFirstDependency);
|
||||
|
||||
if ((preferNativeAlerts || browser.xboxOne) && window.confirm) {
|
||||
define("prompt", [componentsPath + "/prompt/nativeprompt"], returnFirstDependency);
|
||||
} else {
|
||||
define("prompt", [componentsPath + "/prompt/prompt"], returnFirstDependency);
|
||||
}
|
||||
define("prompt", [componentsPath + "/prompt/prompt"], returnFirstDependency);
|
||||
|
||||
define("loading", [componentsPath + "/loading/loading"], returnFirstDependency);
|
||||
define("multi-download", [componentsPath + "/multidownload"], returnFirstDependency);
|
||||
define("fileDownloader", [componentsPath + "/filedownloader"], returnFirstDependency);
|
||||
define("localassetmanager", [bowerPath + "/apiclient/localassetmanager"], returnFirstDependency);
|
||||
|
||||
if ("cordova" === self.appMode || "android" === self.appMode) {
|
||||
define("castSenderApiLoader", [], getDummyCastSenderApiLoader);
|
||||
} else {
|
||||
define("castSenderApiLoader", [], getCastSenderApiLoader);
|
||||
}
|
||||
define("castSenderApiLoader", [componentsPath + "/castSenderApi"], returnFirstDependency);
|
||||
|
||||
define("transfermanager", [bowerPath + "/apiclient/sync/transfermanager"], returnFirstDependency);
|
||||
define("filerepository", [bowerPath + "/apiclient/sync/filerepository"], returnFirstDependency);
|
||||
|
@ -735,7 +690,6 @@ var AppInfo = {};
|
|||
"swiper",
|
||||
"queryString",
|
||||
"sortable",
|
||||
"libjass",
|
||||
"webcomponents",
|
||||
"material-icons",
|
||||
"jellyfin-noto",
|
||||
|
@ -812,6 +766,7 @@ var AppInfo = {};
|
|||
define("emby-textarea", [elementsPath + "/emby-textarea/emby-textarea"], returnFirstDependency);
|
||||
define("emby-toggle", [elementsPath + "/emby-toggle/emby-toggle"], returnFirstDependency);
|
||||
|
||||
define("webSettings", [scriptsPath + "/settings/webSettings"], returnFirstDependency);
|
||||
define("appSettings", [scriptsPath + "/settings/appSettings"], returnFirstDependency);
|
||||
define("userSettingsBuilder", [scriptsPath + "/settings/userSettingsBuilder"], returnFirstDependency);
|
||||
define("userSettings", ["userSettingsBuilder"], function(userSettingsBuilder) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue