1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

add fetch timeout

This commit is contained in:
Luke Pulverenti 2015-12-06 23:57:04 -05:00
parent 7c3fa06651
commit ba5afc0ae2
14 changed files with 98 additions and 41 deletions

View file

@ -781,7 +781,10 @@
self.endSession = function () {
castPlayer.stopApp();
self.stop();
setTimeout(function () {
castPlayer.stopApp();
}, 1000);
};
self.volumeUp = function () {

View file

@ -167,7 +167,7 @@
function playInternalPostMediaSourceSelection(item, mediaSource, startPosition, deferred) {
Dashboard.hideModalLoadingMsg();
Dashboard.hideLoadingMsg();
currentItem = item;
currentMediaSource = mediaSource;

View file

@ -644,7 +644,7 @@
}
function enableScrollX() {
return browserInfo.mobile && AppInfo.enableAppLayouts;
return browserInfo.mobile && AppInfo.enableAppLayouts && screen.availWidth <= 1000;
}
function getPortraitShape() {
@ -899,7 +899,7 @@
html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: getPortraitShape(),
showTitle: false,
showTitle: true,
centerText: true,
lazy: true
});

View file

@ -3260,6 +3260,11 @@
}
var img = elem.querySelector('img');
img.onload = function () {
if (img.src.indexOf('empty.png') == -1) {
img.classList.add('loaded');
}
};
ImageLoader.lazyImage(img, url);
},

View file

@ -763,10 +763,9 @@
curr.addEventListener('click', onCardClick);
if (AppInfo.isTouchPreferred) {
curr.removeEventListener('contextmenu', disableEvent);
curr.addEventListener('contextmenu', disableEvent);
//this.off('contextmenu', onContextMenu);
//this.on('contextmenu', onContextMenu);
}
else {
curr.removeEventListener('contextmenu', onContextMenu);
@ -820,6 +819,7 @@
hammertime.on('press', onTapHold);
hammertime.on('pressup', onTapHoldUp);
});
showTapHoldHelp(element);
}
@ -863,9 +863,16 @@
showSelections(card);
if (s.stopPropagation) {
e.stopPropagation();
}
e.preventDefault();
e.stopPropagation();
return false;
}
e.preventDefault();
e.stopPropagation();
return false;
}
function onTapHoldUp(e) {

View file

@ -272,7 +272,7 @@
var userAtTop = showUserAtTop();
var homeHref = window.ApiClient ? 'index.html' : 'selectserver.html';
var homeHref = window.ApiClient ? 'index.html' : 'selectserver.html?showuser=1';
var hasUserImage = user.imageUrl && AppInfo.enableUserImage;
@ -376,7 +376,7 @@
html += '<a class="sidebarLink lnkMediaFolder lnkMySync" data-itemid="mysync" onclick="return LibraryMenu.onLinkClicked(event, this);" href="mysync.html"><iron-icon icon="sync" class="sidebarLinkIcon"></iron-icon><span class="sidebarLinkText">' + Globalize.translate('ButtonSync') + '</span></a>';
if (Dashboard.isConnectMode()) {
html += '<a class="sidebarLink lnkMediaFolder" data-itemid="selectserver" onclick="return LibraryMenu.onLinkClicked(event, this);" href="selectserver.html"><iron-icon icon="wifi" class="sidebarLinkIcon"></iron-icon><span class="sidebarLinkText">' + Globalize.translate('ButtonSelectServer') + '</span></a>';
html += '<a class="sidebarLink lnkMediaFolder" data-itemid="selectserver" onclick="return LibraryMenu.onLinkClicked(event, this);" href="selectserver.html?showuser=1"><iron-icon icon="wifi" class="sidebarLinkIcon"></iron-icon><span class="sidebarLinkText">' + Globalize.translate('ButtonSelectServer') + '</span></a>';
}
if (showUserAtTop()) {
@ -790,7 +790,7 @@
}
}
pageClassOn('pageinit', 'page', function () {
pageClassOn('pagebeforeshow', 'page', function () {
var page = this;

View file

@ -845,7 +845,7 @@
if (firstItem.MediaType === "Video") {
Dashboard.showModalLoadingMsg();
Dashboard.showLoadingMsg();
}
if (options.startPositionTicks || firstItem.MediaType !== 'Video' || !AppSettings.enableCinemaMode()) {
@ -1064,7 +1064,7 @@
}
if (item.IsPlaceHolder) {
Dashboard.hideModalLoadingMsg();
Dashboard.hideLoadingMsg();
MediaController.showPlaybackInfoErrorMessage('PlaceHolder');
return;
}
@ -1073,7 +1073,7 @@
if (item.MediaType == 'Video' && AppSettings.enableAutomaticBitrateDetection() && (new Date().getTime() - (self.lastBitrateDetections[bitrateDetectionKey] || 0)) > 300000) {
Dashboard.showModalLoadingMsg();
Dashboard.showLoadingMsg();
ApiClient.detectBitrate().then(function (bitrate) {
Logger.log('Max bitrate auto detected to ' + bitrate);
@ -1096,7 +1096,7 @@
if (item.MediaType === "Video") {
Dashboard.showModalLoadingMsg();
Dashboard.showLoadingMsg();
}
MediaController.getPlaybackInfo(item.Id, deviceProfile, startPosition).then(function (playbackInfoResult) {
@ -1122,7 +1122,7 @@
callback(mediaSource);
}
} else {
Dashboard.hideModalLoadingMsg();
Dashboard.hideLoadingMsg();
MediaController.showPlaybackInfoErrorMessage('NoCompatibleStream');
}
});
@ -1140,7 +1140,7 @@
function playInternalPostMediaSourceSelection(item, mediaSource, startPosition, callback) {
Dashboard.hideModalLoadingMsg();
Dashboard.hideLoadingMsg();
self.currentMediaSource = mediaSource;
self.currentItem = item;

View file

@ -334,24 +334,24 @@
function updatePageStyle(page) {
if (ConnectionManager.isLoggedIntoConnect()) {
if (getParameterByName('showuser') == '1') {
$(page).addClass('libraryPage').addClass('noSecondaryNavPage').removeClass('standalonePage');
} else {
$(page).removeClass('libraryPage').removeClass('noSecondaryNavPage').addClass('standalonePage');
}
}
$(document).on('pageinit pagebeforeshow', "#selectServerPage", function () {
pageIdOn('pagebeforeshow', "selectServerPage", function () {
var page = this;
updatePageStyle(page);
});
}).on('pageshow', "#selectServerPage", function () {
pageIdOn('pageshow', "selectServerPage", function () {
var page = this;
loadPage(page);
});
})();

View file

@ -1757,7 +1757,7 @@ var AppInfo = {};
function initRequire() {
var urlArgs = "v=" + window.dashboardVersion;
var urlArgs = "v=" + (window.dashboardVersion || new Date().getDate());
var paths = {
velocity: "bower_components/velocity/velocity.min",
@ -2209,7 +2209,7 @@ var AppInfo = {};
postInitDependencies.push('scripts/nowplayingbar');
}
//postInitDependencies.push('components/testermessage');
postInitDependencies.push('components/testermessage');
require(postInitDependencies);
});