1
0
Fork 0
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:
Luke Pulverenti 2015-12-29 13:47:00 -05:00
parent 1b5ccc4f61
commit 8ad834b049

View file

@ -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); }
}
});
})(); })();