mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 10:58:20 -07:00
Add delay on play/pause to prevent hiccup when entering fullscreen
Resolves: #589
This commit is contained in:
parent
0d0f210c6a
commit
1225800e7e
@ -1230,6 +1230,9 @@ define(["playbackManager", "dom", "inputManager", "datetime", "itemHelper", "med
|
|||||||
shell.disableFullscreen();
|
shell.disableFullscreen();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if(playerPauseClickTimeout) {
|
||||||
|
clearTimeout(playerPauseClickTimeout);
|
||||||
|
}
|
||||||
var player = currentPlayer;
|
var player = currentPlayer;
|
||||||
view.removeEventListener("viewbeforehide", onViewHideStopPlayback);
|
view.removeEventListener("viewbeforehide", onViewHideStopPlayback);
|
||||||
releaseCurrentPlayer();
|
releaseCurrentPlayer();
|
||||||
@ -1369,6 +1372,7 @@ define(["playbackManager", "dom", "inputManager", "datetime", "itemHelper", "med
|
|||||||
destroySubtitleSync();
|
destroySubtitleSync();
|
||||||
});
|
});
|
||||||
var lastPointerDown = 0;
|
var lastPointerDown = 0;
|
||||||
|
let playerPauseClickTimeout;
|
||||||
dom.addEventListener(view, window.PointerEvent ? "pointerdown" : "click", function (e) {
|
dom.addEventListener(view, window.PointerEvent ? "pointerdown" : "click", function (e) {
|
||||||
if (dom.parentWithClass(e.target, ["videoOsdBottom", "upNextContainer"])) {
|
if (dom.parentWithClass(e.target, ["videoOsdBottom", "upNextContainer"])) {
|
||||||
return void showOsd();
|
return void showOsd();
|
||||||
@ -1388,8 +1392,16 @@ define(["playbackManager", "dom", "inputManager", "datetime", "itemHelper", "med
|
|||||||
|
|
||||||
case "mouse":
|
case "mouse":
|
||||||
if (!e.button) {
|
if (!e.button) {
|
||||||
playbackManager.playPause(currentPlayer);
|
if(playerPauseClickTimeout){
|
||||||
showOsd();
|
clearTimeout(playerPauseClickTimeout);
|
||||||
|
playerPauseClickTimeout = 0;
|
||||||
|
} else {
|
||||||
|
playerPauseClickTimeout = setTimeout(() => {
|
||||||
|
playbackManager.playPause(currentPlayer);
|
||||||
|
showOsd();
|
||||||
|
playerPauseClickTimeout = 0;
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user