mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-26 05:38:58 +01:00
fix stuff :3
This commit is contained in:
parent
adbf2784fc
commit
8dfaf532d8
1 changed files with 86 additions and 75 deletions
|
@ -679,8 +679,6 @@ background-color: #0000;
|
||||||
audio.pause();
|
audio.pause();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
video.on('seeking', handleSeek);
|
video.on('seeking', handleSeek);
|
||||||
|
|
||||||
video.on('seeked', () => {
|
video.on('seeked', () => {
|
||||||
|
@ -699,8 +697,21 @@ background-color: #0000;
|
||||||
audio.pause();
|
audio.pause();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Initial synchronization
|
||||||
|
const syncAtStart = () => {
|
||||||
|
if (video.readyState() >= 3 && audio.readyState >= 3) { // Check if both video and audio are ready
|
||||||
|
audio.currentTime = video.currentTime();
|
||||||
|
video.play();
|
||||||
|
audio.play();
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
|
||||||
|
video.on('canplay', syncAtStart);
|
||||||
|
audio.addEventListener('canplay', syncAtStart);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue