mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 10:58:20 -07:00
Merge pull request #787 from YouKnowBlom/player-pause-fix
Add delay on play/pause to prevent hiccup when entering/exiting fullscreen
This commit is contained in:
commit
b3fa02cbc1
@ -1218,12 +1218,14 @@ define(["playbackManager", "dom", "inputManager", "datetime", "itemHelper", "med
|
||||
return null;
|
||||
}
|
||||
|
||||
let playPauseClickTimeout;
|
||||
function onViewHideStopPlayback() {
|
||||
if (playbackManager.isPlayingVideo()) {
|
||||
require(['shell'], function (shell) {
|
||||
shell.disableFullscreen();
|
||||
});
|
||||
|
||||
clearTimeout(playPauseClickTimeout);
|
||||
var player = currentPlayer;
|
||||
view.removeEventListener("viewbeforehide", onViewHideStopPlayback);
|
||||
releaseCurrentPlayer();
|
||||
@ -1382,8 +1384,16 @@ define(["playbackManager", "dom", "inputManager", "datetime", "itemHelper", "med
|
||||
|
||||
case "mouse":
|
||||
if (!e.button) {
|
||||
playbackManager.playPause(currentPlayer);
|
||||
showOsd();
|
||||
if (playPauseClickTimeout) {
|
||||
clearTimeout(playPauseClickTimeout);
|
||||
playPauseClickTimeout = 0;
|
||||
} else {
|
||||
playPauseClickTimeout = setTimeout(() => {
|
||||
playbackManager.playPause(currentPlayer);
|
||||
showOsd();
|
||||
playPauseClickTimeout = 0;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user