mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
adjust startup sequences
This commit is contained in:
parent
0a225d099d
commit
e2ebee7c31
7 changed files with 193 additions and 142 deletions
|
@ -141,7 +141,7 @@ input[type="range"]::-ms-fill-upper {
|
|||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.nowPlayingBar .mediaButton:not(.playButton):not(.pauseButton):not(.remoteControlButton) {
|
||||
.nowPlayingBar .mediaButton:not(.unpauseButton):not(.pauseButton):not(.remoteControlButton) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ input[type="range"]::-ms-fill-upper {
|
|||
float: right;
|
||||
}
|
||||
|
||||
.nowPlayingBar .playButton, .nowPlayingBar .pauseButton {
|
||||
.nowPlayingBar .unpauseButton, .nowPlayingBar .pauseButton {
|
||||
float: right;
|
||||
}
|
||||
|
||||
|
|
|
@ -591,7 +591,7 @@
|
|||
|
||||
var clientLowered = connection.Client.toLowerCase();
|
||||
|
||||
if (clientLowered == "dashboard" || clientLowered == "emby web client") {
|
||||
if (clientLowered == "dashboard" || clientLowered == "emby web client" || clientLowered == "emby mobile") {
|
||||
|
||||
var device = connection.DeviceName.toLowerCase();
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
var html = '<div class="viewMenuBar ui-bar-b">';
|
||||
|
||||
if ($.browser.safari && $.browser.mobile && window.navigator.standalone) {
|
||||
if (($.browser.safari && $.browser.mobile && window.navigator.standalone) || Dashboard.isRunningInCordova()) {
|
||||
html += '<a data-rel="back" data-role="none" href="#" class="headerButton headerButtonLeft headerBackButton"><div class="fa fa-arrow-circle-o-left"></div></a>';
|
||||
}
|
||||
|
||||
|
@ -253,38 +253,47 @@
|
|||
|
||||
html += '<div class="sidebarLinks librarySidebarLinks">';
|
||||
|
||||
//var userHref = user.localUser && user.localUser.Policy.EnableUserPreferenceAccess ?
|
||||
// 'mypreferencesdisplay.html?userId=' + user.localUser.Id :
|
||||
// (user.localUser ? 'index.html' : '#');
|
||||
var showUserAtTop = $.browser.mobile;
|
||||
|
||||
//var paddingLeft = user.imageUrl ? 'padding-left:.7em;' : '';
|
||||
//html += '<a style="margin-top:0;' + paddingLeft + 'display:block;color:#fff;text-decoration:none;font-size:16px;font-weight:400!important;background: #000;" href="' + userHref + '">';
|
||||
if (showUserAtTop) {
|
||||
|
||||
//var imgWidth = 44;
|
||||
var userHref = user.localUser && user.localUser.Policy.EnableUserPreferenceAccess ?
|
||||
'mypreferencesdisplay.html?userId=' + user.localUser.Id :
|
||||
(user.localUser ? 'index.html' : '#');
|
||||
|
||||
//if (user.imageUrl) {
|
||||
// var url = user.imageUrl;
|
||||
var paddingLeft = user.imageUrl ? 'padding-left:.7em;' : '';
|
||||
html += '<a style="margin-top:0;' + paddingLeft + 'display:block;color:#fff;text-decoration:none;font-size:16px;font-weight:400!important;background: #000;" href="' + userHref + '">';
|
||||
|
||||
// if (user.supportsImageParams) {
|
||||
// url += "&width=" + (imgWidth * Math.max(devicePixelRatio || 1, 2));
|
||||
// }
|
||||
var imgWidth = 44;
|
||||
|
||||
// html += '<img style="max-width:' + imgWidth + 'px;vertical-align:middle;margin-right:.8em;border-radius: 50px;" src="' + url + '" />';
|
||||
//} else {
|
||||
// html += '<span class="fa fa-user sidebarLinkIcon"></span>';
|
||||
//}
|
||||
if (user.imageUrl) {
|
||||
var url = user.imageUrl;
|
||||
|
||||
//html += user.name;
|
||||
//html += '</a>';
|
||||
if (user.supportsImageParams) {
|
||||
url += "&width=" + (imgWidth * Math.max(devicePixelRatio || 1, 2));
|
||||
}
|
||||
|
||||
html += '<img style="max-width:' + imgWidth + 'px;vertical-align:middle;margin-right:.8em;border-radius: 50px;" src="' + url + '" />';
|
||||
} else {
|
||||
html += '<span class="fa fa-user sidebarLinkIcon"></span>';
|
||||
}
|
||||
|
||||
html += user.name;
|
||||
html += '</a>';
|
||||
}
|
||||
|
||||
var homeHref = ConnectionManager.currentApiClient() ? 'index.html' : 'selectserver.html';
|
||||
|
||||
if (showUserAtTop) {
|
||||
html += '<a class="lnkMediaFolder sidebarLink" href="' + homeHref + '"><span class="fa fa-home sidebarLinkIcon"></span><span>' + Globalize.translate('ButtonHome') + '</span></a>';
|
||||
} else {
|
||||
html += '<a class="lnkMediaFolder sidebarLink" style="margin-top:.5em;padding-left:1em;display:block;color:#fff;text-decoration:none;" href="' + homeHref + '">';
|
||||
|
||||
html += '<img style="max-width:36px;vertical-align:middle;margin-right:1em;" src="css/images/mblogoicon.png" />';
|
||||
|
||||
html += Globalize.translate('ButtonHome');
|
||||
html += '</a>';
|
||||
}
|
||||
|
||||
html += '<div class="libraryMenuDivider" style="margin-top:0;"></div>';
|
||||
|
||||
|
|
|
@ -910,6 +910,10 @@
|
|||
|
||||
self.canAutoPlayVideo = function () {
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($.browser.msie || $.browser.mobile) {
|
||||
return false;
|
||||
}
|
||||
|
@ -917,6 +921,11 @@
|
|||
return true;
|
||||
};
|
||||
|
||||
self.enableCustomVideoControls = function () {
|
||||
|
||||
return self.canAutoPlayVideo() && !$.browser.mobile;
|
||||
};
|
||||
|
||||
// Replace audio version
|
||||
self.cleanup = function (playerElement) {
|
||||
|
||||
|
@ -996,7 +1005,7 @@
|
|||
// Create video player
|
||||
var html = '';
|
||||
|
||||
var requiresNativeControls = !self.canAutoPlayVideo();
|
||||
var requiresNativeControls = !self.enableCustomVideoControls();
|
||||
|
||||
// Can't autoplay in these browsers so we need to use the full controls
|
||||
if (requiresNativeControls) {
|
||||
|
@ -1202,7 +1211,7 @@
|
|||
self.updatePlaylistUi = function () {
|
||||
var index = self.currentPlaylistIndex(null),
|
||||
length = self.playlist.length,
|
||||
requiresNativeControls = !self.canAutoPlayVideo(),
|
||||
requiresNativeControls = !self.enableCustomVideoControls(),
|
||||
controls = $(requiresNativeControls ? '.videoAdvancedControls' : '.videoControls');
|
||||
|
||||
if (length < 2) {
|
||||
|
|
|
@ -126,7 +126,7 @@
|
|||
|
||||
profile.DirectPlayProfiles = [];
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: 'mp4',
|
||||
Container: 'mp4,m4v',
|
||||
Type: 'Video',
|
||||
VideoCodec: 'h264',
|
||||
AudioCodec: 'aac,mp3'
|
||||
|
@ -134,7 +134,7 @@
|
|||
|
||||
if ($.browser.chrome) {
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: 'mkv,m4v',
|
||||
Container: 'mkv',
|
||||
Type: 'Video',
|
||||
VideoCodec: 'h264',
|
||||
AudioCodec: 'aac,mp3'
|
||||
|
@ -311,6 +311,14 @@
|
|||
});
|
||||
}
|
||||
|
||||
profile.ResponseProfiles = [];
|
||||
|
||||
profile.ResponseProfiles.push({
|
||||
Type: 'Video',
|
||||
Container: 'm4v',
|
||||
MimeType: 'video/mp4'
|
||||
});
|
||||
|
||||
return profile;
|
||||
};
|
||||
|
||||
|
@ -1589,6 +1597,10 @@
|
|||
|
||||
self.canAutoPlayAudio = function () {
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($.browser.android || ($.browser.webkit && !$.browser.chrome)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -43,8 +43,8 @@ var Dashboard = {
|
|||
},
|
||||
|
||||
isRunningInCordova: function () {
|
||||
var isCordovaApp = !!window.cordova;
|
||||
return isCordovaApp;
|
||||
|
||||
return window.appMode == 'cordova';
|
||||
},
|
||||
|
||||
onRequestFail: function (e, data) {
|
||||
|
@ -187,6 +187,10 @@ var Dashboard = {
|
|||
|
||||
isConnectMode: function () {
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var url = getWindowUrl().toLowerCase();
|
||||
|
||||
return url.indexOf('mediabrowser.tv') != -1 ||
|
||||
|
@ -472,7 +476,8 @@ var Dashboard = {
|
|||
return;
|
||||
}
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
// Cordova
|
||||
if (navigator.notification && navigator.notification.alert && options.message.indexOf('<') == -1) {
|
||||
|
||||
navigator.notification.alert(options.message, options.callback || function () { }, options.title || Globalize.translate('HeaderAlert'));
|
||||
|
||||
|
@ -483,17 +488,16 @@ var Dashboard = {
|
|||
|
||||
confirm: function (message, title, callback) {
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
|
||||
navigator.notification.alert(options.message, options.callback || function () { }, options.title || Globalize.translate('HeaderAlert'));
|
||||
// Cordova
|
||||
if (navigator.notification && navigator.notification.alert && message.indexOf('<') == -1) {
|
||||
|
||||
var buttonLabels = [Globalize.translate('ButtonOk'), Globalize.translate('ButtonCancel')];
|
||||
|
||||
navigator.notification.confirm(options.message, function (index) {
|
||||
navigator.notification.confirm(message, function (index) {
|
||||
|
||||
options.callback(index == 1);
|
||||
callback(index == 1);
|
||||
|
||||
}, options.title || Globalize.translate('HeaderAlert'), buttonLabels.join(','));
|
||||
}, title || Globalize.translate('HeaderAlert'), buttonLabels.join(','));
|
||||
|
||||
} else {
|
||||
Dashboard.confirmInternal(message, title, true, callback);
|
||||
|
@ -1311,14 +1315,34 @@ var Dashboard = {
|
|||
PlayableMediaTypes: "Audio,Video",
|
||||
|
||||
SupportedCommands: Dashboard.getSupportedRemoteCommands().join(','),
|
||||
SupportsPersistentIdentifier: false,
|
||||
SupportsPersistentIdentifier: Dashboard.isRunningInCordova(),
|
||||
SupportsMediaControl: true,
|
||||
SupportedLiveMediaTypes: ['Audio', 'Video']
|
||||
};
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
(function () {
|
||||
getDefaultImageQuality: function (imageType) {
|
||||
|
||||
var quality = 90;
|
||||
var isBackdrop = imageType.toLowerCase() == 'backdrop';
|
||||
|
||||
if (isBackdrop) {
|
||||
quality -= 10;
|
||||
}
|
||||
|
||||
if ($.browser.safari && $.browser.mobile) {
|
||||
|
||||
quality -= 10;
|
||||
|
||||
if (isBackdrop) {
|
||||
quality -= 10;
|
||||
}
|
||||
}
|
||||
|
||||
return quality;
|
||||
},
|
||||
|
||||
getAppInfo: function () {
|
||||
|
||||
function generateDeviceName() {
|
||||
|
||||
|
@ -1352,6 +1376,34 @@ var Dashboard = {
|
|||
return name;
|
||||
}
|
||||
|
||||
var appVersion = window.dashboardVersion;
|
||||
var appName = "Emby Mobile";
|
||||
var deviceName;
|
||||
var deviceId;
|
||||
|
||||
// Cordova
|
||||
if (window.device) {
|
||||
|
||||
deviceName = device.model;
|
||||
deviceId = device.uuid;
|
||||
|
||||
} else {
|
||||
|
||||
deviceName = generateDeviceName();
|
||||
deviceId = MediaBrowser.generateDeviceId();
|
||||
}
|
||||
|
||||
return {
|
||||
appName: appName,
|
||||
appVersion: appVersion,
|
||||
deviceName: deviceName,
|
||||
deviceId: deviceId
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
(function () {
|
||||
|
||||
if (!window.WebSocket) {
|
||||
|
||||
alert(Globalize.translate('MessageBrowserDoesNotSupportWebSockets'));
|
||||
|
@ -1365,29 +1417,15 @@ var Dashboard = {
|
|||
.on('serveraddresschanged.dashboard', Dashboard.onApiClientServerAddressChanged);
|
||||
}
|
||||
|
||||
var appVersion = window.dashboardVersion;
|
||||
var appName;
|
||||
var deviceName;
|
||||
var deviceId;
|
||||
function createConnectionManager() {
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
|
||||
appName = "Emby Mobile";
|
||||
deviceName = device.model;
|
||||
deviceId = device.uuid;
|
||||
|
||||
} else {
|
||||
|
||||
appName = "Emby Web Client";
|
||||
deviceName = generateDeviceName();
|
||||
deviceId = MediaBrowser.generateDeviceId();
|
||||
}
|
||||
var appInfo = Dashboard.getAppInfo();
|
||||
|
||||
var credentialProvider = new MediaBrowser.CredentialProvider();
|
||||
|
||||
var capabilities = Dashboard.capabilities();
|
||||
|
||||
window.ConnectionManager = new MediaBrowser.ConnectionManager(Logger, credentialProvider, appName, appVersion, deviceName, deviceId, capabilities);
|
||||
window.ConnectionManager = new MediaBrowser.ConnectionManager(Logger, credentialProvider, appInfo.appName, appInfo.appVersion, appInfo.deviceName, appInfo.deviceId, capabilities);
|
||||
|
||||
if (Dashboard.isConnectMode()) {
|
||||
|
||||
|
@ -1400,7 +1438,7 @@ var Dashboard = {
|
|||
|
||||
if (Dashboard.serverAddress() && Dashboard.getCurrentUserId() && Dashboard.getAccessToken()) {
|
||||
|
||||
window.ApiClient = new MediaBrowser.ApiClient(Logger, Dashboard.serverAddress(), appName, appVersion, deviceName, deviceId);
|
||||
window.ApiClient = new MediaBrowser.ApiClient(Logger, Dashboard.serverAddress(), appInfo.appName, appInfo.appVersion, appInfo.deviceName, appInfo.deviceId);
|
||||
|
||||
ApiClient.setCurrentUserId(Dashboard.getCurrentUserId(), Dashboard.getAccessToken());
|
||||
|
||||
|
@ -1416,7 +1454,7 @@ var Dashboard = {
|
|||
|
||||
} else {
|
||||
|
||||
window.ApiClient = new MediaBrowser.ApiClient(Logger, Dashboard.serverAddress(), appName, appVersion, deviceName, deviceId);
|
||||
window.ApiClient = new MediaBrowser.ApiClient(Logger, Dashboard.serverAddress(), appInfo.appName, appInfo.appVersion, appInfo.deviceName, appInfo.deviceId);
|
||||
|
||||
ApiClient.setCurrentUserId(Dashboard.getCurrentUserId(), Dashboard.getAccessToken());
|
||||
|
||||
|
@ -1428,32 +1466,10 @@ var Dashboard = {
|
|||
if (window.ApiClient) {
|
||||
Dashboard.importCss(ApiClient.getUrl('Branding/Css'));
|
||||
|
||||
ApiClient.getDefaultImageQuality = function (imageType) {
|
||||
|
||||
var quality = 90;
|
||||
var isBackdrop = imageType.toLowerCase() == 'backdrop';
|
||||
|
||||
if (isBackdrop) {
|
||||
quality -= 10;
|
||||
}
|
||||
|
||||
if ($.browser.safari && $.browser.mobile) {
|
||||
|
||||
quality -= 10;
|
||||
|
||||
if (isBackdrop) {
|
||||
quality -= 10;
|
||||
ApiClient.getDefaultImageQuality = Dashboard.getDefaultImageQuality;
|
||||
}
|
||||
}
|
||||
|
||||
return quality;
|
||||
};
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
(function () {
|
||||
|
||||
function onReady() {
|
||||
|
||||
var videoPlayerHtml = '<div id="mediaPlayer" data-theme="b" class="ui-bar-b" style="display: none;">';
|
||||
|
@ -1572,6 +1588,8 @@ var Dashboard = {
|
|||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
|
||||
createConnectionManager();
|
||||
|
||||
document.addEventListener("deviceready", function () {
|
||||
|
||||
$(onReady);
|
||||
|
@ -1579,6 +1597,9 @@ var Dashboard = {
|
|||
}, false);
|
||||
|
||||
} else {
|
||||
|
||||
createConnectionManager();
|
||||
|
||||
$(onReady);
|
||||
}
|
||||
})();
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
|
||||
$.fn.lazyChildren = function () {
|
||||
|
||||
$(".lazy", this).unveil(200);
|
||||
$(".lazy", this).unveil(300);
|
||||
return this;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue