从Alexa中需要标题的外部来源播放媒体

问题描述 投票:0回答:1

我正在开发一个Alexa技能,我需要播放我将从自己的API获取的媒体。

根据documentation,我必须向Alexa发送要播放的媒体网址:

{
  "version": "1.0",
  "sessionAttributes": {},
  "response": {
    "outputSpeech": {},
    "card": {},
    "reprompt": {},
    "shouldEndSession": true,
    "directives": [
      {
        "type": "AudioPlayer.Play",
        "playBehavior": "ENQUEUE",
        "audioItem": {
          "stream": {
            "url": "https://cdn.example.com/url-of-the-mp3-to-play/audiofile.mp3",
            "token": "1234AAAABBBBCCCCCDDDDEEEEEFFFF",
            "expectedPreviousToken": "9876ZZZZZZZYYYYYYYYYXXXXXXXXXXX",
            "offsetInMilliseconds": 0
          },
          "metadata": {
            "title": "My opinion: how could you diss-a-brie?",
            "subtitle": "Vince Fontana",
            "art": {
              "sources": [
                {
                  "url": "https://cdn.example.com/url-of-the-skill-image/brie-album-art.png"
                }
              ]
            },
            "backgroundImage": {
              "sources": [
                {
                  "url": "https://cdn.example.com/url-of-the-skill-image/brie-background.png"
                }
              ]
            }
          }
        }
      }
    ]
  }
}

事情是:

我的API需要Authorization标头,Alexa似乎只获取我在url中传递的源,我如何指示Alexa在请求中插入Authorization标头?

amazon-web-services authentication alexa
1个回答
0
投票

在与AWS Alexa团队联系后,他们澄清说:

使用AudioPlayer播放的音频文件必须托管在端口443上可通过Internet访问的HTTPS端点上 - 目前不支持授权,如下面的audioItem.stream.url文档:https://developer.amazon.com/docs/custom-skills/audioplayer-interface-reference.html#play-params

所以在此期间,我们不能使用需要授权的音频文件。

© www.soinside.com 2019 - 2024. All rights reserved.