add jump to time v2

This commit is contained in:
Ashley //// 2024-04-11 08:26:47 +00:00
parent d305de04de
commit fdf381c8a5

View file

@ -136,8 +136,17 @@ const videoPlayer = document.getElementById('video');
function time(seconds) { function time(seconds) {
videoPlayer.currentTime = seconds; videoPlayer.currentTime = seconds;
// Add #video to the URL
window.location.hash = 'top';
// Remove #video after a short delay
setTimeout(() => {
history.replaceState(null, null, ' ');
}, 250);
} }
document.addEventListener('click', function(event) { document.addEventListener('click', function(event) {
const clickedElement = event.target; const clickedElement = event.target;