mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge branch 'dev' of https://github.com/MediaBrowser/MediaBrowser into dev
Conflicts: MediaBrowser.Server.Implementations/Localization/Server/server.json
This commit is contained in:
commit
ceab54fdbc
85 changed files with 3049 additions and 892 deletions
|
@ -99,12 +99,6 @@
|
|||
|
||||
function enabled() {
|
||||
|
||||
// Gets real messy and jumps around the page when scrolling
|
||||
// Can be reviewed later.
|
||||
if ($.browser.msie) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
var val = store.getItem('enableBackdrops-' + userId);
|
||||
|
|
|
@ -28,6 +28,154 @@
|
|||
|
||||
}
|
||||
|
||||
function handleConnectionResult(page, result) {
|
||||
|
||||
switch (result.State) {
|
||||
|
||||
case MediaBrowser.ConnectionState.SignedIn:
|
||||
{
|
||||
var apiClient = result.ApiClient;
|
||||
|
||||
Dashboard.serverAddress(apiClient.serverAddress());
|
||||
Dashboard.setCurrentUser(apiClient.getCurrentUserId(), apiClient.accessToken());
|
||||
window.location = 'index.html';
|
||||
}
|
||||
break;
|
||||
case MediaBrowser.ConnectionState.ServerSignIn:
|
||||
{
|
||||
window.location = 'login.html?serverid=' + result.Servers[0].Id;
|
||||
}
|
||||
break;
|
||||
case MediaBrowser.ConnectionState.ServerSelection:
|
||||
{
|
||||
onLoggedIn();
|
||||
}
|
||||
break;
|
||||
case MediaBrowser.ConnectionState.ConnectSignIn:
|
||||
{
|
||||
loadMode(page, 'welcome');
|
||||
}
|
||||
break;
|
||||
case MediaBrowser.ConnectionState.Unavailable:
|
||||
{
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate("MessageUnableToConnectToServer"),
|
||||
title: Globalize.translate("HeaderConnectionFailure")
|
||||
});
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function loadAppConnection(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ConnectionManager.connect().done(function (result) {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
handleConnectionResult(page, result);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function loadPage(page) {
|
||||
|
||||
var mode = getParameterByName('mode') || 'auto';
|
||||
|
||||
if (mode == 'auto') {
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
loadAppConnection(page);
|
||||
return;
|
||||
}
|
||||
mode = 'connect';
|
||||
}
|
||||
|
||||
loadMode(page, mode);
|
||||
}
|
||||
function loadMode(page, mode) {
|
||||
|
||||
$(document.body).prepend('<div class="backdropContainer" style="background-image:url(css/images/splash.jpg);top:0;"></div>');
|
||||
$(page).addClass('lightBackdropPage backdropPage staticBackdropPage');
|
||||
|
||||
if (mode == 'welcome') {
|
||||
$('.connectLoginForm', page).hide();
|
||||
$('.welcomeContainer', page).show();
|
||||
$('.manualServerForm', page).hide();
|
||||
}
|
||||
else if (mode == 'connect') {
|
||||
$('.connectLoginForm', page).show();
|
||||
$('.welcomeContainer', page).hide();
|
||||
$('.manualServerForm', page).hide();
|
||||
}
|
||||
else if (mode == 'manualserver') {
|
||||
$('.manualServerForm', page).show();
|
||||
$('.connectLoginForm', page).hide();
|
||||
$('.welcomeContainer', page).hide();
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#connectLoginPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('.btnSkipConnect', page).on('click', function() {
|
||||
|
||||
Dashboard.navigate('connectlogin.html?mode=manualserver');
|
||||
});
|
||||
|
||||
}).on('pageshow', "#connectLoginPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
loadPage(page);
|
||||
|
||||
var link = '<a href="http://emby.media" target="_blank">http://emby.media</a>';
|
||||
$('.embyIntroDownloadMessage', page).html(Globalize.translate('EmbyIntroDownloadMessage', link));
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
$('.newUsers', page).hide();
|
||||
$('.forgotPassword', page).hide();
|
||||
$('.skip', page).show();
|
||||
} else {
|
||||
$('.skip', page).hide();
|
||||
$('.newUsers', page).show();
|
||||
$('.forgotPassword', page).show();
|
||||
}
|
||||
});
|
||||
|
||||
function submitManualServer(page) {
|
||||
|
||||
var host = $('#txtServerHost', page).val();
|
||||
var port = $('#txtServerPort', page).val();
|
||||
|
||||
if (port) {
|
||||
host += ':' + port;
|
||||
}
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ConnectionManager.connectToAddress(host).done(function (result) {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
handleConnectionResult(page, result);
|
||||
|
||||
}).fail(function () {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
handleConnectionResult(page, {
|
||||
State: MediaBrowser.ConnectionState.Unavailable
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function submit(page) {
|
||||
|
||||
var user = $('#txtManualName', page).val();
|
||||
|
@ -45,6 +193,15 @@
|
|||
submit(page);
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
onManualServerSubmit: function () {
|
||||
var page = $(this).parents('.page');
|
||||
|
||||
submitManualServer(page);
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -591,7 +591,7 @@
|
|||
|
||||
var clientLowered = connection.Client.toLowerCase();
|
||||
|
||||
if (clientLowered == "dashboard") {
|
||||
if (clientLowered == "dashboard" || clientLowered == "emby web client" || clientLowered == "emby mobile") {
|
||||
|
||||
var device = connection.DeviceName.toLowerCase();
|
||||
|
||||
|
@ -613,7 +613,7 @@
|
|||
imgUrl = 'css/images/clients/html5.png';
|
||||
}
|
||||
|
||||
return "<img src='" + imgUrl + "' alt='Dashboard' />";
|
||||
return "<img src='" + imgUrl + "' alt='Emby Web Client' />";
|
||||
}
|
||||
if (clientLowered == "mb-classic") {
|
||||
|
||||
|
|
|
@ -14,50 +14,61 @@
|
|||
return deferred.promise();
|
||||
}
|
||||
|
||||
function createMediaLinks(options) {
|
||||
function getLibraryButtonsHtml(items) {
|
||||
|
||||
var html = "";
|
||||
|
||||
var items = options.items;
|
||||
|
||||
// "My Library" backgrounds
|
||||
for (var i = 0, length = items.length; i < length; i++) {
|
||||
|
||||
var item = items[i];
|
||||
|
||||
var icon;
|
||||
var backgroundColor = 'rgba(82, 181, 75, 0.7)';
|
||||
|
||||
switch (item.CollectionType) {
|
||||
case "movies":
|
||||
icon = "fa-film";
|
||||
backgroundColor = 'rgba(176, 94, 81, 0.7)';
|
||||
break;
|
||||
case "music":
|
||||
icon = "fa-music";
|
||||
backgroundColor = 'rgba(217, 145, 67, 0.7)';
|
||||
break;
|
||||
case "photos":
|
||||
icon = "fa-photo";
|
||||
backgroundColor = 'rgba(127, 0, 0, 0.7)';
|
||||
break;
|
||||
case "livetv":
|
||||
icon = "fa-video-camera";
|
||||
backgroundColor = 'rgba(255, 233, 127, 0.7)';
|
||||
break;
|
||||
case "tvshows":
|
||||
icon = "fa-video-camera";
|
||||
backgroundColor = 'rgba(77, 88, 164, 0.7)';
|
||||
break;
|
||||
case "games":
|
||||
icon = "fa-gamepad";
|
||||
backgroundColor = 'rgba(183, 202, 72, 0.7)';
|
||||
break;
|
||||
case "trailers":
|
||||
icon = "fa-film";
|
||||
backgroundColor = 'rgba(176, 94, 81, 0.7)';
|
||||
break;
|
||||
case "homevideos":
|
||||
icon = "fa-video-camera";
|
||||
backgroundColor = 'rgba(110, 52, 32, 0.7)';
|
||||
break;
|
||||
case "musicvideos":
|
||||
icon = "fa-video-camera";
|
||||
backgroundColor = 'rgba(143, 54, 168, 0.7)';
|
||||
break;
|
||||
case "books":
|
||||
icon = "fa-book";
|
||||
break;
|
||||
case "channels":
|
||||
icon = "fa-globe";
|
||||
backgroundColor = 'rgba(51, 136, 204, 0.7)';
|
||||
break;
|
||||
case "playlists":
|
||||
icon = "fa-list";
|
||||
|
@ -67,25 +78,22 @@
|
|||
break;
|
||||
}
|
||||
|
||||
var cssClass = "posterItem";
|
||||
cssClass += ' ' + options.shape + 'PosterItem';
|
||||
var cssClass = 'card smallBackdropCard buttonCard';
|
||||
|
||||
if (item.CollectionType) {
|
||||
cssClass += ' ' + item.CollectionType + 'PosterItem';
|
||||
cssClass += ' ' + item.CollectionType + 'buttonCard';
|
||||
}
|
||||
|
||||
var href = item.url || LibraryBrowser.getHref(item, options.context);
|
||||
var href = item.url || LibraryBrowser.getHref(item);
|
||||
|
||||
html += '<a data-itemid="' + item.Id + '" class="' + cssClass + '" href="' + href + '">';
|
||||
html += '<div class="cardBox" style="background-color:' + backgroundColor + ';margin:4px;border-radius:4px;">';
|
||||
|
||||
var imageCssClass = '';
|
||||
|
||||
html += '<div class="posterItemImage ' + imageCssClass + '">';
|
||||
html += '</div>';
|
||||
|
||||
html += "<div class='posterItemDefaultText posterItemText'>";
|
||||
html += "<div class='cardText' style='padding:7px 10px;color:#fff;'>";
|
||||
html += '<i class="fa ' + icon + '"></i>';
|
||||
html += '<span>' + item.Name + '</span>';
|
||||
html += '<span style="margin-left:.7em;">' + item.Name + '</span>';
|
||||
html += "</div>";
|
||||
|
||||
html += "</div>";
|
||||
|
||||
html += "</a>";
|
||||
|
@ -104,13 +112,7 @@
|
|||
html += '<h1 class="listHeader">' + Globalize.translate('HeaderMyMedia') + '</h1>';
|
||||
}
|
||||
html += '<div>';
|
||||
html += createMediaLinks({
|
||||
items: items,
|
||||
shape: 'myLibrary',
|
||||
showTitle: true,
|
||||
centerText: true
|
||||
|
||||
});
|
||||
html += getLibraryButtonsHtml(items);
|
||||
html += '</div>';
|
||||
|
||||
$(elem).html(html);
|
||||
|
@ -197,16 +199,16 @@
|
|||
|
||||
function loadLibraryTiles(elem, user, shape, index, autoHideOnMobile, showTitles) {
|
||||
|
||||
if (autoHideOnMobile) {
|
||||
$(elem).addClass('hiddenSectionOnMobile');
|
||||
} else {
|
||||
$(elem).removeClass('hiddenSectionOnMobile');
|
||||
}
|
||||
|
||||
return getUserViews(user.Id).done(function (items) {
|
||||
|
||||
var html = '';
|
||||
|
||||
if (autoHideOnMobile) {
|
||||
html += '<div class="hiddenSectionOnMobile">';
|
||||
} else {
|
||||
html += '<div>';
|
||||
}
|
||||
|
||||
if (items.length) {
|
||||
|
||||
var cssClass = index !== 0 ? 'listHeader' : 'listHeader firstListHeader';
|
||||
|
@ -232,6 +234,13 @@
|
|||
html += '</div>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
|
||||
if (autoHideOnMobile) {
|
||||
html += '<div class="hiddenSectionOnNonMobile" style="margin-top:1em;">';
|
||||
html += getLibraryButtonsHtml(items);
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
$(elem).html(html).lazyChildren().createCardMenus();
|
||||
|
||||
|
|
|
@ -1177,6 +1177,8 @@
|
|||
|
||||
var chapters = item.Chapters || [];
|
||||
|
||||
var maxWwidth = LibraryBrowser.getPosterViewInfo().thumbWidth;
|
||||
|
||||
for (var i = 0, length = chapters.length; i < length; i++) {
|
||||
|
||||
if (limit && i >= limit) {
|
||||
|
@ -1198,7 +1200,7 @@
|
|||
if (chapter.ImageTag) {
|
||||
|
||||
imgUrl = ApiClient.getScaledImageUrl(item.Id, {
|
||||
maxWidth: 210,
|
||||
maxWidth: maxWwidth,
|
||||
tag: chapter.ImageTag,
|
||||
type: "Chapter",
|
||||
index: i
|
||||
|
@ -1397,6 +1399,8 @@
|
|||
|
||||
var html = '';
|
||||
|
||||
var maxWwidth = LibraryBrowser.getPosterViewInfo().thumbWidth;
|
||||
|
||||
for (var i = 0, length = items.length; i < length; i++) {
|
||||
|
||||
if (limit && i >= limit) {
|
||||
|
@ -1423,7 +1427,7 @@
|
|||
if (imageTags.Primary) {
|
||||
|
||||
imgUrl = ApiClient.getScaledImageUrl(item.Id, {
|
||||
maxWidth: 210,
|
||||
maxWidth: maxWwidth,
|
||||
tag: imageTags.Primary,
|
||||
type: "primary"
|
||||
});
|
||||
|
|
|
@ -472,7 +472,12 @@
|
|||
}
|
||||
|
||||
if (item.CollectionType == 'channels') {
|
||||
return 'channelslatest.html';
|
||||
|
||||
if (AppInfo.enableLatestChannelItems) {
|
||||
return 'channelslatest.html';
|
||||
} else {
|
||||
return 'channels.html';
|
||||
}
|
||||
}
|
||||
|
||||
if (context != 'folders') {
|
||||
|
@ -945,6 +950,117 @@
|
|||
return itemCommands;
|
||||
},
|
||||
|
||||
screenWidth: function () {
|
||||
|
||||
var screenWidth = $(window).width();
|
||||
|
||||
return screenWidth;
|
||||
},
|
||||
|
||||
getPostersPerRow: function (screenWidth) {
|
||||
|
||||
function getValue(shape) {
|
||||
|
||||
var div = $('<div class="card ' + shape + 'Card"><div class="cardBox"><div class="cardImage"></div></div></div>').appendTo(document.body);
|
||||
var width = screenWidth / $('.cardImage', div).innerWidth();
|
||||
div.remove();
|
||||
return width;
|
||||
}
|
||||
|
||||
var info = {};
|
||||
|
||||
info.square = getValue('square');
|
||||
info.smallSquare = getValue('smallSquare');
|
||||
info.thumb = getValue('backdrop');
|
||||
info.portrait = getValue('portrait');
|
||||
info.smallPortrait = getValue('smallPortrait');
|
||||
info.banner = getValue('banner');
|
||||
info.smallThumb = getValue('smallBackdrop');
|
||||
|
||||
return info;
|
||||
},
|
||||
|
||||
posterSizes: [],
|
||||
|
||||
getPosterViewInfo: function () {
|
||||
|
||||
var screenWidth = LibraryBrowser.screenWidth();
|
||||
|
||||
var cachedResults = LibraryBrowser.posterSizes;
|
||||
|
||||
for (var i = 0, length = cachedResults.length; i < length; i++) {
|
||||
|
||||
if (cachedResults[i].screenWidth == screenWidth) {
|
||||
return cachedResults[i];
|
||||
}
|
||||
}
|
||||
|
||||
var result = LibraryBrowser.getPosterViewInfoInternal(screenWidth);
|
||||
|
||||
cachedResults.push(result);
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
getPosterViewInfoInternal: function (screenWidth) {
|
||||
|
||||
var imagesPerRow = LibraryBrowser.getPostersPerRow(screenWidth);
|
||||
|
||||
if (AppInfo.hasLowImageBandwidth) {
|
||||
screenWidth *= .95;
|
||||
} else {
|
||||
screenWidth *= 1.25;
|
||||
}
|
||||
|
||||
var thumbWidth = screenWidth / imagesPerRow.thumb;
|
||||
var smallThumbWidth = screenWidth / imagesPerRow.smallThumb;
|
||||
var posterWidth = screenWidth / imagesPerRow.portrait;
|
||||
var smallPosterWidth = screenWidth / imagesPerRow.smallPortrait;
|
||||
var squareSize = screenWidth / imagesPerRow.square;
|
||||
var smallSquareSize = screenWidth / imagesPerRow.smallSquare;
|
||||
var bannerWidth = screenWidth / imagesPerRow.banner;
|
||||
|
||||
if (!AppInfo.isTouchPreferred) {
|
||||
|
||||
var roundTo = 100;
|
||||
|
||||
thumbWidth = Math.round(thumbWidth / roundTo) * roundTo;
|
||||
smallThumbWidth = Math.round(smallThumbWidth / roundTo) * roundTo;
|
||||
posterWidth = Math.round(posterWidth / roundTo) * roundTo;
|
||||
smallPosterWidth = Math.round(smallPosterWidth / roundTo) * roundTo;
|
||||
squareSize = Math.round(squareSize / roundTo) * roundTo;
|
||||
bannerWidth = Math.round(bannerWidth / roundTo) * roundTo;
|
||||
}
|
||||
|
||||
var defaultPortait = 'portrait';
|
||||
var defaultThumb = 'backdrop';
|
||||
var defaultSquare = 'square';
|
||||
|
||||
if (AppInfo.hasLowImageBandwidth) {
|
||||
defaultThumb = 'smallBackdrop';
|
||||
defaultSquare = 'smallSquare';
|
||||
defaultPortait = 'smallPortrait';
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
defaultThumb: defaultThumb,
|
||||
smallThumbWidth: Math.round(smallThumbWidth),
|
||||
thumbWidth: Math.round(thumbWidth),
|
||||
|
||||
defaultPortait: defaultPortait,
|
||||
posterWidth: Math.round(posterWidth),
|
||||
smallPosterWidth: Math.round(smallPosterWidth),
|
||||
|
||||
defaultSquare: defaultSquare,
|
||||
squareSize: Math.round(squareSize),
|
||||
smallSquareSize: Math.round(smallSquareSize),
|
||||
|
||||
bannerWidth: Math.round(bannerWidth),
|
||||
screenWidth: screenWidth
|
||||
};
|
||||
},
|
||||
|
||||
getPosterViewHtml: function (options) {
|
||||
|
||||
var items = options.items;
|
||||
|
@ -978,6 +1094,28 @@
|
|||
}
|
||||
}
|
||||
|
||||
var posterInfo = LibraryBrowser.getPosterViewInfo();
|
||||
|
||||
var thumbWidth = posterInfo.thumbWidth;
|
||||
var posterWidth = posterInfo.posterWidth;
|
||||
var squareSize = posterInfo.squareSize;
|
||||
var bannerWidth = posterInfo.bannerWidth;
|
||||
|
||||
if (options.shape == 'backdrop' && posterInfo.defaultThumb == 'smallBackdrop') {
|
||||
options.shape = 'smallBackdrop';
|
||||
thumbWidth = posterInfo.smallThumbWidth;
|
||||
}
|
||||
|
||||
else if (options.shape == 'portrait' && posterInfo.defaultPortait == 'smallPortrait') {
|
||||
options.shape = 'smallPortrait';
|
||||
posterWidth = posterInfo.smallPosterWidth;
|
||||
}
|
||||
|
||||
else if (options.shape == 'square' && posterInfo.defaultSquare == 'smallSquare') {
|
||||
options.shape = 'smallSquare';
|
||||
squareSize = posterInfo.smallSquareSize;
|
||||
}
|
||||
|
||||
for (var i = 0, length = items.length; i < length; i++) {
|
||||
|
||||
var item = items[i];
|
||||
|
@ -1044,13 +1182,12 @@
|
|||
|
||||
var forceName = false;
|
||||
|
||||
var downloadHeight = 576;
|
||||
var enableImageEnhancers = options.enableImageEnhancers !== false;
|
||||
|
||||
if (options.autoThumb && item.ImageTags && item.ImageTags.Primary && item.PrimaryImageAspectRatio && item.PrimaryImageAspectRatio >= 1.5) {
|
||||
|
||||
height = 400;
|
||||
width = primaryImageAspectRatio ? Math.round(height * primaryImageAspectRatio) : null;
|
||||
width = posterWidth;
|
||||
height = primaryImageAspectRatio ? Math.round(posterWidth / primaryImageAspectRatio) : null;
|
||||
|
||||
imgUrl = ApiClient.getImageUrl(item.Id, {
|
||||
type: "Primary",
|
||||
|
@ -1064,7 +1201,7 @@
|
|||
|
||||
imgUrl = ApiClient.getScaledImageUrl(item.Id, {
|
||||
type: "Thumb",
|
||||
maxWidth: downloadHeight,
|
||||
maxWidth: thumbWidth,
|
||||
tag: item.ImageTags.Thumb,
|
||||
enableImageEnhancers: enableImageEnhancers
|
||||
});
|
||||
|
@ -1073,7 +1210,7 @@
|
|||
|
||||
imgUrl = ApiClient.getScaledImageUrl(item.Id, {
|
||||
type: "Backdrop",
|
||||
maxWidth: downloadHeight,
|
||||
maxWidth: thumbWidth,
|
||||
tag: item.BackdropImageTags[0],
|
||||
enableImageEnhancers: enableImageEnhancers
|
||||
});
|
||||
|
@ -1082,7 +1219,7 @@
|
|||
|
||||
imgUrl = ApiClient.getScaledImageUrl(item.Id, {
|
||||
type: "Thumb",
|
||||
maxWidth: downloadHeight,
|
||||
maxWidth: thumbWidth,
|
||||
tag: item.ImageTags.Thumb,
|
||||
enableImageEnhancers: enableImageEnhancers
|
||||
});
|
||||
|
@ -1091,7 +1228,7 @@
|
|||
|
||||
imgUrl = ApiClient.getScaledImageUrl(item.Id, {
|
||||
type: "Banner",
|
||||
maxWidth: 700,
|
||||
maxWidth: bannerWidth,
|
||||
tag: item.ImageTags.Banner,
|
||||
enableImageEnhancers: enableImageEnhancers
|
||||
});
|
||||
|
@ -1100,7 +1237,7 @@
|
|||
|
||||
imgUrl = ApiClient.getScaledImageUrl(item.SeriesId, {
|
||||
type: "Thumb",
|
||||
maxWidth: downloadHeight,
|
||||
maxWidth: thumbWidth,
|
||||
tag: item.SeriesThumbImageTag,
|
||||
enableImageEnhancers: enableImageEnhancers
|
||||
});
|
||||
|
@ -1109,7 +1246,7 @@
|
|||
|
||||
imgUrl = ApiClient.getThumbImageUrl(item.ParentThumbItemId, {
|
||||
type: "Thumb",
|
||||
maxWidth: downloadHeight,
|
||||
maxWidth: thumbWidth,
|
||||
enableImageEnhancers: enableImageEnhancers
|
||||
});
|
||||
|
||||
|
@ -1117,7 +1254,7 @@
|
|||
|
||||
imgUrl = ApiClient.getScaledImageUrl(item.Id, {
|
||||
type: "Backdrop",
|
||||
maxWidth: downloadHeight,
|
||||
maxWidth: thumbWidth,
|
||||
tag: item.BackdropImageTags[0],
|
||||
enableImageEnhancers: enableImageEnhancers
|
||||
});
|
||||
|
@ -1126,8 +1263,8 @@
|
|||
|
||||
} else if (item.ImageTags && item.ImageTags.Primary) {
|
||||
|
||||
height = 400;
|
||||
width = primaryImageAspectRatio ? Math.round(height * primaryImageAspectRatio) : null;
|
||||
width = posterWidth;
|
||||
height = primaryImageAspectRatio ? Math.round(posterWidth / primaryImageAspectRatio) : null;
|
||||
|
||||
imgUrl = ApiClient.getImageUrl(item.Id, {
|
||||
type: "Primary",
|
||||
|
@ -1140,18 +1277,16 @@
|
|||
}
|
||||
else if (item.ParentPrimaryImageTag) {
|
||||
|
||||
height = 400;
|
||||
|
||||
imgUrl = ApiClient.getImageUrl(item.ParentPrimaryImageItemId, {
|
||||
type: "Primary",
|
||||
height: height,
|
||||
width: posterWidth,
|
||||
tag: item.ParentPrimaryImageTag,
|
||||
enableImageEnhancers: enableImageEnhancers
|
||||
});
|
||||
}
|
||||
else if (item.AlbumId && item.AlbumPrimaryImageTag) {
|
||||
|
||||
height = 220;
|
||||
height = squareSize;
|
||||
width = primaryImageAspectRatio ? Math.round(height * primaryImageAspectRatio) : null;
|
||||
|
||||
imgUrl = ApiClient.getScaledImageUrl(item.AlbumId, {
|
||||
|
@ -1167,7 +1302,7 @@
|
|||
|
||||
imgUrl = ApiClient.getScaledImageUrl(item.Id, {
|
||||
type: "Thumb",
|
||||
maxWidth: downloadHeight,
|
||||
maxWidth: thumbWidth,
|
||||
tag: item.ImageTags.Thumb,
|
||||
enableImageEnhancers: enableImageEnhancers
|
||||
});
|
||||
|
@ -1177,7 +1312,7 @@
|
|||
|
||||
imgUrl = ApiClient.getScaledImageUrl(item.Id, {
|
||||
type: "Backdrop",
|
||||
maxWidth: downloadHeight,
|
||||
maxWidth: thumbWidth,
|
||||
tag: item.BackdropImageTags[0],
|
||||
enableImageEnhancers: enableImageEnhancers
|
||||
});
|
||||
|
@ -1186,7 +1321,7 @@
|
|||
|
||||
imgUrl = ApiClient.getScaledImageUrl(item.Id, {
|
||||
type: "Thumb",
|
||||
maxWidth: downloadHeight,
|
||||
maxWidth: thumbWidth,
|
||||
tag: item.ImageTags.Thumb,
|
||||
enableImageEnhancers: enableImageEnhancers
|
||||
});
|
||||
|
@ -1195,7 +1330,7 @@
|
|||
|
||||
imgUrl = ApiClient.getScaledImageUrl(item.SeriesId, {
|
||||
type: "Thumb",
|
||||
maxWidth: downloadHeight,
|
||||
maxWidth: thumbWidth,
|
||||
tag: item.SeriesThumbImageTag,
|
||||
enableImageEnhancers: enableImageEnhancers
|
||||
});
|
||||
|
@ -1204,7 +1339,7 @@
|
|||
|
||||
imgUrl = ApiClient.getThumbImageUrl(item, {
|
||||
type: "Thumb",
|
||||
maxWidth: downloadHeight,
|
||||
maxWidth: thumbWidth,
|
||||
enableImageEnhancers: enableImageEnhancers
|
||||
});
|
||||
|
||||
|
|
|
@ -887,6 +887,14 @@
|
|||
|
||||
itemsContainer.trigger('playallfromhere', [index]);
|
||||
}
|
||||
else if (action == 'setplaylistindex') {
|
||||
|
||||
index = elemWithAttributes.getAttribute('data-index');
|
||||
|
||||
closeContextMenu();
|
||||
|
||||
MediaController.currentPlaylistIndex(index);
|
||||
}
|
||||
else if (action == 'photoslideshow') {
|
||||
|
||||
if (!$(elem).hasClass('card')) {
|
||||
|
@ -904,6 +912,17 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
function resetCardImage() {
|
||||
|
||||
this.style.backgroundImage = "url('css/images/empty.png')";
|
||||
}
|
||||
|
||||
function resetImages(page) {
|
||||
|
||||
$('cardImage', page).remove();
|
||||
//$('.cardImage', page).each(resetCardImage);
|
||||
}
|
||||
|
||||
$(document).on('pageinit', ".libraryPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
@ -956,6 +975,11 @@
|
|||
hideSelections(page);
|
||||
|
||||
$('.viewTabButton:first', page).trigger('click');
|
||||
|
||||
}).on('pagebeforehide', ".libraryPage", function () {
|
||||
|
||||
var page = this;
|
||||
resetImages(page);
|
||||
});
|
||||
|
||||
function renderUserDataChanges(card, userData) {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
(function (window, document, $) {
|
||||
(function (window, document, $, devicePixelRatio) {
|
||||
|
||||
function renderHeader(user) {
|
||||
|
||||
var html = '<div class="viewMenuBar ui-bar-b">';
|
||||
|
||||
if ($.browser.safari && $.browser.mobile && window.navigator.standalone) {
|
||||
if (($.browser.safari && 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>';
|
||||
}
|
||||
|
||||
|
@ -41,25 +41,28 @@
|
|||
|
||||
}
|
||||
|
||||
html += '<a class="headerButton headerButtonRight headerUserButton" href="#" onclick="Dashboard.showUserFlyout(this);">';
|
||||
if (user.name) {
|
||||
|
||||
if (user.imageUrl) {
|
||||
html += '<a class="headerButton headerButtonRight headerUserButton" href="#" onclick="Dashboard.showUserFlyout(this);">';
|
||||
|
||||
var userButtonHeight = 26;
|
||||
if (user.imageUrl) {
|
||||
|
||||
var url = user.imageUrl;
|
||||
var userButtonHeight = 26;
|
||||
|
||||
if (user.supportsImageParams) {
|
||||
url += "&height=" + (userButtonHeight * Math.max(devicePixelRatio || 1, 2));
|
||||
var url = user.imageUrl;
|
||||
|
||||
if (user.supportsImageParams) {
|
||||
url += "&height=" + (userButtonHeight * Math.max(devicePixelRatio || 1, 2));
|
||||
}
|
||||
|
||||
html += '<img src="' + url + '" style="border-radius: 1000px; height:' + userButtonHeight + 'px;" />';
|
||||
} else {
|
||||
html += '<div class="fa fa-user"></div>';
|
||||
}
|
||||
|
||||
html += '<img src="' + url + '" style="border-radius: 1000px; height:' + userButtonHeight + 'px;" />';
|
||||
} else {
|
||||
html += '<div class="fa fa-user"></div>';
|
||||
html += '</a>';
|
||||
}
|
||||
|
||||
html += '</a>';
|
||||
|
||||
if (user.canManageServer) {
|
||||
html += '<a href="dashboard.html" class="headerButton headerButtonRight dashboardEntryHeaderButton"><div class="fa fa-cog"></div></a>';
|
||||
}
|
||||
|
@ -77,12 +80,12 @@
|
|||
|
||||
function bindMenuEvents() {
|
||||
|
||||
if ($.browser.mobile) {
|
||||
if (AppInfo.isTouchPreferred) {
|
||||
|
||||
$('.libraryMenuButton').on('mousedown', function () {
|
||||
$('.libraryMenuButton').on('click', function () {
|
||||
showLibraryMenu(false);
|
||||
});
|
||||
$('.dashboardMenuButton').on('mousedown', function () {
|
||||
$('.dashboardMenuButton').on('click', function () {
|
||||
showDashboardMenu(false);
|
||||
});
|
||||
|
||||
|
@ -90,6 +93,10 @@
|
|||
$('.libraryMenuButton').createHoverTouch().on('hovertouch', showLibraryMenu);
|
||||
$('.dashboardMenuButton').createHoverTouch().on('hovertouch', showDashboardMenu);
|
||||
}
|
||||
|
||||
// grab an element
|
||||
var viewMenuBar = document.getElementsByClassName("viewMenuBar")[0];
|
||||
initHeadRoom(viewMenuBar);
|
||||
}
|
||||
|
||||
function getItemHref(item, context) {
|
||||
|
@ -253,40 +260,52 @@
|
|||
|
||||
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 = AppInfo.isTouchPreferred;
|
||||
|
||||
//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>';
|
||||
|
||||
html += '<div class="libraryMenuDivider" style="margin-top:0;"></div>';
|
||||
}
|
||||
|
||||
var homeHref = ConnectionManager.currentApiClient() ? 'index.html' : 'selectserver.html';
|
||||
|
||||
html += '<a class="lnkMediaFolder sidebarLink" style="margin-top:.5em;padding-left:1em;display:block;color:#fff;text-decoration:none;" href="' + homeHref + '">';
|
||||
if (showUserAtTop) {
|
||||
html += '<a class="lnkMediaFolder sidebarLink" href="' + homeHref + '"><span class="fa fa-home sidebarLinkIcon"></span><span>' + Globalize.translate('ButtonHome') + '</span></a>';
|
||||
|
||||
html += '<img style="max-width:36px;vertical-align:middle;margin-right:1em;" src="css/images/mblogoicon.png" />';
|
||||
} else {
|
||||
html += '<a class="lnkMediaFolder sidebarLink" style="margin-top:.5em;padding-left:1em;display:block;color:#fff;text-decoration:none;" href="' + homeHref + '">';
|
||||
|
||||
html += Globalize.translate('ButtonHome');
|
||||
html += '</a>';
|
||||
html += '<img style="max-width:36px;vertical-align:middle;margin-right:1em;" src="css/images/mblogoicon.png" />';
|
||||
|
||||
html += '<div class="libraryMenuDivider" style="margin-top:0;"></div>';
|
||||
html += Globalize.translate('ButtonHome');
|
||||
html += '</a>';
|
||||
|
||||
html += '<div class="libraryMenuDivider"></div>';
|
||||
}
|
||||
|
||||
html += getViewsHtml();
|
||||
html += '</div>';
|
||||
|
@ -522,8 +541,26 @@
|
|||
// Scroll back up so in case vertical scroll was messed with
|
||||
$(document).scrollTop(0);
|
||||
}
|
||||
|
||||
$('.libraryViewNav', page).each(function () {
|
||||
|
||||
initHeadRoom(this);
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
function initHeadRoom(elem) {
|
||||
|
||||
if (!AppInfo.enableHeadRoom) {
|
||||
return;
|
||||
}
|
||||
|
||||
// construct an instance of Headroom, passing the element
|
||||
var headroom = new Headroom(elem);
|
||||
// initialise
|
||||
headroom.init();
|
||||
}
|
||||
|
||||
function initializeApiClient(apiClient) {
|
||||
|
||||
$(apiClient).off('websocketmessage.librarymenu', onWebSocketMessage).on('websocketmessage.librarymenu', onWebSocketMessage);
|
||||
|
@ -542,7 +579,7 @@
|
|||
|
||||
});
|
||||
|
||||
})(window, document, jQuery);
|
||||
})(window, document, jQuery, window.devicePixelRatio);
|
||||
|
||||
$.fn.createHoverTouch = function () {
|
||||
|
||||
|
|
|
@ -419,6 +419,17 @@
|
|||
});
|
||||
}
|
||||
|
||||
if (AppInfo.enableHeadRoom) {
|
||||
$('.tvGuideHeader', page).each(function () {
|
||||
|
||||
// construct an instance of Headroom, passing the element
|
||||
var headroom = new Headroom(this);
|
||||
// initialise
|
||||
headroom.init();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}).on('pageshow', "#liveTvGuidePage", function () {
|
||||
|
||||
var page = this;
|
||||
|
|
|
@ -1,34 +1,59 @@
|
|||
var LoginPage = {
|
||||
|
||||
getApiClient: function () {
|
||||
|
||||
var serverId = getParameterByName('serverid');
|
||||
var deferred = DeferredBuilder.Deferred();
|
||||
|
||||
if (serverId) {
|
||||
deferred.resolveWith(null, [ConnectionManager.getOrCreateApiClient(serverId)]);
|
||||
|
||||
} else {
|
||||
deferred.resolveWith(null, [ApiClient]);
|
||||
}
|
||||
|
||||
return deferred.promise();
|
||||
},
|
||||
|
||||
onPageShow: function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
||||
// Show all users on localhost
|
||||
var promise1 = ApiClient.getPublicUsers();
|
||||
LoginPage.getApiClient().done(function (apiClient) {
|
||||
|
||||
promise1.done(function (users) {
|
||||
// Show all users on localhost
|
||||
var promise1 = apiClient.getPublicUsers();
|
||||
|
||||
var showManualForm = !users.length;
|
||||
promise1.done(function (users) {
|
||||
|
||||
if (showManualForm) {
|
||||
var showManualForm = !users.length;
|
||||
|
||||
LoginPage.showManualForm(page, false, false);
|
||||
if (showManualForm) {
|
||||
|
||||
} else {
|
||||
LoginPage.showVisualForm(page);
|
||||
LoginPage.loadUserList(users);
|
||||
}
|
||||
LoginPage.showManualForm(page, false, false);
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
} else {
|
||||
|
||||
LoginPage.showVisualForm(page);
|
||||
LoginPage.loadUserList(page, apiClient, users);
|
||||
}
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
|
||||
apiClient.getJSON(apiClient.getUrl('Branding/Configuration')).done(function (options) {
|
||||
|
||||
$('.disclaimer', page).html(options.LoginDisclaimer || '');
|
||||
});
|
||||
});
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Branding/Configuration')).done(function (options) {
|
||||
|
||||
$('.disclaimer', page).html(options.LoginDisclaimer || '');
|
||||
});
|
||||
if (Dashboard.isConnectMode()) {
|
||||
$('.connectButtons', page).show();
|
||||
} else {
|
||||
$('.connectButtons', page).hide();
|
||||
}
|
||||
},
|
||||
|
||||
cancelLogin: function () {
|
||||
|
@ -67,30 +92,24 @@
|
|||
return "Last seen " + humane_date(lastActivityDate);
|
||||
},
|
||||
|
||||
getImagePath: function (user) {
|
||||
|
||||
if (!user.PrimaryImageTag) {
|
||||
return "css/images/logindefault.png";
|
||||
}
|
||||
|
||||
return ApiClient.getUserImageUrl(user.Id, {
|
||||
width: 240,
|
||||
tag: user.PrimaryImageTag,
|
||||
type: "Primary"
|
||||
});
|
||||
},
|
||||
|
||||
authenticateUserByName: function (username, password) {
|
||||
authenticateUserByName: function (apiClient, username, password) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.authenticateUserByName(username, password).done(function (result) {
|
||||
apiClient.authenticateUserByName(username, password).done(function (result) {
|
||||
|
||||
var user = result.User;
|
||||
|
||||
var serverId = getParameterByName('serverid');
|
||||
|
||||
// In a multi-server supported app, set the server address
|
||||
if (serverId) {
|
||||
Dashboard.serverAddress(apiClient.serverAddress());
|
||||
}
|
||||
|
||||
Dashboard.setCurrentUser(user.Id, result.AccessToken);
|
||||
|
||||
if (user.Policy.IsAdministrator) {
|
||||
if (user.Policy.IsAdministrator && !serverId) {
|
||||
window.location = "dashboard.html?u=" + user.Id + '&t=' + result.AccessToken;
|
||||
} else {
|
||||
window.location = "index.html?u=" + user.Id + '&t=' + result.AccessToken;
|
||||
|
@ -111,11 +130,9 @@
|
|||
|
||||
},
|
||||
|
||||
loadUserList: function (users) {
|
||||
loadUserList: function (page, apiClient, users) {
|
||||
var html = "";
|
||||
|
||||
var page = $.mobile.activePage;
|
||||
|
||||
for (var i = 0, length = users.length; i < length; i++) {
|
||||
var user = users[i];
|
||||
|
||||
|
@ -130,7 +147,7 @@
|
|||
|
||||
if (user.PrimaryImageTag) {
|
||||
|
||||
imgUrl = ApiClient.getUserImageUrl(user.Id, {
|
||||
imgUrl = apiClient.getUserImageUrl(user.Id, {
|
||||
width: 300,
|
||||
tag: user.PrimaryImageTag,
|
||||
type: "Primary"
|
||||
|
@ -172,11 +189,15 @@
|
|||
|
||||
$('a', elem).on('click', function () {
|
||||
|
||||
var id = this.getAttribute('data-userid');
|
||||
var name = this.getAttribute('data-username');
|
||||
var haspw = this.getAttribute('data-haspw');
|
||||
|
||||
if (haspw == 'false') {
|
||||
LoginPage.authenticateUserByName(name, '');
|
||||
if (id == 'manual') {
|
||||
LoginPage.showManualForm(page, true);
|
||||
}
|
||||
else if (haspw == 'false') {
|
||||
LoginPage.authenticateUserByName(apiClient, name, '');
|
||||
} else {
|
||||
$('#txtManualName', page).val(name);
|
||||
$('#txtManualPassword', '#loginPage').val('');
|
||||
|
@ -187,7 +208,9 @@
|
|||
|
||||
onManualSubmit: function () {
|
||||
|
||||
LoginPage.authenticateUserByName($('#txtManualName', '#loginPage').val(), $('#txtManualPassword', '#loginPage').val());
|
||||
LoginPage.getApiClient().done(function (apiClient) {
|
||||
LoginPage.authenticateUserByName(apiClient, $('#txtManualName', '#loginPage').val(), $('#txtManualPassword', '#loginPage').val());
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
|
|
|
@ -90,8 +90,9 @@
|
|||
function onPopupOpen(elem) {
|
||||
elem.popup("open").parents(".ui-popup-container").css("margin-top", 30);
|
||||
|
||||
// TODO: With iOS 8 this might not be required anymore
|
||||
if ($.browser.safari) {
|
||||
$('.itemVideo').css('visibility', 'hidden');
|
||||
//$('.itemVideo').css('visibility', 'hidden');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -910,6 +911,10 @@
|
|||
|
||||
self.canAutoPlayVideo = function () {
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($.browser.msie || $.browser.mobile) {
|
||||
return false;
|
||||
}
|
||||
|
@ -917,6 +922,11 @@
|
|||
return true;
|
||||
};
|
||||
|
||||
self.enableCustomVideoControls = function () {
|
||||
|
||||
return self.canAutoPlayVideo() && !$.browser.mobile;
|
||||
};
|
||||
|
||||
// Replace audio version
|
||||
self.cleanup = function (playerElement) {
|
||||
|
||||
|
@ -996,7 +1006,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 +1212,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) {
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
self.getTargets = function () {
|
||||
|
||||
var targets = [{
|
||||
name: 'My Browser',
|
||||
name: Globalize.translate('MyDevice'),
|
||||
id: ConnectionManager.deviceId(),
|
||||
playerName: self.name,
|
||||
playableMediaTypes: ['Audio', 'Video'],
|
||||
|
@ -126,7 +126,7 @@
|
|||
|
||||
profile.DirectPlayProfiles = [];
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: 'mp4',
|
||||
Container: 'mp4,m4v',
|
||||
Type: 'Video',
|
||||
VideoCodec: 'h264',
|
||||
AudioCodec: 'aac,mp3'
|
||||
|
@ -134,11 +134,18 @@
|
|||
|
||||
if ($.browser.chrome) {
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: 'mkv,m4v',
|
||||
Container: 'mkv',
|
||||
Type: 'Video',
|
||||
VideoCodec: 'h264',
|
||||
AudioCodec: 'aac,mp3'
|
||||
});
|
||||
// TODO: Test this
|
||||
//profile.DirectPlayProfiles.push({
|
||||
// Container: 'mov',
|
||||
// Type: 'Video',
|
||||
// VideoCodec: 'h264',
|
||||
// AudioCodec: 'aac,mp3'
|
||||
//});
|
||||
}
|
||||
|
||||
profile.DirectPlayProfiles.push({
|
||||
|
@ -208,7 +215,6 @@
|
|||
profile.ContainerProfiles = [];
|
||||
|
||||
var audioConditions = [];
|
||||
var videoAudioAacConditions = [];
|
||||
var videoAudioMp3Conditions = [];
|
||||
|
||||
var maxAudioChannels = $.browser.msie || $.browser.safari ?
|
||||
|
@ -222,7 +228,6 @@
|
|||
};
|
||||
|
||||
audioConditions.push(channelCondition);
|
||||
videoAudioAacConditions.push(channelCondition);
|
||||
videoAudioMp3Conditions.push(channelCondition);
|
||||
|
||||
profile.CodecProfiles = [];
|
||||
|
@ -239,22 +244,32 @@
|
|||
});
|
||||
}
|
||||
|
||||
videoAudioAacConditions.push({
|
||||
Condition: 'NotEquals',
|
||||
Property: 'AudioProfile',
|
||||
Value: 'LC'
|
||||
});
|
||||
|
||||
videoAudioAacConditions.push({
|
||||
Condition: 'NotEquals',
|
||||
Property: 'AudioProfile',
|
||||
Value: 'HE-AAC'
|
||||
profile.CodecProfiles.push({
|
||||
Type: 'VideoAudio',
|
||||
Codec: 'aac',
|
||||
Container: 'mkv,mov',
|
||||
Conditions: [
|
||||
channelCondition,
|
||||
{
|
||||
Condition: 'NotEquals',
|
||||
Property: 'AudioProfile',
|
||||
Value: 'HE-AAC'
|
||||
},
|
||||
{
|
||||
Condition: 'NotEquals',
|
||||
Property: 'AudioProfile',
|
||||
Value: 'LC'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
profile.CodecProfiles.push({
|
||||
Type: 'VideoAudio',
|
||||
Codec: 'aac',
|
||||
Conditions: videoAudioAacConditions
|
||||
Container: 'mp4,m4v',
|
||||
Conditions: [
|
||||
channelCondition
|
||||
]
|
||||
});
|
||||
|
||||
profile.CodecProfiles.push({
|
||||
|
@ -311,6 +326,26 @@
|
|||
});
|
||||
}
|
||||
|
||||
profile.ResponseProfiles = [];
|
||||
|
||||
profile.ResponseProfiles.push({
|
||||
Type: 'Video',
|
||||
Container: 'm4v',
|
||||
MimeType: 'video/mp4'
|
||||
});
|
||||
|
||||
//profile.ResponseProfiles.push({
|
||||
// Type: 'Video',
|
||||
// Container: 'mkv',
|
||||
// MimeType: 'video/webm'
|
||||
//});
|
||||
|
||||
profile.ResponseProfiles.push({
|
||||
Type: 'Video',
|
||||
Container: 'mov',
|
||||
MimeType: 'video/webm'
|
||||
});
|
||||
|
||||
return profile;
|
||||
};
|
||||
|
||||
|
@ -825,7 +860,10 @@
|
|||
|
||||
var deviceProfile = self.getDeviceProfile();
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
if (item.MediaType === "Video") {
|
||||
|
||||
Dashboard.showModalLoadingMsg();
|
||||
}
|
||||
|
||||
getPlaybackInfo(item.Id, deviceProfile, startPosition).done(function (playbackInfoResult) {
|
||||
|
||||
|
@ -848,7 +886,7 @@
|
|||
playInternalPostMediaSourceSelection(item, mediaSource, startPosition, callback);
|
||||
}
|
||||
} else {
|
||||
Dashboard.hideLoadingMsg();
|
||||
Dashboard.hideModalLoadingMsg();
|
||||
showPlaybackInfoErrorMessage('NoCompatibleStream');
|
||||
}
|
||||
}
|
||||
|
@ -858,7 +896,7 @@
|
|||
|
||||
function playInternalPostMediaSourceSelection(item, mediaSource, startPosition, callback) {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
Dashboard.hideModalLoadingMsg();
|
||||
|
||||
self.currentMediaSource = mediaSource;
|
||||
self.currentItem = item;
|
||||
|
@ -1589,6 +1627,10 @@
|
|||
|
||||
self.canAutoPlayAudio = function () {
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($.browser.android || ($.browser.webkit && !$.browser.chrome)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -2,10 +2,14 @@
|
|||
|
||||
function loadLatest(page, userId, parentId) {
|
||||
|
||||
var limit = AppInfo.hasLowImageBandwidth ?
|
||||
15 :
|
||||
18;
|
||||
|
||||
var options = {
|
||||
|
||||
IncludeItemTypes: "Movie",
|
||||
Limit: 18,
|
||||
Limit: limit,
|
||||
Fields: "PrimaryImageAspectRatio,MediaSourceCount,SyncInfo",
|
||||
ParentId: parentId,
|
||||
ImageTypeLimit: 1,
|
||||
|
@ -24,6 +28,46 @@
|
|||
});
|
||||
}
|
||||
|
||||
function loadResume(page, userId, parentId) {
|
||||
|
||||
var screenWidth = $(window).width();
|
||||
|
||||
var options = {
|
||||
|
||||
SortBy: "DatePlayed",
|
||||
SortOrder: "Descending",
|
||||
IncludeItemTypes: "Movie",
|
||||
Filters: "IsResumable",
|
||||
Limit: screenWidth >= 1920 ? 6 : (screenWidth >= 1600 ? 4 : 3),
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,MediaSourceCount,SyncInfo",
|
||||
CollapseBoxSetItems: false,
|
||||
ParentId: parentId,
|
||||
ImageTypeLimit: 1,
|
||||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
};
|
||||
|
||||
ApiClient.getItems(userId, options).done(function (result) {
|
||||
|
||||
if (result.Items.length) {
|
||||
$('#resumableSection', page).show();
|
||||
} else {
|
||||
$('#resumableSection', page).hide();
|
||||
}
|
||||
|
||||
$('#resumableItems', page).html(LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
preferThumb: true,
|
||||
shape: 'backdrop',
|
||||
overlayText: true,
|
||||
showTitle: true,
|
||||
lazy: true
|
||||
|
||||
})).lazyChildren().trigger('create');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function getRecommendationHtml(recommendation) {
|
||||
|
||||
var html = '';
|
||||
|
@ -62,58 +106,10 @@
|
|||
return html;
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#moviesRecommendedPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('.recommendations', page).createCardMenus();
|
||||
|
||||
}).on('pagebeforeshow', "#moviesRecommendedPage", function () {
|
||||
|
||||
var parentId = LibraryMenu.getTopParentId();
|
||||
function loadSuggestions(page, userId, parentId) {
|
||||
|
||||
var screenWidth = $(window).width();
|
||||
|
||||
var page = this;
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
var options = {
|
||||
|
||||
SortBy: "DatePlayed",
|
||||
SortOrder: "Descending",
|
||||
IncludeItemTypes: "Movie",
|
||||
Filters: "IsResumable",
|
||||
Limit: screenWidth >= 1920 ? 6 : (screenWidth >= 1600 ? 4 : 3),
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,MediaSourceCount,SyncInfo",
|
||||
CollapseBoxSetItems: false,
|
||||
ParentId: parentId,
|
||||
ImageTypeLimit: 1,
|
||||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
};
|
||||
|
||||
ApiClient.getItems(userId, options).done(function (result) {
|
||||
|
||||
if (result.Items.length) {
|
||||
$('#resumableSection', page).show();
|
||||
} else {
|
||||
$('#resumableSection', page).hide();
|
||||
}
|
||||
|
||||
$('#resumableItems', page).html(LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
preferThumb: true,
|
||||
shape: 'backdrop',
|
||||
overlayText: true,
|
||||
showTitle: true,
|
||||
lazy: true
|
||||
|
||||
})).lazyChildren().trigger('create');
|
||||
|
||||
});
|
||||
|
||||
loadLatest(page, userId, parentId);
|
||||
|
||||
var url = ApiClient.getUrl("Movies/Recommendations", {
|
||||
|
||||
userId: userId,
|
||||
|
@ -138,6 +134,27 @@
|
|||
$('.noItemsMessage', page).hide();
|
||||
$('.recommendations', page).html(html).lazyChildren();
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#moviesRecommendedPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('.recommendations', page).createCardMenus();
|
||||
|
||||
}).on('pagebeforeshow', "#moviesRecommendedPage", function () {
|
||||
|
||||
var parentId = LibraryMenu.getTopParentId();
|
||||
|
||||
var page = this;
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
loadResume(page, userId, parentId);
|
||||
loadLatest(page, userId, parentId);
|
||||
|
||||
if (!AppInfo.hasLowImageBandwidth) {
|
||||
loadSuggestions(page, userId, parentId);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -99,12 +99,7 @@
|
|||
|
||||
});
|
||||
|
||||
// See backrops.js for comments on this
|
||||
if ($.browser.msie) {
|
||||
$('.fldEnableBackdrops', page).hide();
|
||||
} else {
|
||||
$('.fldEnableBackdrops', page).show();
|
||||
}
|
||||
$('.fldEnableBackdrops', page).show();
|
||||
});
|
||||
|
||||
window.WebClientPreferencesPage = {
|
||||
|
|
|
@ -21,18 +21,21 @@
|
|||
var html = '';
|
||||
|
||||
html += '<div class="nowPlayingBar" style="display:none;">';
|
||||
html += '<div style="display:inline-block;width:12px;"></div>';
|
||||
|
||||
html += '<a class="mediaButton remoteControlButton" title="' + Globalize.translate('ButtonRemoteControl') + '" href="nowplaying.html" data-transition="slideup" data-role="button" data-icon="remote" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonRemoteControl') + '</a>';
|
||||
html += '<div class="nowPlayingImage"></div>';
|
||||
html += '<div class="nowPlayingText"></div>';
|
||||
|
||||
html += '<a id="playlistButton" class="mediaButton playlistButton" href="nowplaying.html?tab=Playlist" data-transition="slideup" data-role="button" data-icon="bullets" data-iconpos="notext" data-inline="true" title="' + Globalize.translate('ButtonPlaylist') + '">' + Globalize.translate('ButtonPlaylist') + '</a>';
|
||||
html += '<button id="previousTrackButton" class="mediaButton previousTrackButton" title="' + Globalize.translate('ButtonPreviousTrack') + '" type="button" data-icon="previous-track" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonPreviousTrack') + '</button>';
|
||||
html += '<a class="mediaButton remoteControlButton imageButton" href="nowplaying.html" data-transition="slideup" title="' + Globalize.translate('ButtonRemoteControl') + '"><i class="fa fa-tablet"></i></a>';
|
||||
html += '<a class="mediaButton playlistButton imageButton" href="nowplaying.html?tab=Playlist" data-transition="slideup" title="' + Globalize.translate('ButtonPlaylist') + '"><i class="fa fa-list"></i></a>';
|
||||
|
||||
html += '<button id="playButton" class="mediaButton unpauseButton" title="' + Globalize.translate('ButtonPlay') + '" type="button" data-icon="play" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonPlay') + '</button>';
|
||||
html += '<button id="pauseButton" class="mediaButton pauseButton" title="' + Globalize.translate('ButtonPause') + '" type="button" data-icon="pause" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonPause') + '</button>';
|
||||
html += '<button class="mediaButton previousTrackButton imageButton" title="' + Globalize.translate('ButtonPreviousTrack') + '" type="button" data-role="none"><i class="fa fa-step-backward"></i></button>';
|
||||
|
||||
html += '<button id="stopButton" class="mediaButton stopButton" title="' + Globalize.translate('ButtonStop') + '" type="button" data-icon="stop" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonStop') + '</button>';
|
||||
html += '<button id="nextTrackButton" class="mediaButton nextTrackButton" title="' + Globalize.translate('ButtonNextTrack') + '" type="button" data-icon="next-track" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonNextTrack') + '</button>';
|
||||
html += '<button class="mediaButton unpauseButton imageButton" title="' + Globalize.translate('ButtonPlay') + '" type="button" data-role="none"><i class="fa fa-play"></i></button>';
|
||||
html += '<button class="mediaButton pauseButton imageButton" title="' + Globalize.translate('ButtonPause') + '" type="button" data-role="none"><i class="fa fa-pause"></i></button>';
|
||||
|
||||
html += '<button class="mediaButton stopButton imageButton" title="' + Globalize.translate('ButtonStop') + '" type="button" data-role="none"><i class="fa fa-stop"></i></button>';
|
||||
|
||||
html += '<button class="mediaButton nextTrackButton imageButton" title="' + Globalize.translate('ButtonNextTrack') + '" type="button" data-role="none"><i class="fa fa-step-forward"></i></button>';
|
||||
|
||||
html += '<div id="mediaElement"></div>';
|
||||
|
||||
|
@ -41,11 +44,8 @@
|
|||
html += '</div>';
|
||||
|
||||
html += '<div class="currentTime"></div>';
|
||||
html += '<div class="nowPlayingImage"></div>';
|
||||
html += '<div class="nowPlayingText"></div>';
|
||||
|
||||
html += '<button id="muteButton" class="mediaButton muteButton" title="' + Globalize.translate('ButtonMute') + '" type="button" data-icon="audio" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonMute') + '</button>';
|
||||
html += '<button id="unmuteButton" class="mediaButton unmuteButton" title="' + Globalize.translate('ButtonUnmute') + '" type="button" data-icon="volume-off" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonUnmute') + '</button>';
|
||||
html += '<button class="mediaButton muteButton imageButton" title="' + Globalize.translate('ButtonMute') + '" type="button" data-role="none"><i class="fa fa-volume-up"></i></button>';
|
||||
html += '<button class="mediaButton unmuteButton imageButton" title="' + Globalize.translate('ButtonUnmute') + '" type="button" data-role="none"><i class="fa fa-volume-off"></i></button>';
|
||||
|
||||
html += '<div class="volumeSliderContainer sliderContainer">';
|
||||
html += '<input type="range" class="mediaSlider volumeSlider slider" step=".05" min="0" max="100" value="0" style="display:none;" data-mini="true" data-theme="a" data-highlight="true" />';
|
||||
|
@ -298,6 +298,7 @@
|
|||
nowPlayingTextElement.html(nameHtml);
|
||||
|
||||
var url;
|
||||
var imgHeight = 50;
|
||||
|
||||
var nowPlayingItem = state.NowPlayingItem;
|
||||
|
||||
|
@ -305,7 +306,7 @@
|
|||
|
||||
url = ApiClient.getScaledImageUrl(nowPlayingItem.PrimaryImageItemId, {
|
||||
type: "Primary",
|
||||
height: 40,
|
||||
height: imgHeight,
|
||||
tag: nowPlayingItem.PrimaryImageTag
|
||||
});
|
||||
}
|
||||
|
@ -313,7 +314,7 @@
|
|||
|
||||
url = ApiClient.getScaledImageUrl(nowPlayingItem.BackdropItemId, {
|
||||
type: "Backdrop",
|
||||
height: 40,
|
||||
height: imgHeight,
|
||||
tag: nowPlayingItem.BackdropImageTag,
|
||||
index: 0
|
||||
});
|
||||
|
@ -322,7 +323,7 @@
|
|||
|
||||
url = ApiClient.getScaledImageUrl(nowPlayingItem.ThumbImageItemId, {
|
||||
type: "Thumb",
|
||||
height: 40,
|
||||
height: imgHeight,
|
||||
tag: nowPlayingItem.ThumbImageTag
|
||||
});
|
||||
}
|
||||
|
|
|
@ -614,7 +614,7 @@
|
|||
}
|
||||
|
||||
function showIntro() {
|
||||
|
||||
|
||||
if (store.getItem('remotecontrolswipedown') != '1') {
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('MessageSwipeDownOnRemoteControl'),
|
||||
|
@ -626,60 +626,39 @@
|
|||
}
|
||||
|
||||
function loadPlaylist(page) {
|
||||
|
||||
|
||||
var html = '';
|
||||
|
||||
html += '<table class="detailTable">';
|
||||
//ApiClient.getItems(Dashboard.getCurrentUserId(), {
|
||||
|
||||
html += '<thead><tr>';
|
||||
html += '<th></th>';
|
||||
html += '<th>' + Globalize.translate('HeaderName') + '</th>';
|
||||
html += '<th>' + Globalize.translate('HeaderAlbum') + '</th>';
|
||||
html += '<th>' + Globalize.translate('HeaderArtist') + '</th>';
|
||||
html += '<th>' + Globalize.translate('HeaderAlbumArtist') + '</th>';
|
||||
html += '<th>' + Globalize.translate('HeaderTime') + '</th>';
|
||||
html += '</tr></thead>';
|
||||
// SortBy: "SortName",
|
||||
// SortOrder: "Ascending",
|
||||
// IncludeItemTypes: "Audio",
|
||||
// Recursive: true,
|
||||
// Fields: "PrimaryImageAspectRatio,SortName,MediaSourceCount,IsUnidentified,SyncInfo",
|
||||
// StartIndex: 0,
|
||||
// ImageTypeLimit: 1,
|
||||
// EnableImageTypes: "Primary,Backdrop,Banner,Thumb",
|
||||
// Limit: 100
|
||||
|
||||
html += '<tbody>';
|
||||
//}).done(function (result) {
|
||||
|
||||
$.each(MediaController.playlist(), function (i, item) {
|
||||
// html += LibraryBrowser.getListViewHtml({
|
||||
// items: result.Items,
|
||||
// smallIcon: true,
|
||||
// defaultAction: 'setplaylistindex'
|
||||
// });
|
||||
|
||||
var name = LibraryBrowser.getPosterViewDisplayName(item);
|
||||
// $(".playlist", page).html(html).trigger('create').lazyChildren();
|
||||
//});
|
||||
|
||||
var parentName = item.SeriesName || item.Album;
|
||||
|
||||
html += '<tr>';
|
||||
html += '<td><button type="button" data-index="' + i + '" class="lnkPlayFromIndex" data-icon="play" data-iconpos="notext">' + Globalize.translate('ButtonPlay') + '</button></td>';
|
||||
html += '<td>';
|
||||
html += '<a href="itemdetails.html?id=' + item.Id + '">' + name + '</a>';
|
||||
html += '</td>';
|
||||
|
||||
html += '<td>';
|
||||
if (parentName) {
|
||||
var parentId = item.AlbumId || item.SeriesId || item.ParentId;
|
||||
html += '<a href="itemdetails.html?id=' + parentId + '">' + parentName + '</a>';
|
||||
}
|
||||
html += '</td>';
|
||||
|
||||
html += '<td>';
|
||||
html += LibraryBrowser.getArtistLinksHtml(item.ArtistItems || []);
|
||||
html += '</td>';
|
||||
|
||||
html += '<td>';
|
||||
if (item.AlbumArtist) {
|
||||
html += LibraryBrowser.getArtistLinksHtml(item.AlbumArtists || []);
|
||||
}
|
||||
html += '</td>';
|
||||
|
||||
html += '<td>' + Dashboard.getDisplayTime(item.RunTimeTicks) + '</td>';
|
||||
html += '<td><button type="button" data-index="' + i + '" class="lnkRemoveFromIndex" data-icon="delete" data-iconpos="notext">' + Globalize.translate('ButtonRemove') + '</button></td>';
|
||||
html += '</tr>';
|
||||
html += LibraryBrowser.getListViewHtml({
|
||||
items: MediaController.playlist(),
|
||||
smallIcon: true,
|
||||
defaultAction: 'play'
|
||||
});
|
||||
|
||||
html += '</tbody>';
|
||||
html += '</table>';
|
||||
|
||||
$(".playlist", page).html(html).trigger('create');
|
||||
$(".playlist", page).html(html).trigger('create').lazyChildren();
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#nowPlayingPage", function () {
|
||||
|
|
|
@ -19,6 +19,15 @@
|
|||
window.location = 'index.html';
|
||||
}
|
||||
break;
|
||||
case MediaBrowser.ConnectionState.ServerSignIn:
|
||||
{
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
window.location = 'login.html?serverid=' + result.Servers[0].Id;
|
||||
} else {
|
||||
showServerConnectionFailure();
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
showServerConnectionFailure();
|
||||
break;
|
||||
|
@ -55,13 +64,20 @@
|
|||
var href = "#";
|
||||
html += '<a class="cardContent lnkServer" data-serverid="' + server.Id + '" href="' + href + '">';
|
||||
|
||||
var imgUrl = 'css/images/server.png';
|
||||
var imgUrl = server.Id == 'connect' ? 'css/images/logo536.png' : '';
|
||||
|
||||
html += '<div class="cardImage" style="background-image:url(\'' + imgUrl + '\');">';
|
||||
if (imgUrl) {
|
||||
html += '<div class="cardImage" style="background-image:url(\'' + imgUrl + '\');">';
|
||||
} else {
|
||||
html += '<div class="cardImage" style="text-align:center;">';
|
||||
|
||||
var icon = server.Id == 'new' ? 'plus-circle' : 'globe';
|
||||
html += '<i class="fa fa-' + icon + '" style="color:#fff;vertical-align:middle;font-size:100px;margin-top:25%;"></i>';
|
||||
}
|
||||
|
||||
html += "</div>";
|
||||
|
||||
// cardContent
|
||||
// cardContent'
|
||||
html += "</a>";
|
||||
|
||||
// cardScalable
|
||||
|
@ -69,11 +85,13 @@
|
|||
|
||||
html += '<div class="cardFooter">';
|
||||
|
||||
html += '<div class="cardText" style="text-align:right; float:right;">';
|
||||
if (server.showOptions !== false) {
|
||||
html += '<div class="cardText" style="text-align:right; float:right;">';
|
||||
|
||||
html += '<button class="btnServerMenu" type="button" data-inline="true" data-iconpos="notext" data-icon="ellipsis-v" style="margin: 2px 0 0;"></button>';
|
||||
html += '<button class="btnServerMenu" type="button" data-inline="true" data-iconpos="notext" data-icon="ellipsis-v" style="margin: 2px 0 0;"></button>';
|
||||
|
||||
html += "</div>";
|
||||
html += "</div>";
|
||||
}
|
||||
|
||||
html += '<div class="cardText" style="margin-right: 30px; padding: 11px 0 10px;">';
|
||||
html += server.Name;
|
||||
|
@ -108,6 +126,17 @@
|
|||
$('.lnkServer', elem).on('click', function () {
|
||||
|
||||
var id = this.getAttribute('data-serverid');
|
||||
|
||||
if (id == 'new') {
|
||||
Dashboard.navigate('connectlogin.html?mode=manualserver');
|
||||
return;
|
||||
}
|
||||
|
||||
if (id == 'connect') {
|
||||
Dashboard.navigate('connectlogin.html?mode=connect');
|
||||
return;
|
||||
}
|
||||
|
||||
var server = servers.filter(function (s) {
|
||||
return s.Id == id;
|
||||
})[0];
|
||||
|
@ -272,10 +301,8 @@
|
|||
var href = "#";
|
||||
html += '<a class="cardContent" href="' + href + '">';
|
||||
|
||||
var imgUrl = 'css/images/server.png';
|
||||
|
||||
html += '<div class="cardImage" style="background-image:url(\'' + imgUrl + '\');">';
|
||||
|
||||
html += '<div class="cardImage" style="text-align:center;">';
|
||||
html += '<i class="fa fa-globe" style="color:#fff;vertical-align:middle;font-size:100px;margin-top:25%;"></i>';
|
||||
html += "</div>";
|
||||
|
||||
// cardContent
|
||||
|
@ -326,11 +353,19 @@
|
|||
|
||||
function loadInvitations(page) {
|
||||
|
||||
ConnectionManager.getUserInvitations().done(function (list) {
|
||||
if (ConnectionManager.isLoggedIntoConnect()) {
|
||||
|
||||
renderInvitations(page, list);
|
||||
ConnectionManager.getUserInvitations().done(function (list) {
|
||||
|
||||
renderInvitations(page, list);
|
||||
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
renderInvitations(page, []);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function loadPage(page) {
|
||||
|
@ -339,6 +374,24 @@
|
|||
|
||||
ConnectionManager.getAvailableServers().done(function (servers) {
|
||||
|
||||
servers = servers.slice(0);
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
servers.push({
|
||||
Name: Globalize.translate('ButtonNewServer'),
|
||||
Id: 'new',
|
||||
showOptions: false
|
||||
});
|
||||
}
|
||||
|
||||
if (!ConnectionManager.isLoggedIntoConnect()) {
|
||||
servers.push({
|
||||
Name: Globalize.translate('ButtonSignInWithConnect'),
|
||||
Id: 'connect',
|
||||
showOptions: false
|
||||
});
|
||||
}
|
||||
|
||||
renderServers(page, servers);
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
|
|
@ -42,6 +42,23 @@ var Dashboard = {
|
|||
$.mobile.panel.prototype.options.classes.panel = "largePanel ui-panel";
|
||||
},
|
||||
|
||||
isConnectMode: function () {
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var url = getWindowUrl().toLowerCase();
|
||||
|
||||
return url.indexOf('mediabrowser.tv') != -1 ||
|
||||
url.indexOf('emby.media') != -1;
|
||||
},
|
||||
|
||||
isRunningInCordova: function () {
|
||||
|
||||
return window.appMode == 'cordova';
|
||||
},
|
||||
|
||||
onRequestFail: function (e, data) {
|
||||
|
||||
if (data.status == 401) {
|
||||
|
@ -180,14 +197,6 @@ var Dashboard = {
|
|||
Dashboard.getUserPromise = null;
|
||||
},
|
||||
|
||||
isConnectMode: function () {
|
||||
|
||||
var url = getWindowUrl().toLowerCase();
|
||||
|
||||
return url.indexOf('mediabrowser.tv') != -1 ||
|
||||
url.indexOf('emby.media') != -1;
|
||||
},
|
||||
|
||||
logout: function (logoutWithServer) {
|
||||
|
||||
store.removeItem("userId");
|
||||
|
@ -230,28 +239,6 @@ var Dashboard = {
|
|||
}, 3000);
|
||||
},
|
||||
|
||||
alert: function (options) {
|
||||
|
||||
if (typeof options == "string") {
|
||||
|
||||
var message = options;
|
||||
|
||||
$.mobile.loading('show', {
|
||||
text: message,
|
||||
textonly: true,
|
||||
textVisible: true
|
||||
});
|
||||
|
||||
setTimeout(function () {
|
||||
$.mobile.loading('hide');
|
||||
}, 3000);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Dashboard.confirmInternal(options.message, options.title || Globalize.translate('HeaderAlert'), false, options.callback);
|
||||
},
|
||||
|
||||
updateSystemInfo: function (info) {
|
||||
|
||||
Dashboard.lastSystemInfo = info;
|
||||
|
@ -381,6 +368,10 @@ var Dashboard = {
|
|||
|
||||
showFooterNotification: function (options) {
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
return;
|
||||
}
|
||||
|
||||
var removeOnHide = !options.id;
|
||||
|
||||
options.id = options.id || "notification" + new Date().getTime() + parseInt(Math.random());
|
||||
|
@ -454,6 +445,29 @@ var Dashboard = {
|
|||
$.mobile.loading("hide");
|
||||
},
|
||||
|
||||
getModalLoadingMsg: function () {
|
||||
|
||||
var elem = $('.modalLoading');
|
||||
|
||||
if (!elem.length) {
|
||||
|
||||
elem = $('<div class="modalLoading"></div>').appendTo(document.body);
|
||||
|
||||
}
|
||||
|
||||
return elem;
|
||||
},
|
||||
|
||||
showModalLoadingMsg: function () {
|
||||
Dashboard.showLoadingMsg();
|
||||
Dashboard.getModalLoadingMsg().show();
|
||||
},
|
||||
|
||||
hideModalLoadingMsg: function () {
|
||||
Dashboard.getModalLoadingMsg().hide();
|
||||
Dashboard.hideLoadingMsg();
|
||||
},
|
||||
|
||||
processPluginConfigurationUpdateResult: function () {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
@ -470,6 +484,53 @@ var Dashboard = {
|
|||
Dashboard.alert(Globalize.translate('MessageSettingsSaved'));
|
||||
},
|
||||
|
||||
alert: function (options) {
|
||||
|
||||
if (typeof options == "string") {
|
||||
|
||||
var message = options;
|
||||
|
||||
$.mobile.loading('show', {
|
||||
text: message,
|
||||
textonly: true,
|
||||
textVisible: true
|
||||
});
|
||||
|
||||
setTimeout(function () {
|
||||
$.mobile.loading('hide');
|
||||
}, 3000);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Cordova
|
||||
if (navigator.notification && navigator.notification.alert && options.message.indexOf('<') == -1) {
|
||||
|
||||
navigator.notification.alert(options.message, options.callback || function () { }, options.title || Globalize.translate('HeaderAlert'));
|
||||
|
||||
} else {
|
||||
Dashboard.confirmInternal(options.message, options.title || Globalize.translate('HeaderAlert'), false, options.callback);
|
||||
}
|
||||
},
|
||||
|
||||
confirm: function (message, title, callback) {
|
||||
|
||||
// Cordova
|
||||
if (navigator.notification && navigator.notification.alert && message.indexOf('<') == -1) {
|
||||
|
||||
var buttonLabels = [Globalize.translate('ButtonOk'), Globalize.translate('ButtonCancel')];
|
||||
|
||||
navigator.notification.confirm(message, function (index) {
|
||||
|
||||
callback(index == 1);
|
||||
|
||||
}, title || Globalize.translate('HeaderAlert'), buttonLabels.join(','));
|
||||
|
||||
} else {
|
||||
Dashboard.confirmInternal(message, title, true, callback);
|
||||
}
|
||||
},
|
||||
|
||||
confirmInternal: function (message, title, showCancel, callback) {
|
||||
|
||||
$('.confirmFlyout').popup("close").remove();
|
||||
|
@ -508,10 +569,6 @@ var Dashboard = {
|
|||
});
|
||||
},
|
||||
|
||||
confirm: function (message, title, callback) {
|
||||
Dashboard.confirmInternal(message, title, true, callback);
|
||||
},
|
||||
|
||||
refreshSystemInfoFromServer: function () {
|
||||
|
||||
if (Dashboard.getAccessToken()) {
|
||||
|
@ -583,7 +640,7 @@ var Dashboard = {
|
|||
var url = user.imageUrl;
|
||||
|
||||
if (user.supportsImageParams) {
|
||||
url += "&width=" + (imgWidth * Math.max(devicePixelRatio || 1, 2));
|
||||
url += "&width=" + (imgWidth * Math.max(window.devicePixelRatio || 1, 2));
|
||||
}
|
||||
|
||||
html += '<img style="max-width:' + imgWidth + 'px;vertical-align:middle;margin-right:.5em;border-radius: 50px;" src="' + url + '" />';
|
||||
|
@ -1277,7 +1334,7 @@ var Dashboard = {
|
|||
|
||||
isServerlessPage: function () {
|
||||
var url = getWindowUrl().toLowerCase();
|
||||
return url.indexOf('connectlogin.html') != -1 || url.indexOf('selectserver.html') != -1;
|
||||
return url.indexOf('connectlogin.html') != -1 || url.indexOf('selectserver.html') != -1 || url.indexOf('login.html') != -1 || url.indexOf('forgotpassword.html') != -1 || url.indexOf('forgotpasswordpin.html') != -1;
|
||||
},
|
||||
|
||||
capabilities: function () {
|
||||
|
@ -1285,50 +1342,161 @@ var Dashboard = {
|
|||
PlayableMediaTypes: "Audio,Video",
|
||||
|
||||
SupportedCommands: Dashboard.getSupportedRemoteCommands().join(','),
|
||||
SupportsPersistentIdentifier: false,
|
||||
SupportsPersistentIdentifier: Dashboard.isRunningInCordova(),
|
||||
SupportsMediaControl: true,
|
||||
SupportedLiveMediaTypes: ['Audio', 'Video']
|
||||
};
|
||||
},
|
||||
|
||||
getDefaultImageQuality: function (imageType) {
|
||||
|
||||
var quality = 90;
|
||||
var isBackdrop = imageType.toLowerCase() == 'backdrop';
|
||||
|
||||
if (isBackdrop) {
|
||||
quality -= 10;
|
||||
}
|
||||
|
||||
if (AppInfo.hasLowImageBandwidth) {
|
||||
|
||||
quality -= 15;
|
||||
|
||||
if (isBackdrop) {
|
||||
quality -= 10;
|
||||
}
|
||||
}
|
||||
|
||||
return quality;
|
||||
},
|
||||
|
||||
getAppInfo: function () {
|
||||
|
||||
function generateDeviceName() {
|
||||
|
||||
var name = "Web Browser";
|
||||
|
||||
if ($.browser.chrome) {
|
||||
name = "Chrome";
|
||||
} else if ($.browser.safari) {
|
||||
name = "Safari";
|
||||
} else if ($.browser.webkit) {
|
||||
name = "WebKit";
|
||||
} else if ($.browser.msie) {
|
||||
name = "Internet Explorer";
|
||||
} else if ($.browser.opera) {
|
||||
name = "Opera";
|
||||
} else if ($.browser.firefox || $.browser.mozilla) {
|
||||
name = "Firefox";
|
||||
}
|
||||
|
||||
if ($.browser.version) {
|
||||
name += " " + $.browser.version;
|
||||
}
|
||||
|
||||
if ($.browser.ipad) {
|
||||
name += " Ipad";
|
||||
} else if ($.browser.iphone) {
|
||||
name += " Iphone";
|
||||
} else if ($.browser.android) {
|
||||
name += " Android";
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
var appVersion = window.dashboardVersion;
|
||||
var appName = "Emby Web Client";
|
||||
|
||||
var deviceName;
|
||||
var deviceId;
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
|
||||
if ($.browser.safari) {
|
||||
|
||||
appName = "iOS";
|
||||
|
||||
if ($.browser.iphone) {
|
||||
deviceName = 'iPhone';
|
||||
} else if ($.browser.ipad) {
|
||||
deviceName = 'iPad';
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
appName = "Android";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
deviceName = deviceName || generateDeviceName();
|
||||
|
||||
// Cordova
|
||||
//if (window.device) {
|
||||
|
||||
// deviceName = device.model;
|
||||
// deviceId = device.uuid;
|
||||
|
||||
//}
|
||||
//else
|
||||
{
|
||||
var seed = [];
|
||||
var keyName = 'randomId';
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
seed.push('cordova');
|
||||
keyName = 'cordovaDeviceId';
|
||||
}
|
||||
|
||||
deviceId = MediaBrowser.generateDeviceId(keyName, seed.join(','));
|
||||
}
|
||||
|
||||
return {
|
||||
appName: appName,
|
||||
appVersion: appVersion,
|
||||
deviceName: deviceName,
|
||||
deviceId: deviceId
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
var AppInfo = {};
|
||||
|
||||
(function () {
|
||||
|
||||
function generateDeviceName() {
|
||||
|
||||
var name = "Web Browser";
|
||||
|
||||
if ($.browser.chrome) {
|
||||
name = "Chrome";
|
||||
} else if ($.browser.safari) {
|
||||
name = "Safari";
|
||||
} else if ($.browser.webkit) {
|
||||
name = "WebKit";
|
||||
} else if ($.browser.msie) {
|
||||
name = "Internet Explorer";
|
||||
} else if ($.browser.opera) {
|
||||
name = "Opera";
|
||||
} else if ($.browser.firefox || $.browser.mozilla) {
|
||||
name = "Firefox";
|
||||
}
|
||||
|
||||
if ($.browser.version) {
|
||||
name += " " + $.browser.version;
|
||||
}
|
||||
|
||||
if ($.browser.ipad) {
|
||||
name += " Ipad";
|
||||
} else if ($.browser.iphone) {
|
||||
name += " Iphone";
|
||||
} else if ($.browser.android) {
|
||||
name += " Android";
|
||||
}
|
||||
return name;
|
||||
function isTouchDevice() {
|
||||
return (('ontouchstart' in window)
|
||||
|| (navigator.MaxTouchPoints > 0)
|
||||
|| (navigator.msMaxTouchPoints > 0));
|
||||
}
|
||||
|
||||
if (!window.WebSocket) {
|
||||
function setAppInfo() {
|
||||
|
||||
alert(Globalize.translate('MessageBrowserDoesNotSupportWebSockets'));
|
||||
if (isTouchDevice()) {
|
||||
AppInfo.isTouchPreferred = true;
|
||||
}
|
||||
|
||||
if ($.browser.safari) {
|
||||
|
||||
if ($.browser.mobile) {
|
||||
AppInfo.hasLowImageBandwidth = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if (!$.browser.tv) {
|
||||
AppInfo.enableHeadRoom = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!AppInfo.hasLowImageBandwidth) {
|
||||
AppInfo.enableLatestChannelItems = true;
|
||||
AppInfo.enableStudioTabs = true;
|
||||
AppInfo.enablePeopleTabs = true;
|
||||
AppInfo.enableTvEpisodesTab = true;
|
||||
AppInfo.enableMusicSongsTab = true;
|
||||
AppInfo.enableMusicArtistsTab = true;
|
||||
AppInfo.enableHomeLatestTab = true;
|
||||
}
|
||||
}
|
||||
|
||||
function initializeApiClient(apiClient) {
|
||||
|
@ -1339,194 +1507,220 @@ var Dashboard = {
|
|||
.on('serveraddresschanged.dashboard', Dashboard.onApiClientServerAddressChanged);
|
||||
}
|
||||
|
||||
var appName = "Dashboard";
|
||||
var appVersion = window.dashboardVersion;
|
||||
var deviceName = generateDeviceName();
|
||||
var deviceId = MediaBrowser.generateDeviceId();
|
||||
var credentialProvider = new MediaBrowser.CredentialProvider();
|
||||
function createConnectionManager() {
|
||||
|
||||
var capabilities = Dashboard.capabilities();
|
||||
var appInfo = Dashboard.getAppInfo();
|
||||
|
||||
window.ConnectionManager = new MediaBrowser.ConnectionManager(Logger, credentialProvider, appName, appVersion, deviceName, deviceId, capabilities);
|
||||
var credentialProvider = new MediaBrowser.CredentialProvider();
|
||||
|
||||
if (Dashboard.isConnectMode()) {
|
||||
var capabilities = Dashboard.capabilities();
|
||||
|
||||
$(ConnectionManager).on('apiclientcreated', function (e, apiClient) {
|
||||
window.ConnectionManager = new MediaBrowser.ConnectionManager(Logger, credentialProvider, appInfo.appName, appInfo.appVersion, appInfo.deviceName, appInfo.deviceId, capabilities);
|
||||
|
||||
initializeApiClient(apiClient);
|
||||
});
|
||||
if (Dashboard.isConnectMode()) {
|
||||
|
||||
if (!Dashboard.isServerlessPage()) {
|
||||
$(ConnectionManager).on('apiclientcreated', function (e, apiClient) {
|
||||
|
||||
if (Dashboard.serverAddress() && Dashboard.getCurrentUserId() && Dashboard.getAccessToken()) {
|
||||
initializeApiClient(apiClient);
|
||||
});
|
||||
|
||||
window.ApiClient = new MediaBrowser.ApiClient(Logger, Dashboard.serverAddress(), appName, appVersion, deviceName, deviceId);
|
||||
if (!Dashboard.isServerlessPage()) {
|
||||
|
||||
ApiClient.setCurrentUserId(Dashboard.getCurrentUserId(), Dashboard.getAccessToken());
|
||||
if (Dashboard.serverAddress() && Dashboard.getCurrentUserId() && Dashboard.getAccessToken()) {
|
||||
|
||||
initializeApiClient(ApiClient);
|
||||
window.ApiClient = new MediaBrowser.ApiClient(Logger, Dashboard.serverAddress(), appInfo.appName, appInfo.appVersion, appInfo.deviceName, appInfo.deviceId);
|
||||
|
||||
ConnectionManager.addApiClient(ApiClient, true).fail(Dashboard.logout);
|
||||
} else {
|
||||
ApiClient.setCurrentUserId(Dashboard.getCurrentUserId(), Dashboard.getAccessToken());
|
||||
|
||||
Dashboard.logout();
|
||||
return;
|
||||
}
|
||||
}
|
||||
initializeApiClient(ApiClient);
|
||||
|
||||
} else {
|
||||
ConnectionManager.addApiClient(ApiClient, true).fail(Dashboard.logout);
|
||||
|
||||
window.ApiClient = new MediaBrowser.ApiClient(Logger, Dashboard.serverAddress(), appName, appVersion, deviceName, deviceId);
|
||||
} else {
|
||||
|
||||
ApiClient.setCurrentUserId(Dashboard.getCurrentUserId(), Dashboard.getAccessToken());
|
||||
|
||||
initializeApiClient(ApiClient);
|
||||
|
||||
ConnectionManager.addApiClient(ApiClient);
|
||||
}
|
||||
|
||||
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;
|
||||
Dashboard.logout();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
return quality;
|
||||
};
|
||||
}
|
||||
} else {
|
||||
|
||||
})();
|
||||
window.ApiClient = new MediaBrowser.ApiClient(Logger, Dashboard.serverAddress(), appInfo.appName, appInfo.appVersion, appInfo.deviceName, appInfo.deviceId);
|
||||
|
||||
$(function () {
|
||||
ApiClient.setCurrentUserId(Dashboard.getCurrentUserId(), Dashboard.getAccessToken());
|
||||
|
||||
var videoPlayerHtml = '<div id="mediaPlayer" data-theme="b" class="ui-bar-b" style="display: none;">';
|
||||
initializeApiClient(ApiClient);
|
||||
|
||||
videoPlayerHtml += '<div class="videoBackdrop">';
|
||||
videoPlayerHtml += '<div id="videoPlayer">';
|
||||
|
||||
videoPlayerHtml += '<div id="videoElement">';
|
||||
videoPlayerHtml += '<div id="play" class="status"></div>';
|
||||
videoPlayerHtml += '<div id="pause" class="status"></div>';
|
||||
videoPlayerHtml += '</div>';
|
||||
|
||||
videoPlayerHtml += '<div class="videoTopControls hiddenOnIdle">';
|
||||
videoPlayerHtml += '<div class="videoTopControlsLogo"></div>';
|
||||
videoPlayerHtml += '<div class="videoAdvancedControls">';
|
||||
|
||||
videoPlayerHtml += '<button class="mediaButton videoTrackControl previousTrackButton" title="Previous video" type="button" onclick="MediaPlayer.previousTrack();" data-icon="previous-track" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonPreviousTrack') + '</button>';
|
||||
videoPlayerHtml += '<button class="mediaButton videoTrackControl nextTrackButton" title="Next video" type="button" onclick="MediaPlayer.nextTrack();" data-icon="next-track" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonNextTrack') + '</button>';
|
||||
|
||||
videoPlayerHtml += '<button class="mediaButton videoAudioButton" title="Audio tracks" type="button" data-icon="audiocd" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonAudioTracks') + '</button>';
|
||||
videoPlayerHtml += '<div data-role="popup" class="videoAudioPopup videoPlayerPopup" data-history="false" data-theme="b"></div>';
|
||||
|
||||
videoPlayerHtml += '<button class="mediaButton videoSubtitleButton" title="Subtitles" type="button" data-icon="subtitles" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonFullscreen') + '</button>';
|
||||
videoPlayerHtml += '<div data-role="popup" class="videoSubtitlePopup videoPlayerPopup" data-history="false" data-theme="b"></div>';
|
||||
|
||||
videoPlayerHtml += '<button class="mediaButton videoChaptersButton" title="Scenes" type="button" data-icon="video" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonScenes') + '</button>';
|
||||
videoPlayerHtml += '<div data-role="popup" class="videoChaptersPopup videoPlayerPopup" data-history="false" data-theme="b"></div>';
|
||||
|
||||
videoPlayerHtml += '<button class="mediaButton videoQualityButton" title="Quality" type="button" data-icon="gear" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonQuality') + '</button>';
|
||||
videoPlayerHtml += '<div data-role="popup" class="videoQualityPopup videoPlayerPopup" data-history="false" data-theme="b"></div>';
|
||||
|
||||
videoPlayerHtml += '<button class="mediaButton" title="Stop" type="button" onclick="MediaPlayer.stop();" data-icon="delete" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonStop') + '</button>';
|
||||
|
||||
videoPlayerHtml += '</div>'; // videoAdvancedControls
|
||||
videoPlayerHtml += '</div>'; // videoTopControls
|
||||
|
||||
// Create controls
|
||||
videoPlayerHtml += '<div class="videoControls hiddenOnIdle">';
|
||||
|
||||
videoPlayerHtml += '<button id="video-previousTrackButton" class="mediaButton previousTrackButton videoTrackControl" title="Previous Track" type="button" onclick="MediaPlayer.previousTrack();" data-icon="previous-track" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonPreviousTrack') + '</button>';
|
||||
videoPlayerHtml += '<button id="video-playButton" class="mediaButton" title="Play" type="button" onclick="MediaPlayer.unpause();" data-icon="play" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonPlay') + '</button>';
|
||||
videoPlayerHtml += '<button id="video-pauseButton" class="mediaButton" title="Pause" type="button" onclick="MediaPlayer.pause();" data-icon="pause" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonPause') + '</button>';
|
||||
videoPlayerHtml += '<button id="video-nextTrackButton" class="mediaButton nextTrackButton videoTrackControl" title="Next Track" type="button" onclick="MediaPlayer.nextTrack();" data-icon="next-track" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonNextTrack') + '</button>';
|
||||
|
||||
videoPlayerHtml += '<div class="positionSliderContainer sliderContainer">';
|
||||
videoPlayerHtml += '<input type="range" class="mediaSlider positionSlider slider" step=".001" min="0" max="100" value="0" style="display:none;" data-mini="true" data-theme="a" data-highlight="true" />';
|
||||
videoPlayerHtml += '</div>';
|
||||
|
||||
videoPlayerHtml += '<div class="currentTime">--:--</div>';
|
||||
|
||||
videoPlayerHtml += '<div class="nowPlayingInfo hiddenOnIdle">';
|
||||
videoPlayerHtml += '<div class="nowPlayingImage"></div>';
|
||||
videoPlayerHtml += '<div class="nowPlayingText"></div>';
|
||||
videoPlayerHtml += '</div>'; // nowPlayingInfo
|
||||
|
||||
videoPlayerHtml += '<button id="video-muteButton" class="mediaButton muteButton" title="Mute" type="button" onclick="MediaPlayer.mute();" data-icon="audio" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonMute') + '</button>';
|
||||
videoPlayerHtml += '<button id="video-unmuteButton" class="mediaButton unmuteButton" title="Unmute" type="button" onclick="MediaPlayer.unMute();" data-icon="volume-off" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonUnmute') + '</button>';
|
||||
|
||||
videoPlayerHtml += '<div class="volumeSliderContainer sliderContainer">';
|
||||
videoPlayerHtml += '<input type="range" class="mediaSlider volumeSlider slider" step=".05" min="0" max="1" value="0" style="display:none;" data-mini="true" data-theme="a" data-highlight="true" />';
|
||||
videoPlayerHtml += '</div>';
|
||||
|
||||
videoPlayerHtml += '<button onclick="MediaPlayer.toggleFullscreen();" id="video-fullscreenButton" class="mediaButton fullscreenButton" title="Fullscreen" type="button" data-icon="expand" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonFullscreen') + '</button>';
|
||||
|
||||
videoPlayerHtml += '</div>'; // videoControls
|
||||
|
||||
videoPlayerHtml += '</div>'; // videoPlayer
|
||||
videoPlayerHtml += '</div>'; // videoBackdrop
|
||||
videoPlayerHtml += '</div>'; // mediaPlayer
|
||||
|
||||
$(document.body).append(videoPlayerHtml);
|
||||
|
||||
var mediaPlayerElem = $('#mediaPlayer', document.body);
|
||||
mediaPlayerElem.trigger('create');
|
||||
|
||||
var footerHtml = '<div id="footer" data-theme="b" class="ui-bar-b">';
|
||||
|
||||
footerHtml += '<div id="footerNotifications"></div>';
|
||||
footerHtml += '</div>';
|
||||
|
||||
$(document.body).append(footerHtml);
|
||||
|
||||
var footerElem = $('#footer', document.body);
|
||||
footerElem.trigger('create');
|
||||
|
||||
$(window).on("beforeunload", function () {
|
||||
|
||||
var apiClient = ConnectionManager.currentApiClient();
|
||||
|
||||
// Close the connection gracefully when possible
|
||||
if (apiClient && apiClient.isWebSocketOpen() && !MediaPlayer.isPlaying()) {
|
||||
|
||||
console.log('Sending close web socket command');
|
||||
apiClient.closeWebSocket();
|
||||
ConnectionManager.addApiClient(ApiClient);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('contextmenu', '.ui-popup-screen', function (e) {
|
||||
if (window.ApiClient) {
|
||||
ApiClient.getDefaultImageQuality = Dashboard.getDefaultImageQuality;
|
||||
|
||||
$('.ui-popup').popup('close');
|
||||
|
||||
e.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
function isTouchDevice() {
|
||||
return (('ontouchstart' in window)
|
||||
|| (navigator.MaxTouchPoints > 0)
|
||||
|| (navigator.msMaxTouchPoints > 0));
|
||||
Dashboard.importCss(ApiClient.getUrl('Branding/Css'));
|
||||
}
|
||||
}
|
||||
|
||||
if (isTouchDevice()) {
|
||||
$(document.body).addClass('touch');
|
||||
function onReady() {
|
||||
|
||||
//FastClick.attach(document.body);
|
||||
|
||||
if (AppInfo.hasLowImageBandwidth) {
|
||||
$(document.body).addClass('largeCardMargin');
|
||||
}
|
||||
|
||||
if (!AppInfo.enableLatestChannelItems) {
|
||||
$(document.body).addClass('latestChannelItemsDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enableStudioTabs) {
|
||||
$(document.body).addClass('studioTabDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enablePeopleTabs) {
|
||||
$(document.body).addClass('peopleTabDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enableTvEpisodesTab) {
|
||||
$(document.body).addClass('tvEpisodesTabDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enableMusicSongsTab) {
|
||||
$(document.body).addClass('musicSongsTabDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enableMusicArtistsTab) {
|
||||
$(document.body).addClass('musicArtistsTabDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enableHomeLatestTab) {
|
||||
$(document.body).addClass('homeLatestTabDisabled');
|
||||
}
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
$(document).addClass('nativeApp');
|
||||
}
|
||||
|
||||
var videoPlayerHtml = '<div id="mediaPlayer" data-theme="b" class="ui-bar-b" style="display: none;">';
|
||||
|
||||
videoPlayerHtml += '<div class="videoBackdrop">';
|
||||
videoPlayerHtml += '<div id="videoPlayer">';
|
||||
|
||||
videoPlayerHtml += '<div id="videoElement">';
|
||||
videoPlayerHtml += '<div id="play" class="status"></div>';
|
||||
videoPlayerHtml += '<div id="pause" class="status"></div>';
|
||||
videoPlayerHtml += '</div>';
|
||||
|
||||
videoPlayerHtml += '<div class="videoTopControls hiddenOnIdle">';
|
||||
videoPlayerHtml += '<div class="videoTopControlsLogo"></div>';
|
||||
videoPlayerHtml += '<div class="videoAdvancedControls">';
|
||||
|
||||
videoPlayerHtml += '<button class="mediaButton videoTrackControl previousTrackButton imageButton" title="Previous video" type="button" onclick="MediaPlayer.previousTrack();" data-role="none"><i class="fa fa-step-backward"></i></button>';
|
||||
videoPlayerHtml += '<button class="mediaButton videoTrackControl nextTrackButton imageButton" title="Next video" type="button" onclick="MediaPlayer.nextTrack();" data-role="none"><i class="fa fa-step-forward"></i></button>';
|
||||
|
||||
videoPlayerHtml += '<button class="mediaButton videoAudioButton imageButton" title="Audio tracks" type="button" data-role="none"><i class="fa fa-music"></i></button>';
|
||||
videoPlayerHtml += '<div data-role="popup" class="videoAudioPopup videoPlayerPopup" data-history="false" data-theme="b"></div>';
|
||||
|
||||
videoPlayerHtml += '<button class="mediaButton videoSubtitleButton imageButton" title="Subtitles" type="button" data-role="none"><i class="fa fa-text-width"></i></button>';
|
||||
videoPlayerHtml += '<div data-role="popup" class="videoSubtitlePopup videoPlayerPopup" data-history="false" data-theme="b"></div>';
|
||||
|
||||
videoPlayerHtml += '<button class="mediaButton videoChaptersButton imageButton" title="Scenes" type="button" data-role="none"><i class="fa fa-video-camera"></i></button>';
|
||||
videoPlayerHtml += '<div data-role="popup" class="videoChaptersPopup videoPlayerPopup" data-history="false" data-theme="b"></div>';
|
||||
|
||||
videoPlayerHtml += '<button class="mediaButton videoQualityButton imageButton" title="Quality" type="button" data-role="none"><i class="fa fa-gear"></i></button>';
|
||||
videoPlayerHtml += '<div data-role="popup" class="videoQualityPopup videoPlayerPopup" data-history="false" data-theme="b"></div>';
|
||||
|
||||
videoPlayerHtml += '<button class="mediaButton imageButton" title="Stop" type="button" onclick="MediaPlayer.stop();" data-role="none"><i class="fa fa-close"></i></button>';
|
||||
|
||||
videoPlayerHtml += '</div>'; // videoAdvancedControls
|
||||
videoPlayerHtml += '</div>'; // videoTopControls
|
||||
|
||||
// Create controls
|
||||
videoPlayerHtml += '<div class="videoControls hiddenOnIdle">';
|
||||
|
||||
videoPlayerHtml += '<div class="nowPlayingInfo hiddenOnIdle">';
|
||||
videoPlayerHtml += '<div class="nowPlayingImage"></div>';
|
||||
videoPlayerHtml += '<div class="nowPlayingText"></div>';
|
||||
videoPlayerHtml += '</div>'; // nowPlayingInfo
|
||||
|
||||
videoPlayerHtml += '<button id="video-previousTrackButton" class="mediaButton previousTrackButton videoTrackControl imageButton" title="Previous Track" type="button" onclick="MediaPlayer.previousTrack();" data-role="none"><i class="fa fa-step-backward"></i></button>';
|
||||
videoPlayerHtml += '<button id="video-playButton" class="mediaButton imageButton" title="Play" type="button" onclick="MediaPlayer.unpause();" data-role="none"><i class="fa fa-play"></i></button>';
|
||||
videoPlayerHtml += '<button id="video-pauseButton" class="mediaButton imageButton" title="Pause" type="button" onclick="MediaPlayer.pause();" data-role="none"><i class="fa fa-pause"></i></button>';
|
||||
videoPlayerHtml += '<button id="video-nextTrackButton" class="mediaButton nextTrackButton videoTrackControl imageButton" title="Next Track" type="button" onclick="MediaPlayer.nextTrack();" data-role="none"><i class="fa fa-step-forward"></i></button>';
|
||||
|
||||
videoPlayerHtml += '<div class="positionSliderContainer sliderContainer">';
|
||||
videoPlayerHtml += '<input type="range" class="mediaSlider positionSlider slider" step=".001" min="0" max="100" value="0" style="display:none;" data-mini="true" data-theme="a" data-highlight="true" />';
|
||||
videoPlayerHtml += '</div>';
|
||||
|
||||
videoPlayerHtml += '<div class="currentTime">--:--</div>';
|
||||
|
||||
videoPlayerHtml += '<button id="video-muteButton" class="mediaButton muteButton imageButton" title="Mute" type="button" onclick="MediaPlayer.mute();" data-role="none"><i class="fa fa-volume-up"></i></button>';
|
||||
videoPlayerHtml += '<button id="video-unmuteButton" class="mediaButton unmuteButton imageButton" title="Unmute" type="button" onclick="MediaPlayer.unMute();" data-role="none"><i class="fa fa-volume-off"></i></button>';
|
||||
|
||||
videoPlayerHtml += '<div class="volumeSliderContainer sliderContainer">';
|
||||
videoPlayerHtml += '<input type="range" class="mediaSlider volumeSlider slider" step=".05" min="0" max="1" value="0" style="display:none;" data-mini="true" data-theme="a" data-highlight="true" />';
|
||||
videoPlayerHtml += '</div>';
|
||||
|
||||
videoPlayerHtml += '<button onclick="MediaPlayer.toggleFullscreen();" id="video-fullscreenButton" class="mediaButton fullscreenButton imageButton" title="Fullscreen" type="button" data-role="none"><i class="fa fa-expand"></i></button>';
|
||||
|
||||
videoPlayerHtml += '</div>'; // videoControls
|
||||
|
||||
videoPlayerHtml += '</div>'; // videoPlayer
|
||||
videoPlayerHtml += '</div>'; // videoBackdrop
|
||||
videoPlayerHtml += '</div>'; // mediaPlayer
|
||||
|
||||
$(document.body).append(videoPlayerHtml);
|
||||
|
||||
var mediaPlayerElem = $('#mediaPlayer', document.body);
|
||||
mediaPlayerElem.trigger('create');
|
||||
|
||||
var footerHtml = '<div id="footer" data-theme="b" class="ui-bar-b">';
|
||||
|
||||
footerHtml += '<div id="footerNotifications"></div>';
|
||||
footerHtml += '</div>';
|
||||
|
||||
$(document.body).append(footerHtml);
|
||||
|
||||
var footerElem = $('#footer', document.body);
|
||||
footerElem.trigger('create');
|
||||
|
||||
$(window).on("beforeunload", function () {
|
||||
|
||||
var apiClient = ConnectionManager.currentApiClient();
|
||||
|
||||
// Close the connection gracefully when possible
|
||||
if (apiClient && apiClient.isWebSocketOpen() && !MediaPlayer.isPlaying()) {
|
||||
|
||||
console.log('Sending close web socket command');
|
||||
apiClient.closeWebSocket();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('contextmenu', '.ui-popup-screen', function (e) {
|
||||
|
||||
$('.ui-popup').popup('close');
|
||||
|
||||
e.preventDefault();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
setAppInfo();
|
||||
createConnectionManager();
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
|
||||
document.addEventListener("deviceready", function () {
|
||||
|
||||
$(onReady);
|
||||
|
||||
}, false);
|
||||
|
||||
} else {
|
||||
|
||||
$(onReady);
|
||||
}
|
||||
})();
|
||||
|
||||
Dashboard.jQueryMobileInit();
|
||||
|
||||
|
@ -1557,18 +1751,6 @@ $(document).on('pagecreate', ".page", function () {
|
|||
|
||||
var page = $(this);
|
||||
|
||||
var isConnectMode = Dashboard.isConnectMode();
|
||||
|
||||
if (isConnectMode && !page.hasClass('connectLoginPage')) {
|
||||
|
||||
if (!ConnectionManager.isLoggedIntoConnect()) {
|
||||
|
||||
console.log('Not logged into connect. Redirecting to login.');
|
||||
Dashboard.logout();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var apiClient = ConnectionManager.currentApiClient();
|
||||
|
||||
if (Dashboard.getAccessToken() && Dashboard.getCurrentUserId()) {
|
||||
|
@ -1595,6 +1777,16 @@ $(document).on('pagecreate', ".page", function () {
|
|||
|
||||
else {
|
||||
|
||||
var isConnectMode = Dashboard.isConnectMode();
|
||||
|
||||
if (isConnectMode) {
|
||||
|
||||
if (!Dashboard.isServerlessPage()) {
|
||||
Dashboard.logout();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.id !== "loginPage" && !page.hasClass('forgotPasswordPage') && !page.hasClass('wizardPage') && !isConnectMode) {
|
||||
|
||||
console.log('Not logged into server. Redirecting to login.');
|
||||
|
|
|
@ -400,7 +400,9 @@
|
|||
|
||||
var page = this;
|
||||
|
||||
showSyncButtonsPerUser(page);
|
||||
if (!Dashboard.isServerlessPage()) {
|
||||
showSyncButtonsPerUser(page);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
var val = store.getItem('enableThemeSongs-' + userId);
|
||||
|
||||
// For bandwidth
|
||||
return val == '1' || (val != '0' && !$.browser.mobile);
|
||||
return val == '1' || (val != '0' && MediaPlayer.canAutoPlayAudio());
|
||||
}
|
||||
|
||||
function getPlayer() {
|
||||
|
|
|
@ -8,10 +8,14 @@
|
|||
|
||||
var page = this;
|
||||
|
||||
var limit = AppInfo.hasLowImageBandwidth ?
|
||||
20 :
|
||||
30;
|
||||
|
||||
var options = {
|
||||
|
||||
IncludeItemTypes: "Episode",
|
||||
Limit: 30,
|
||||
Limit: limit,
|
||||
Fields: "PrimaryImageAspectRatio,SyncInfo",
|
||||
ParentId: parentId,
|
||||
ImageTypeLimit: 1,
|
||||
|
|
|
@ -2,20 +2,9 @@
|
|||
|
||||
function reload(page) {
|
||||
|
||||
var query = {
|
||||
|
||||
Limit: 24,
|
||||
Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated,SyncInfo",
|
||||
UserId: Dashboard.getCurrentUserId(),
|
||||
ExcludeLocationTypes: "Virtual",
|
||||
ImageTypeLimit: 1,
|
||||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
};
|
||||
|
||||
query.ParentId = LibraryMenu.getTopParentId();
|
||||
var context = '';
|
||||
|
||||
if (query.ParentId) {
|
||||
if (LibraryMenu.getTopParentId()) {
|
||||
|
||||
$('.scopedLibraryViewNav', page).show();
|
||||
$('.globalNav', page).hide();
|
||||
|
@ -37,9 +26,13 @@
|
|||
|
||||
function loadNextUp(page, context) {
|
||||
|
||||
var limit = AppInfo.hasLowImageBandwidth ?
|
||||
18 :
|
||||
24;
|
||||
|
||||
var query = {
|
||||
|
||||
Limit: 24,
|
||||
Limit: limit,
|
||||
Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated,SyncInfo",
|
||||
UserId: Dashboard.getCurrentUserId(),
|
||||
ExcludeLocationTypes: "Virtual",
|
||||
|
|
|
@ -4,9 +4,13 @@
|
|||
|
||||
var page = this;
|
||||
|
||||
var limit = AppInfo.hasLowImageBandwidth ?
|
||||
20 :
|
||||
40;
|
||||
|
||||
var query = {
|
||||
|
||||
Limit: 40,
|
||||
Limit: limit,
|
||||
Fields: "AirTime,UserData,SeriesStudio,SyncInfo",
|
||||
UserId: Dashboard.getCurrentUserId(),
|
||||
ImageTypeLimit: 1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue