How to two way bind the currentTime of <video> Element with pinia

Hi all,
I’m looking for a way to two-way bind the currentTime of a video to a variable in my pinia store. I’m trying to implement a bookmark functionality, however with my current implementation, the store.currentVideoTime never updates to the actual video position, but only stays at whatever value I last put in myself. (Vue3)

		<source :src="store.currentVideoLink" type="video/mp4" />
setup() {
			const store = useVideosStore()

			return {

I’ve never used the <video> element before, but I doubt it emits an event you can listen to for knowing when the time in the video changes (it changes during all the time it’s playing!), so most likely you must use setInterval() and update the value in your store with a specific interval, for example each second.

You’ll have to listen to the progress event of the video. That said, you’ll be constantly updating your Pinia store which may take a toll on performance.

It may be better to just grab the time when the button is clicked