Jovo Alexa视频onEnd事件?

时间:2019-02-05 02:40:31

标签: alexa jovo-framework alexa-presentation-language

我正在尝试使用Jovo和Alexa的新APL播放视频。我遇到的问题是Alexa文档说他们可以听一个onEnd事件,但是似乎没有触发?

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");
  }
}

这是我的APL文档的样子

{
    "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"
            }
        ]
    }
}

视频也最终挂起,似乎直到技能超时? 我不确定这是Alexa的APL处理视频的方式还是该问题的症状。

任何帮助将不胜感激!

编辑:这就是在Jovo中实现的方式,这就是为什么我认为APL文档可能是问题所在。 https://github.com/jovotech/jovo-framework/blob/5544dc587c8c344a133e1a4b2cb659b4319954b4/jovo-integrations/jovo-platform-alexa/src/modules/Display.ts#L154

1 个答案:

答案 0 :(得分:1)

Jovo Framework GitHub Repository的问题中所述,在发送响应时,有必要使用this.ask而不是this.tell,以使会话不会关闭。

Learn more about sessions in the Jovo Docs