Skip to content

Commit

Permalink
fix player at start
Browse files Browse the repository at this point in the history
  • Loading branch information
culdo committed Jan 3, 2025
1 parent 1e3e570 commit 6030273
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/components/control-bar/audio-player/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ function AudioPlayer() {
const onPause = (e: SyntheticEvent<HTMLVideoElement, Event>) => {
console.log("onPause")
if(!loadedRef.current) {
if(currentTime == 0.0) {
ytPlayer.current.currentTime = 0.0
}
ytPlayer.current.api.unMute()
loadedRef.current = true
return
Expand All @@ -69,8 +72,7 @@ function AudioPlayer() {
const onLoadedMetadata = (e: SyntheticEvent<HTMLVideoElement, Event>) => {
loadedRef.current = false
if(currentTime == 0.0) {
ytPlayer.current.currentTime = 0.1
ytPlayer.current.currentTime = 0.0
ytPlayer.current.currentTime = 1.0
} else {
ytPlayer.current.currentTime = currentTime
}
Expand Down

0 comments on commit 6030273

Please sign in to comment.