mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update startup resource loading
This commit is contained in:
parent
1b5ccc4f61
commit
8ad834b049
1 changed files with 24 additions and 34 deletions
|
@ -1654,7 +1654,7 @@ var AppInfo = {};
|
||||||
|
|
||||||
function getSyncProfile() {
|
function getSyncProfile() {
|
||||||
|
|
||||||
return getRequirePromise(['scripts/mediaplayer']).then(function() {
|
return getRequirePromise(['scripts/mediaplayer']).then(function () {
|
||||||
return MediaPlayer.getDeviceProfile(Math.max(screen.height, screen.width));
|
return MediaPlayer.getDeviceProfile(Math.max(screen.height, screen.width));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1670,7 +1670,7 @@ var AppInfo = {};
|
||||||
var credentialProvider = new credentialProviderFactory(credentialKey);
|
var credentialProvider = new credentialProviderFactory(credentialKey);
|
||||||
|
|
||||||
return getSyncProfile().then(function (deviceProfile) {
|
return getSyncProfile().then(function (deviceProfile) {
|
||||||
|
|
||||||
capabilities.DeviceProfile = deviceProfile;
|
capabilities.DeviceProfile = deviceProfile;
|
||||||
|
|
||||||
window.ConnectionManager = new MediaBrowser.ConnectionManager(credentialProvider, AppInfo.appName, AppInfo.appVersion, AppInfo.deviceName, AppInfo.deviceId, capabilities, window.devicePixelRatio);
|
window.ConnectionManager = new MediaBrowser.ConnectionManager(credentialProvider, AppInfo.appName, AppInfo.appVersion, AppInfo.deviceName, AppInfo.deviceId, capabilities, window.devicePixelRatio);
|
||||||
|
@ -2412,46 +2412,36 @@ var AppInfo = {};
|
||||||
|
|
||||||
initRequire();
|
initRequire();
|
||||||
|
|
||||||
var initialDependencies = [];
|
function onWebComponentsReady() {
|
||||||
|
|
||||||
initialDependencies.push('browser');
|
var initialDependencies = [];
|
||||||
initialDependencies.push('apiclient-store');
|
|
||||||
|
|
||||||
var supportsNativeWebComponents = 'registerElement' in document && 'content' in document.createElement('template');
|
initialDependencies.push('browser');
|
||||||
|
initialDependencies.push('apiclient-store');
|
||||||
|
|
||||||
if (!supportsNativeWebComponents) {
|
if (!window.Promise) {
|
||||||
initialDependencies.push('webcomponentsjs');
|
initialDependencies.push('native-promise-only');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!window.Promise) {
|
require(initialDependencies, function (browser) {
|
||||||
initialDependencies.push('native-promise-only');
|
|
||||||
}
|
|
||||||
|
|
||||||
require(initialDependencies, function (browser) {
|
window.browserInfo = browser;
|
||||||
|
setAppInfo();
|
||||||
|
setDocumentClasses();
|
||||||
|
|
||||||
window.browserInfo = browser;
|
getHostingAppInfo().then(function (hostingAppInfo) {
|
||||||
|
init(hostingAppInfo);
|
||||||
function onWebComponentsReady() {
|
|
||||||
|
|
||||||
var polymerDependencies = [];
|
|
||||||
|
|
||||||
require(polymerDependencies, function () {
|
|
||||||
|
|
||||||
getHostingAppInfo().then(function (hostingAppInfo) {
|
|
||||||
init(hostingAppInfo);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
|
||||||
setAppInfo();
|
if ('registerElement' in document && 'content' in document.createElement('template')) {
|
||||||
setDocumentClasses();
|
// Native web components support
|
||||||
|
onWebComponentsReady();
|
||||||
if (supportsNativeWebComponents) {
|
} else {
|
||||||
onWebComponentsReady();
|
document.addEventListener('WebComponentsReady', onWebComponentsReady);
|
||||||
} else {
|
require(['webcomponentsjs']);
|
||||||
document.addEventListener('WebComponentsReady', onWebComponentsReady);
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue