mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
refresh home page after video playback
This commit is contained in:
parent
18037a5943
commit
c651a45dea
@ -249,15 +249,25 @@
|
|||||||
pageIdOn('pageshowready', "indexPage", function () {
|
pageIdOn('pageshowready', "indexPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
$(MediaController).on('playbackstop', onPlaybackStop);
|
||||||
});
|
});
|
||||||
|
|
||||||
pageIdOn('pagebeforehide', "indexPage", function () {
|
pageIdOn('pagebeforehide', "indexPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
$(MediaController).off('playbackstop', onPlaybackStop);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function onPlaybackStop(e, state) {
|
||||||
|
|
||||||
|
if (state.NowPlayingItem && state.NowPlayingItem.MediaType == 'Video') {
|
||||||
|
var page = $($.mobile.activePage)[0];
|
||||||
|
var pages = page.querySelector('neon-animated-pages');
|
||||||
|
|
||||||
|
$(pages).trigger('tabchange');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getDisplayPreferences(key, userId) {
|
function getDisplayPreferences(key, userId) {
|
||||||
|
|
||||||
return ApiClient.getDisplayPreferences(key, userId, AppSettings.displayPreferencesKey()).done(function (result) {
|
return ApiClient.getDisplayPreferences(key, userId, AppSettings.displayPreferencesKey()).done(function (result) {
|
||||||
|
@ -247,8 +247,14 @@
|
|||||||
if (player.isLocalPlayer) {
|
if (player.isLocalPlayer) {
|
||||||
monitorPlayer(player);
|
monitorPlayer(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Events.on(player, 'playbackstop', onPlaybackStop);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function onPlaybackStop(e, state) {
|
||||||
|
$(self).trigger('playbackstop', [state]);
|
||||||
|
}
|
||||||
|
|
||||||
self.getPlayerInfo = function () {
|
self.getPlayerInfo = function () {
|
||||||
|
|
||||||
var player = currentPlayer || {};
|
var player = currentPlayer || {};
|
||||||
|
@ -316,7 +316,7 @@
|
|||||||
window.MoviesPage = window.MoviesPage || {};
|
window.MoviesPage = window.MoviesPage || {};
|
||||||
window.MoviesPage.renderSuggestedTab = loadSuggestionsTab;
|
window.MoviesPage.renderSuggestedTab = loadSuggestionsTab;
|
||||||
|
|
||||||
$(document).on('pageinit', "#moviesPage", function () {
|
pageIdOn('pageinit', "moviesPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
@ -336,8 +336,9 @@
|
|||||||
$(pages).on('tabchange', function () {
|
$(pages).on('tabchange', function () {
|
||||||
loadTab(page, parseInt(this.selected));
|
loadTab(page, parseInt(this.selected));
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
}).on('pageshowready', "#moviesPage", function () {
|
pageIdOn('pageshowready', "moviesPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
@ -360,6 +361,23 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$(MediaController).on('playbackstop', onPlaybackStop);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
pageIdOn('pagebeforehide', "moviesPage", function () {
|
||||||
|
|
||||||
|
var page = this;
|
||||||
|
$(MediaController).off('playbackstop', onPlaybackStop);
|
||||||
|
});
|
||||||
|
|
||||||
|
function onPlaybackStop(e, state) {
|
||||||
|
|
||||||
|
if (state.NowPlayingItem && state.NowPlayingItem.MediaType == 'Video') {
|
||||||
|
var page = $($.mobile.activePage)[0];
|
||||||
|
var pages = page.querySelector('neon-animated-pages');
|
||||||
|
|
||||||
|
$(pages).trigger('tabchange');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
})(jQuery, document);
|
})(jQuery, document);
|
Loading…
Reference in New Issue
Block a user