You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When rapidly switching between Play and Pause states in the audio player, the following issues are observed:
The PlayerState transitions multiple times incorrectly.
The timer (progress) value resets to 0 unexpectedly or behaves incorrectly.
Logs frequently show EVENT values as 0, which disrupts the expected progress tracking.
<Pressable onPress={() => onStartPlay()} hitSlop={30}>
<Icon
bald
name={
playerState === PlayerState.playing
? "fa-solid fa-pause"
: "fas fa-play"
}
fill={styles.scrubColor.color}
width={12}
height={16}
/>
</Pressable>
<Waveform
ref={ref}
path={`${pathAudio.path}`}
key={pathAudio.path}
candleSpace={2}
candleWidth={2}
containerStyle={styles.containerStyle}
playbackSpeed={1}
waveColor={styles.waveColor.color}
scrubColor={styles.scrubColor.color}
mode={"static"}
candleHeightScale={26}
onPanStateChange={() => {
playerState === PlayerState.stopped ? true : false
}}
onPlayerStateChange={(state: PlayerState) => {
console.log("Player State Changed:", state)
if (state === PlayerState.stopped) {
console.log("Progress reset to 0 because player stopped.")
}
setPlayerState(state)
}}
onError={(error) => {
console.log(error, "Error in wavefrom")
}}
onChangeWaveform
https://github.com/user-attachments/assets/404ff169-a8e1-44ec-b692-6e42f807b6ea
LoadState={(state) => {
console.log("Loading...", state)
}}
onCurrentProgressChange={(event) => {
console.log("====================================")
console.log("EVENT", event)
console.log("====================================")
setTimer(event)
}}
/>
async function onStartPlay() {
if (!ref.current) return
ref.current.startPlayer({ finishMode: FinishMode.stop })
if (playerState === PlayerState.playing) {
await ref.current.pausePlayer()
} else {
await ref.current.resumePlayer()
}
}
LOG Player State Changed: playing
LOG ====================================
LOG EVENT 5124
LOG ====================================
LOG Player State Changed: paused
LOG ====================================
LOG EVENT 0
LOG ====================================
LOG Player State Changed: playing
LOG ====================================
LOG EVENT 5253
LOG ====================================
The text was updated successfully, but these errors were encountered:
FILE.2025-01-03.21.31.28.mp4
FILE.2025-01-03.21.31.29.mp4
When rapidly switching between Play and Pause states in the audio player, the following issues are observed:
The PlayerState transitions multiple times incorrectly.
The timer (progress) value resets to 0 unexpectedly or behaves incorrectly.
Logs frequently show EVENT values as 0, which disrupts the expected progress tracking.
The text was updated successfully, but these errors were encountered: