我已经实现了Alexa音频播放器技能,它可以很好地播放音频,但是当在Echo Show上播放时,歌曲的名称不会显示在显示器上。
我看到亚马逊上的文档(https://amzn.to/2xzpH4u)提到了一个播放指令,其中包括背景图像等MetaData,但我不确定如何在node.js中设置它。
这是我的播放意图处理程序中的代码片段:
if (this.event.request.type === 'IntentRequest' || this.event.request.type === 'LaunchRequest') {
var cardTitle = streamDynamic.subtitle;
var cardContent = streamDynamic.cardContent;
var cardImage = streamDynamic.image;
this.response.cardRenderer(cardTitle, cardContent, cardImage);
}
this.response.speak('Enjoy.').audioPlayerPlay('REPLACE_ALL', streamDynamic.url, streamDynamic.url, null, 0);
this.emit(':responseReady');
发布于 2018-06-04 04:08:46
在If语句中,意味着支持视频呈现,您将为设备上呈现的卡构建元数据的内容。因此,遵循文档cardTitle,内容和图像都必须是您希望设备呈现为卡片的内容。当所有资源都已提供时,您将返回它以在this.response语句中呈现。在亚马逊https://github.com/alexa/skill-sample-nodejs-audio-player/blob/mainline/single-stream/lambda/src/audioAssets.js的示例代码中,请注意卡片资产是如何指定的。遵循这个例子,查看整个项目,寻找您可能遗漏的任何其他部分。
https://stackoverflow.com/questions/50666576
复制相似问题