Skip to content

Conversation

mlopezr
Copy link

@mlopezr mlopezr commented Nov 25, 2019

Issue #, if available:

If users say "Alexa, stop" when AudioPlayer was last used by a custom skill, that skill will receive an AMAZON.StopIntent request, even if audio is not playing any more.

Before giving a goodbye message, a custom skill needs to check whether it is currently playing audio.

Description of changes:

When audio is currently playing, context in the intent request looks like:

  "context": {
    "AudioPlayer": {
      "offsetInMilliseconds": 21264,
      "token": "https://example.com/stream/",
      "playerActivity": "PLAYING"
    },

Here's what context looks like if playback is already stopped:

  "context": {
    "AudioPlayer": {
      "offsetInMilliseconds": 21264,
      "token": "https://example.com/stream/",
      "playerActivity": "STOPPED"
    },

I have added checks for StopIntent and PauseIntent for both single-stream and multiple-stream, with unit tests.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ghost
Copy link

ghost commented May 19, 2020

Hello! I don't understand why this is bad:

"If users say "Alexa, stop" when AudioPlayer was last used by a custom skill, that skill will receive an AMAZON.StopIntent request, even if audio is not playing any more."

I added your code, but now I have problems where I can never stop playing. Is it correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant