我正在尝试使用 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