reactjs – There is no sound when playing HTML5 AUDIO in IOS17
export function AudioPlaying(audioUrl: string): ReactElement {
const audioRef = useRef<HTMLAudioElement>();
useEffect(() => {
audioRef.current = new Audio(audioUrl);
}, [audioUrl]);
const onPlayAudio = () => {
audioRef.current.play();
};
return (
<>
<button onClick={onPlayAudio}>click</button>
</>
);
}
The above example is simple, but the code with a similar behavior does not play when playing from IOS17. Is there a report on the issue?
Read more here: Source link