mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Media player fixes
* Fix for hidden audio player * Fullscreen hover fix
This commit is contained in:
parent
b5b21349f9
commit
2131f0f895
4 changed files with 64 additions and 5 deletions
|
@ -18,8 +18,8 @@
|
|||
var timeout;
|
||||
var video;
|
||||
var culturesPromise;
|
||||
var idleState = true;
|
||||
var fullscreenExited = false;
|
||||
var idleState = true;
|
||||
|
||||
self.initVideoPlayer = function () {
|
||||
video = playVideo(item, startPosition, user);
|
||||
|
@ -50,6 +50,8 @@
|
|||
|
||||
var nowPlayingBar = $("#nowPlayingBar", mediaPlayer);
|
||||
|
||||
footer.css("top", null);
|
||||
|
||||
mediaElement.html(""); // remove play/pause
|
||||
|
||||
mediaPlayer.hide().append(nowPlayingBar); // put elements back where they belong
|
||||
|
@ -61,6 +63,11 @@
|
|||
footer.hide();
|
||||
|
||||
}
|
||||
|
||||
$("html").css("cursor", "default");
|
||||
|
||||
$(".ui-loader").hide();
|
||||
|
||||
};
|
||||
|
||||
self.exitFullScreen = function() {
|
||||
|
@ -146,9 +153,13 @@
|
|||
|
||||
$(document).on('webkitfullscreenchange mozfullscreenchange fullscreenchange', function () {
|
||||
var nowPlayingBar = $('#nowPlayingBar');
|
||||
|
||||
$('.itemVideo').off('mousemove keydown scroll', idleHandler);
|
||||
|
||||
if (self.isFullScreen()) {
|
||||
enterFullScreen();
|
||||
idleState = true;
|
||||
$('.itemVideo').on('mousemove keydown scroll', idleHandler).trigger('mousemove');
|
||||
} else {
|
||||
nowPlayingBar.removeClass("highPosition");
|
||||
exitFullScreenToWindow();
|
||||
|
@ -205,8 +216,36 @@
|
|||
|
||||
hideFlyout($('#qualityFlyout'));
|
||||
});
|
||||
|
||||
$("#footer").on("mousemove", "#videoPlayer.fullscreenVideo #itemVideo", function () {
|
||||
|
||||
idleHandler(this);
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
function idleHandler() {
|
||||
var video = $(".itemVideo");
|
||||
var nowPlayingBar = $("#nowPlayingBar");
|
||||
|
||||
if (timeout) {
|
||||
window.clearTimeout(timeout);
|
||||
}
|
||||
|
||||
if (idleState == true) {
|
||||
video.removeClass("cursor-inactive").addClass("cursor-active");
|
||||
nowPlayingBar.removeClass("inactive").addClass("active");
|
||||
}
|
||||
|
||||
idleState = false;
|
||||
|
||||
timeout = window.setTimeout(function () {
|
||||
idleState = true;
|
||||
video.removeClass("cursor-active").addClass("cursor-inactive");
|
||||
nowPlayingBar.removeClass("active").addClass("inactive");
|
||||
}, 4000);
|
||||
}
|
||||
|
||||
function requestFullScreen(element) {
|
||||
// Supports most browsers and their versions.
|
||||
var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue