jovotech / jovo-framework

🔈 The React for Voice and Chat: Build Apps for Alexa, Messenger, Instagram, the Web, and more
https://www.jovo.tech
Apache License 2.0
1.67k stars 310 forks source link

Resuming a song #46

Closed timmyg closed 6 years ago

timmyg commented 6 years ago

First off - LOVE this framework and what you're doing with it - hoping I can contribute.

I am playing a song with

// play
app
  .alexaSkill()
  .audioPlayer()
  .setOffsetInMilliseconds(0)
  .play(url, alexaToken)
  .tell(speech);

which works great, but my app got declined because I need to handle the Pause and Resume amazon intents. Below is how I am pausing:

// pause
app
  .alexaSkill()
  .audioPlayer()
  .stop();
app.tell("paused");

Is there a current way to resume? Am looking through audioPlayer.js and not seeing anything.

Thanks!

jankoenig commented 6 years ago

Thank you for the kind words!

Here's how I'm doing it:

Does this help?

timmyg commented 6 years ago

Actually - may have figured it out - would I just use the setOffsetInMilliseconds and play it again?

jankoenig commented 6 years ago

Yes!

timmyg commented 6 years ago

yep this worked for me. thanks 👍