Google vs. Alexa handler.js


I’m starting to think about bringing up the Google version of my application, which is structurally based on the podcast player sample.

I’d like to have the behavior be as similar as possible between the platforms.

Toward that end: The example’s google/handler.js is much simpler than the Alexa equivalent, and in particular doesn’t handle equivalents of PauseIntent, StartOverIntent (which I added support for), or the PlaybackStopped or PlaybackFailed events.

Most of these I can add as user-defined intents, I think. But I think I need something like PlaybackStopped so I can accurately set the “bookmark” for resuming playback where we left off.

Any advice on the best way to do this?

(By the way: I presume you were using Amazon.PlaybackNearlyFinished to enqueue the next episode as a way of preloading it in the buffer to try to reduce delay between episodes. Amazon says PlaybackNearlyFinished is deprecated, and in fact on my hardware fires that event right after PlaybackStarted. I’m still using it because PlaybackStarted doesn’t seem to be willing to let me issue the enqueue request… but I’m wondering if it would make sense instead to emulate your Google solution and move the advance-to-next logic into PlaybackFinished, just in case Nearly Finished does go away in a future release of the Alexa APIs. Opinions?)

((Obviously, in the long term anything more you can do to hide the differences between platforms so we can avoid having to explicitly replicate logic would be wonderful.))