Skip to content

Commit

Permalink
Pause normal playback when switching to playlist player. Fixes sudara…
Browse files Browse the repository at this point in the history
  • Loading branch information
sudara committed Feb 22, 2022
1 parent c508dff commit c496c00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/javascript/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ function handlers() {
Bugsnag.notify(`MP3 Playback Error: ${data.code} ${data.message} ${data.filename}`)
},
})
} else {
// transitioning to a playlist player, we'll need to pause
playlist && playlist.reset()
}

document.querySelectorAll('.slide_open_href').forEach((link) => {
Expand Down
1 change: 1 addition & 0 deletions app/javascript/controllers/normal_playback_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export default class extends PlaybackController {
// turbolinks caches pages, so let's make sure things are sane when we return
disconnect() {
super.disconnect()

if (this.animation) {
this.animation.reset()
}
Expand Down

0 comments on commit c496c00

Please sign in to comment.