0

无论是使用 Alexa 设备还是 Alexa 控制台( https://developer.amazon.com/alexa/console/ask/displays#/templates ) ,我都只能显示某些图像:

例如,这有效:

{
    "type": "APL",
    "version": "1.8",
    "license": "",
    "import": [
        {
            "name": "alexa-layouts",
            "version": "1.4.0"
        }
    ],
    "mainTemplate": {
        "parameters": [
            "payload"
        ],
        "items": [
            {
                "type": "AlexaImage",
                "imageSource": "https://d2o906d8ln7ui1.cloudfront.net/images/MollyforBT7.png"
            }
        ]
    }
}

但这不起作用:

{
    "type": "APL",
    "version": "1.8",
    "license": "",
    "import": [
        {
            "name": "alexa-layouts",
            "version": "1.4.0"
        }
    ],
    "mainTemplate": {
        "parameters": [
            "payload"
        ],
        "items": [
            {
                "type": "AlexaImage",
                "imageSource": "https://www.solopianoradio.com/apps/alexa/wspr_logo_512.png"
            }
        ]
    }
}

我尝试更改类型(“AlexaDetail”、“Image”、“AlexaImage”)、高度、宽度、比例、图像类型(png 与 jpg)和其他选项,但此图像和许多其他图像根本不会显示。

4

1 回答 1

0

Alexa 开发人员支持团队的回应是,托管文件的站点必须在返回的标头中包含“AllwedOrigins”作为“*”和“AllowedMethods”作为“GET”。请参阅(https://developer.amazon.com/en-US/docs/alexa/alexa-presentation-language/apl-support-for-your-skill.html#support-cors

这很棘手,因为我的技能是使用 iTunes API,而且我无法控制从 iTunes 服务器返回的标头。可能将不得不代理它。

于 2021-11-09T16:41:20.630 回答