alexa-skills-kitjovo-frameworkalexa-presentation-language

Jovo Alexa video onEnd event?


I'm trying to play a video using Jovo and Alexa's new APL. The problem I'm running into is that the Alexa docs say that they you can listen to an onEnd event, but it doesn't seem to be firing?

https://developer.amazon.com/docs/alexa-presentation-language/apl-video.html#on-end

const handler = {

  ON_REQUEST()
  {
    console.log("Not Getting Here");
  },

  ON_ELEMENT_SELECTED()
  {
    console.log("not getting here either");
  }
}

here's what my APL document looks like

{
    "type": "APL",
    "version": "1.0",
    "theme": "dark",
    "import": [],
    "resources": [],
    "styles": {},
    "layouts": {
        "videoContainer": {
            "item": [
                {
                    "type": "Container",
                    "width": "100%",
                    "height": "100%",
                    "direction": "column",
                    "items": [
                        {
                            "type": "Video",
                            "source": "https://myUrl/SampleVideo_1280x720.mp4",
                            "autoplay": true,
                            "width": "100%",
                            "height": "100%",
                            "onEnd": [
                                {
                                    "type": "SendEvent",
                                    "arguments": [
                                        "work?"
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    },
    "mainTemplate": {
        "item": [
            {
                "type": "videoContainer"
            }
        ]
    }
}

The video also hangs at the end, seemingly until the skill times out? I'm not sure if that's how Alexa's APL handles video or maybe is a symptom of the problem.

any help is greatly appreciated!

EDIT: This is how it's implemented in Jovo, which is why I think that the APL doc is probably the problem. https://github.com/jovotech/jovo-framework/blob/5544dc587c8c344a133e1a4b2cb659b4319954b4/jovo-integrations/jovo-platform-alexa/src/modules/Display.ts#L154


Solution

  • As discussed in an issue on the Jovo Framework GitHub Repository, it is necessary to use this.ask instead of this.tell when sending out the response so that the session does not close.

    Learn more about sessions in the Jovo Docs.