title: What function can be used to keep playing audio after current one is done
body: <p>I am trying to play the next song in a playlist/album after the current one has finished playing. I was able to get a song to play but it does not move to the next one after the current one finish playing.</p>
  <p>Here is my code:</p>
  <pre><code>&lt;button class=&quot;controlButton play&quot; title=&quot;Play&quot; @click=&quot;play&quot; v-if=&quot;!isPlaying&quot;&gt;
     &lt;img src=&quot;storage/icons/play.png&quot; alt=&quot;Play&quot;&gt;
  &lt;/button&gt;
  &lt;button class=&quot;controlButton pause&quot; title=&quot;Pause&quot; @click=&quot;pause&quot; v-else&gt;
     &lt;img src=&quot;storage/icons/pause.png&quot; alt=&quot;Pause&quot;&gt;
  &lt;/button&gt;
  </code></pre>
  <pre><code>&lt;script&gt;
  import { Link } from &quot;@inertiajs/inertia-vue3&quot;;
  export default {
      components: {
          Link
      },
      data() {
          return {
              audio: new Audio(),
              currentSong: {},
              myWidth: 0,
              loop:{},
              index: 0,
              songs: [
                  {
                      title: 'Song',
                      artist: 'Artis A',
                      src: '/storage/audio/song.mp3',
                      cover: '/storage/images/cover.jpeg',
                  },
                  {
                      title: 'Song 2',
                      artist: 'Artis B',
                      src: '/storage/audio/song2.mp3',
                      cover: '/storage/images/cover2.jpeg',
                  },
   mounted() {
          this.currentSong = this.songs[this.index];
  },
  methods: {
  play(song) {
              if(typeof song.src != 'undefined') {
                  this.currentSong = song;
                  this.audio.src = this.currentSong.src
  
              }
              this.audio.play();
              this.isPlaying = true
              this.activeItem = this.currentSong
          },
   pause() {
              this.audio.pause();
              this.isPlaying = false;
          },
  }
  </code></pre>
  <p>How can i get the second song to play after the current has finished and also change the button back to play when there is no song left.</p>