Restrictions on automatic playback of video\audio tags in each browser

need:

It is now required that if there is an early warning, a global pop-up window will be displayed accompanied by a sound reminder.

background:

 

question:

Most browsers do not support the autoplay function of video\audio. The user and the browser must interact before the sound can be played automatically.

Error:

Uncaught (in promise) DOMException: play() failed because the user didn’t interact with the document first.

Statistics: (mainly audio)

1. QQ browser, Google Chrome, Firefox browser, Opera browser, and Cheetah browser must interact to play.

2. The automatic playback of the IE browser takes effect (but IE11 will be removed from the shelves in 2022.6), and it will be automatically updated to the Microsoft Edge browser. The browser must interact with each other to play

3.360 browser autoplay function is still in effect

Guess you like

Origin blog.csdn.net/weixin_51258044/article/details/125799383