Solve the problem of audio hidden and not automatically played under the Apple Safari browser - real-time voice call function [only customer service]

If we want to hide the default audio controls, but still want to play the sound automatically

When audiothe element is set to ordisplay: none , the audio will still be loaded, but will not autoplayvisibility: hidden

This is because the browser marks the audio element as "invisible" in this case, preventing autoplay

Instead of using or , you can use opacityattributes or etc.position: absolute; left: -9999px; for styling .display: nonevisibility: hidden

This ensures that the audio element is loaded correctly and can be played automatically

Guess you like

Origin blog.csdn.net/taoshihan/article/details/129434832