mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge 9c390c978e
into 7d84185d0e
This commit is contained in:
commit
a6c01cdfe4
2 changed files with 38 additions and 2 deletions
|
@ -96,6 +96,7 @@
|
||||||
- [K. Kyle Puchkov](https://github.com/kepper104)
|
- [K. Kyle Puchkov](https://github.com/kepper104)
|
||||||
- [ItsAllAboutTheCode](https://github.com/ItsAllAboutTheCode)
|
- [ItsAllAboutTheCode](https://github.com/ItsAllAboutTheCode)
|
||||||
- [Jxiced](https://github.com/Jxiced)
|
- [Jxiced](https://github.com/Jxiced)
|
||||||
|
- [Ale4224](https://github.com/Ale4224)
|
||||||
|
|
||||||
## Emby Contributors
|
## Emby Contributors
|
||||||
|
|
||||||
|
|
|
@ -1214,6 +1214,10 @@ export default function (view) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let spaceKeyTimeout;
|
||||||
|
let isSpaceKeyDown = false;
|
||||||
|
let isSpaceKeyHeld = false;
|
||||||
|
|
||||||
function onKeyDown(e) {
|
function onKeyDown(e) {
|
||||||
clickedElement = e.target;
|
clickedElement = e.target;
|
||||||
|
|
||||||
|
@ -1228,8 +1232,16 @@ export default function (view) {
|
||||||
|
|
||||||
if (e.keyCode === 32) {
|
if (e.keyCode === 32) {
|
||||||
if (e.target.tagName !== 'BUTTON' || !layoutManager.tv) {
|
if (e.target.tagName !== 'BUTTON' || !layoutManager.tv) {
|
||||||
playbackManager.playPause(currentPlayer);
|
if (!isSpaceKeyDown) {
|
||||||
showOsd(btnPlayPause);
|
isSpaceKeyDown = true;
|
||||||
|
isSpaceKeyHeld = false;
|
||||||
|
|
||||||
|
spaceKeyTimeout = setTimeout(() => {
|
||||||
|
isSpaceKeyHeld = true;
|
||||||
|
playbackManager.setPlaybackRate(2, currentPlayer);
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
// Trick Firefox with a null element to skip next click
|
// Trick Firefox with a null element to skip next click
|
||||||
|
@ -1430,6 +1442,27 @@ export default function (view) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onKeyUp(e) {
|
||||||
|
if (e.keyCode === 32) {
|
||||||
|
if (isSpaceKeyDown) {
|
||||||
|
if (isSpaceKeyHeld) {
|
||||||
|
playbackManager.setPlaybackRate(1, currentPlayer);
|
||||||
|
} else {
|
||||||
|
playbackManager.playPause(currentPlayer);
|
||||||
|
showOsd(osdBottomElement.querySelector('.btnPause'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (spaceKeyTimeout) {
|
||||||
|
clearTimeout(spaceKeyTimeout);
|
||||||
|
spaceKeyTimeout = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
isSpaceKeyDown = false;
|
||||||
|
isSpaceKeyHeld = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function onKeyDownCapture() {
|
function onKeyDownCapture() {
|
||||||
resetIdle();
|
resetIdle();
|
||||||
}
|
}
|
||||||
|
@ -1680,6 +1713,7 @@ export default function (view) {
|
||||||
showOsd();
|
showOsd();
|
||||||
inputManager.on(window, onInputCommand);
|
inputManager.on(window, onInputCommand);
|
||||||
document.addEventListener('keydown', onKeyDown);
|
document.addEventListener('keydown', onKeyDown);
|
||||||
|
document.addEventListener('keyup', onKeyUp);
|
||||||
dom.addEventListener(document, 'keydown', onKeyDownCapture, {
|
dom.addEventListener(document, 'keydown', onKeyDownCapture, {
|
||||||
capture: true,
|
capture: true,
|
||||||
passive: true
|
passive: true
|
||||||
|
@ -1723,6 +1757,7 @@ export default function (view) {
|
||||||
}
|
}
|
||||||
|
|
||||||
document.removeEventListener('keydown', onKeyDown);
|
document.removeEventListener('keydown', onKeyDown);
|
||||||
|
document.removeEventListener('keyup', onKeyUp);
|
||||||
dom.removeEventListener(document, 'keydown', onKeyDownCapture, {
|
dom.removeEventListener(document, 'keydown', onKeyDownCapture, {
|
||||||
capture: true,
|
capture: true,
|
||||||
passive: true
|
passive: true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue