Solve the audio control and report domexception: the play() request was interrupted by a call to pause in the chrome console

When using the audio control, the play() request will be interrupted by pause

The specific solutions are as follows:

Before judging whether the audio is playing, the load () method should be called to load the audio data;

Then the audio is judged by if, and then the playback or pause is processed asynchronously

Play or pause after successful callback, depending on business requirements;

Read More: