fix: resume AudioContext suspendu au onPlay pour activer l'analyse

This commit is contained in:
Michael committed 2026-05-03 22:44:56 +02:00
1 parent c86887f037
commit 1f800c4afc
1 file changed
+6 -1
+6 -1
View File
@@ -249,7 +249,12 @@ export function AudioProvider({ children }: { children: ReactNode }) {
savedPositionRef.current = null;
}
}}
onPlay={() => setIsPlaying(true)}
onPlay={() => {
setIsPlaying(true);
if (webAudioRef.current?.state === 'suspended') {
webAudioRef.current.resume();
}
}}
onPause={() => setIsPlaying(false)}
onEnded={() => setIsPlaying(false)}
onError={handleAudioError}