Skip to content

Commit

Permalink
remove unstable onSeeked event handler
Browse files Browse the repository at this point in the history
  • Loading branch information
culdo committed Jan 4, 2025
1 parent b903d3e commit 79e3496
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions app/components/control-bar/audio-player/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,6 @@ function AudioPlayer() {
useGlobalStore.setState({ enabledTransform: true })
}

const lastTimeRef = useRef(currentTime)
const onSeeked = (e: SyntheticEvent<HTMLVideoElement, Event>) => {
if(!loadedRef.current) return
if(Math.abs(ytPlayer.current.currentTime - lastTimeRef.current) > 1.0) {
setCurrentTime(ytPlayer.current.currentTime);
}
lastTimeRef.current = ytPlayer.current.currentTime
}

const loadedRef = useRef(false)
const onLoadedMetadata = (e: SyntheticEvent<HTMLVideoElement, Event>) => {
loadedRef.current = false
Expand Down Expand Up @@ -127,7 +118,6 @@ function AudioPlayer() {
src={gui.ytUrl}
onPlay={onPlay}
onPause={onPause}
onSeeked={onSeeked}
onLoadedMetadata={onLoadedMetadata}
muted
></YoutubeVideo>
Expand Down

0 comments on commit 79e3496

Please sign in to comment.