【问题标题】:Alexa Presentation Language Image not displayingAlexa 演示语言图像未显示
【发布时间】:2021-11-07 15:23:31
【问题描述】:

无论是使用 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)和其他选项,但此图像和许多其他图像根本不会显示.

【问题讨论】:

    标签: image alexa alexa-presentation-language


    【解决方案1】:

    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 服务器返回的标头。可能不得不代理它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多