balsimpson / alexa-radio

Alexa Radio Skill that lets you add your favourite streaming stations using a web page
https://balsimpson.github.io/alexa-radio/
58 stars 47 forks source link

When stating "Alexa, play next" there is sometimes an error after a couple of times #15

Open jctennis opened 4 years ago

jctennis commented 4 years ago

When I ask Alexa to "Play Next" to choose a different random station sometimes it fails. Here is an excerpt from the log when it happens.

nextIntentHandler : {"version":"1.0","response":{"outputSpeech":{"type":"SSML","ssml":" Next up is Alloy Underground "},"directives":[{"type":"AudioPlayer.Play","playBehavior":"REPLACE_ALL","audioItem":{"stream":{"url":"https://radio.streemlion.com:3465/stream","token":"Alloy Underground:Alloy Radio","offsetInMilliseconds":"2584"},"metadata":{"title":"Alloy Underground","subtitle":"Alloy Radio","art":{"sources":[{"url":"https://alloyradio.api.stdlib.com/alloy-radio@dev/assets?asset=station"}]},"backgroundImage":{"sources":[{"url":"https://alloyradio.api.stdlib.com/alloy-radio@dev/assets?asset=background"}]}}}}]}} type AudioPlayer.PlaybackStarted audioPlayerEventName: PlaybackStarted type AudioPlayer.PlaybackNearlyFinished audioPlayerEventName: PlaybackNearlyFinished item: { url: 'https://radio.streemlion.com:1625/stream', name: 'Alloy Extreme', index: 1, token: 'Alloy Extreme:Alloy Radio', status: 'streamable', channel: 'Alloy Radio', progress: 3496 } type AudioPlayer.PlaybackStopped audioPlayerEventName: PlaybackStopped type IntentRequest intentName: NextIntent item: { url: 'https://radio.streemlion.com:3465/stream', name: 'Alloy Underground', index: 5, token: 'Alloy Underground:Alloy Radio', status: 'streamable', channel: 'Alloy Radio', progress: 4336 } nextIntentHandler : {"version":"1.0","response":{"outputSpeech":{"type":"SSML","ssml":" Next up is Alloy Underground "},"directives":[{"type":"AudioPlayer.Play","playBehavior":"REPLACE_ALL","audioItem":{"stream":{"url":"https://radio.streemlion.com:3465/stream","token":"Alloy Underground:Alloy Radio","offsetInMilliseconds":"4336"},"metadata":{"title":"Alloy Underground","subtitle":"Alloy Radio","art":{"sources":[{"url":"https://alloyradio.api.stdlib.com/alloy-radio@dev/assets?asset=station"}]},"backgroundImage":{"sources":[{"url":"https://alloyradio.api.stdlib.com/alloy-radio@dev/assets?asset=background"}]}}}}]}} type AudioPlayer.PlaybackStarted audioPlayerEventName: PlaybackStarted type AudioPlayer.PlaybackNearlyFinished audioPlayerEventName: PlaybackNearlyFinished item: { url: 'https://radio.streemlion.com:1625/stream', name: 'Alloy Extreme', index: 1, token: 'Alloy Extreme:Alloy Radio', status: 'streamable', channel: 'Alloy Radio', progress: 3496 } type AudioPlayer.PlaybackStopped audioPlayerEventName: PlaybackStopped type IntentRequest intentName: NextIntent item: undefined nextIntentHandler : {"version":"1.0","response":{"outputSpeech":{"type":"SSML","ssml":" There is nothing to play next. "}}} type AudioPlayer.PlaybackStarted audioPlayerEventName: PlaybackStarted type AudioPlayer.PlaybackStopped audioPlayerEventName: PlaybackStopped type IntentRequest intentName: PreviousIntent type AudioPlayer.PlaybackStarted audioPlayerEventName: PlaybackStarted type AudioPlayer.PlaybackStopped audioPlayerEventName: PlaybackStopped type AudioPlayer.PlaybackStarted audioPlayerEventName: PlaybackStarted type AudioPlayer.PlaybackStopped audioPlayerEventName: PlaybackStopped type LaunchRequest type AudioPlayer.PlaybackStopped audioPlayerEventName: PlaybackStopped type AudioPlayer.PlaybackStarted audioPlayerEventName: PlaybackStarted type AudioPlayer.PlaybackNearlyFinished audioPlayerEventName: PlaybackNearlyFinished item: { url: 'https://radio.streemlion.com:1625/stream', name: 'Alloy Extreme', index: 1, token: 'Alloy Extreme:Alloy Radio', status: 'streamable', channel: 'Alloy Radio', progress: 3496 } type AudioPlayer.PlaybackStopped audioPlayerEventName: PlaybackStopped type IntentRequest intentName: NextIntent item: { url: 'https://radio.streemlion.com:1625/stream', name: 'Alloy Extreme', index: 1, token: 'Alloy Extreme:Alloy Radio', status: 'streamable', channel: 'Alloy Radio', progress: 3496 } nextIntentHandler : {"version":"1.0","response":{"outputSpeech":{"type":"SSML","ssml":" Next up is Alloy Extreme "},"directives":[{"type":"AudioPlayer.Play","playBehavior":"REPLACE_ALL","audioItem":{"stream":{"url":"https://radio.streemlion.com:1625/stream","token":"Alloy Extreme:Alloy Radio","offsetInMilliseconds":"3496"},"metadata":{"title":"Alloy Extreme","subtitle":"Alloy Radio","art":{"sources":[{"url":"https://alloyradio.api.stdlib.com/alloy-radio@dev/assets?asset=station"}]},"backgroundImage":{"sources":[{"url":"https://alloyradio.api.stdlib.com/alloy-radio@dev/assets?asset=background"}]}}}}]}} type AudioPlayer.PlaybackStopped audioPlayerEventName: PlaybackStopped type AudioPlayer.PlaybackStarted audioPlayerEventName: PlaybackStarted type AudioPlayer.PlaybackNearlyFinished audioPlayerEventName: PlaybackNearlyFinished item: { url: 'https://radio.streemlion.com:1565/stream', name: 'Alloy Alt', status: 'unplayed', channel: 'Alloy Radio' } type AudioPlayer.PlaybackStopped audioPlayerEventName: PlaybackStopped type IntentRequest intentName: NextIntent item: { url: 'https://radio.streemlion.com:1565/stream', name: 'Alloy Alt', status: 'unplayed', channel: 'Alloy Radio' } nextIntentHandler : {"version":"1.0","response":{"outputSpeech":{"type":"SSML","ssml":" Next up is Alloy Alt "},"directives":[{"type":"AudioPlayer.Play","playBehavior":"REPLACE_ALL","audioItem":{"stream":{"url":"https://radio.streemlion.com:1565/stream","token":" ","offsetInMilliseconds":"0"},"metadata":{"art":{"sources":[{"url":"https://alloyradio.api.stdlib.com/alloy-radio@dev/assets?asset=station"}]},"backgroundImage":{"sources":[{"url":"https://alloyradio.api.stdlib.com/alloy-radio@dev/assets?asset=background"}]}}}}]}} type AudioPlayer.PlaybackStopped audioPlayerEventName: PlaybackStopped type AudioPlayer.PlaybackStarted audioPlayerEventName: PlaybackStarted type AudioPlayer.PlaybackNearlyFinished audioPlayerEventName: PlaybackNearlyFinished random item: Cannot set property 'index' of undefined resObjError: TypeError: Cannot read property 'replace' of undefined at /var/task/functions/alexa.js:366:19 at Collection.next (/var/task/functions/alexa.js:292:23) at AudioPlayerEventHandler (/var/task/functions/alexa.js:662:32) at module.exports (/var/task/functions/alexa.js:785:26) at runMicrotasks ( ) at processTicksAndRejections (internal/process/task_queues.js:93:5) type System.ExceptionEncountered random item: Cannot set property 'index' of undefined type AudioPlayer.PlaybackStopped audioPlayerEventName: PlaybackStopped type IntentRequest intentName: NextIntent nextError: TypeError: Cannot read property 'replace' of undefined at /var/task/functions/alexa.js:366:19 at Collection.next (/var/task/functions/alexa.js:292:23) at NextIntentHandler (/var/task/functions/alexa.js:554:32) at IntentRequestHandler (/var/task/functions/alexa.js:465:18) at module.exports (/var/task/functions/alexa.js:787:26) at runMicrotasks ( ) at processTicksAndRejections (internal/process/task_queues.js:93:5) type AudioPlayer.PlaybackStarted audioPlayerEventName: PlaybackStarted type AudioPlayer.PlaybackNearlyFinished audioPlayerEventName: PlaybackNearlyFinished random item: Cannot set property 'index' of undefined resObjError: TypeError: Cannot read property 'replace' of undefined at /var/task/functions/alexa.js:366:19 at Collection.next (/var/task/functions/alexa.js:292:23) at AudioPlayerEventHandler (/var/task/functions/alexa.js:662:32) at module.exports (/var/task/functions/alexa.js:785:26) at runMicrotasks ( ) at processTicksAndRejections (internal/process/task_queues.js:93:5) type System.ExceptionEncountered random item: Cannot set property 'index' of undefined

balsimpson commented 4 years ago

Am not sure why that is happening. Are you still getting the same error?