There are several button codes for playing audio on the page as follows: how to automatically pause the current audio and other audio?

how can I automatically pause the current audio and other audio when there are multiple buttons to play audio on the

page?

related codes

       <ul>
       
          <li v-for="(item , index) in list" :key="index">
              <audio :src="item.mp3"></audio>
              <span></span>
          </li>

      </ul>
Sep.01,2021

if the playback is current, other stops may be easier to handle. There is only one playback entity on the entire page, and the button controls the audio playback entity to load different content.

of course, your request can also be achieved. You need to enumerate all the audio players on the current page (numbered), then force a pause, and then play the current one, that is, you can't use the default audio playback control button. Instead, you need to customize the corresponding buttons.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b394fa-2c189.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b394fa-2c189.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?