angular-media-player
angular-media-player copied to clipboard
Playback fails if attempted immediately after setting playlist
Playback seems to fail when I try to set a playlist and play it in one action. It works fine if the playlist is set when the page loads, and then playback started later. It also works on subsequent playlist changes / playback attempts. It only fails when the initial playlist is set and played in one action.
Scenario 1: User visits page. When the user clicks play, the playlist is set and playback started. FAILS.
Scenario 2: User visit page and playlist is set in advance. User clicks play to start playback. WORKS.
This is important in an app where the user is browsing various playlist pages (e.g. album pages), but I do not want to change the playlist until the user clicks play.
I'm currently using a hacky workaround, but hopefully there is a simple bug that can be fixed.
This issue is definitely related to those lines
I have to check if and how the $timeout
could be removed, probably I've to chain the events, it's not super-complicated but not super-easy either.
So that's one of those cases when I know where the problem might be, but a PR would make me smile any day :grin: