Skip to content

Commit

Permalink
play next song
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed Sep 1, 2024
1 parent 792078a commit 3613fb6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/javascript/controllers/audio_player_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ export default class extends Controller {

// Initialize halfway tracking
this.hasHalfwayEventFired = false;

// Listen for the 'ended' event to play the next song
this.audio.addEventListener("ended", this.nextSong.bind(this));
}

autoPlay() {
Expand Down

0 comments on commit 3613fb6

Please sign in to comment.