I am developing an Alexa audio player skill (using the java sdk). That skill has a playlist of several tracks. When one track is nearly finished the skill enqueues the next track of the list in response to the PlaybackNearlyFinishedRequest. But the enqueued track is randomly not played. I tested it over and over again and these are my observations:
- sometime the playback stops after the first song
- in all cases where the second track is successfully starts after the first one finishes all following tracks of the playlist are successfully enqueued
- my logs show that the onPlaybackNearlyFinished() method is always called and therefore the next track is enqueued
- my logs show that onPlaybackFinished() is always called at the end of each track that is played
I am pretty sure that the enqueuing actually works even when Alexa stops playing the playlist and this is why:
When Alexa stops playing after the first song I say "Alexa weiter" ("Alexa continue" or whatever the english utterance is in this case). Alexa is then asking "What would you like to play next?" When I respond with "Stop" it plays the previously enqueued song. When that song is finished I can again see the onPlaybackNearlyFinished() and onPlaybackFinished() calls in the logs. But in no case it would continue playing the third song.
I have no idea why this works with the word "Stop" but it seems all quite strange.
Playlist navigation "Next" and "Previous" work without any problems.