【发布时间】:2019-06-25 05:04:09
【问题描述】:
我在产品视频自适应卡的模拟器中收到错误“无法渲染卡”。
我正在尝试使用 node.js 在 Microsoft bot 框架 V4 的自适应卡中包含产品视频。下面给出的是用于包含自适应卡的 json。
我已经单独保存了json内容,
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.1",
"fallbackText": "This card requires Media to be viewed. Ask your platform to update to Adaptive Cards v1.1 for this and more!",
"body": [
{
"type": "Media",
"poster": "given the image url which resides in Blobs",
"sources": [
{
"mimeType": "video/mp4",
"url": "given the video url which resides in Blobs"
}
]
}
],
"actions": [
{
"type": "Action.OpenUrl",
"title": "Learn more",
"url": "https://adaptivecards.io"
}
]
}
node.js 代码
const { CardFactory } = require('botbuilder');
const productContentPath = '/path/to/json/content';
await turnContext.sendActivity({
text: 'Product Video',
attachments: [CardFactory.adaptiveCard([productContentPath])]
});
我不知道代码有什么问题,是权限问题还是其他问题。我什至无法在模拟器中进行测试。json 示例的文档来自以下链接。 https://adaptivecards.io/samples/ProductVideo.html
【问题讨论】:
标签: node.js visual-studio-code botframework