mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-10 04:48:35 +01:00
Update html/poketube.ejs
This commit is contained in:
parent
7849af14f6
commit
83f24de9dd
1 changed files with 10 additions and 41 deletions
|
@ -617,6 +617,7 @@ background-color: #0000;
|
|||
}
|
||||
|
||||
</style>
|
||||
<script src="/static/videojs-plugin-hotkeys.js?v=508"></script>
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
|
@ -624,51 +625,20 @@ background-color: #0000;
|
|||
controls: true,
|
||||
autoplay: false,
|
||||
preload: 'auto',
|
||||
plugins: {
|
||||
hotkeys: {
|
||||
volumeStep: 0.1,
|
||||
seekStep: 5,
|
||||
enableModifiersForNumbers: false
|
||||
},
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
const qua = new URLSearchParams(window.location.search).get("quality") || "";
|
||||
localStorage.setItem(`progress-${new URLSearchParams(window.location.search).get('v')}`, 0);
|
||||
|
||||
if (qua !== "medium") {
|
||||
|
||||
|
||||
document.addEventListener('keydown', function(event) {
|
||||
if (document.activeElement === video) {
|
||||
// Toggle play/pause with the Spacebar
|
||||
if (event.code === 'Space') {
|
||||
event.preventDefault(); // Prevent default action, like activating buttons
|
||||
if (video.paused) {
|
||||
video.play();
|
||||
} else {
|
||||
video.pause();
|
||||
}
|
||||
}
|
||||
|
||||
// Toggle fullscreen with the F key
|
||||
if (event.code === 'KeyF') {
|
||||
event.preventDefault();
|
||||
if (document.fullscreenElement) {
|
||||
document.exitFullscreen();
|
||||
} else {
|
||||
video.requestFullscreen();
|
||||
}
|
||||
}
|
||||
|
||||
// Toggle mute with the M key
|
||||
if (event.code === 'KeyM') {
|
||||
event.preventDefault();
|
||||
video.muted = !video.muted;
|
||||
}
|
||||
|
||||
// Seeking options with keys 1 to 9
|
||||
if (event.code >= 'Digit1' && event.code <= 'Digit9') {
|
||||
event.preventDefault();
|
||||
const percent = parseInt(event.code.replace('Digit', '')) * 10;
|
||||
const time = (percent / 100) * video.duration;
|
||||
video.currentTime = time;
|
||||
}
|
||||
});
|
||||
}}
|
||||
const audio = document.getElementById('aud');
|
||||
|
||||
// Sync volume between audio and video
|
||||
|
@ -758,7 +728,6 @@ background-color: #0000;
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<% if(dm) { %>
|
||||
|
|
Loading…
Reference in a new issue