Skip to content

Commit

Permalink
test proposed workaround to add HTTP headers to audio stream request
Browse files Browse the repository at this point in the history
  • Loading branch information
warren-bank committed Mar 25, 2023
1 parent c49b865 commit cc616b0
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion lambda/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const PlayAudioIntentHandler = {
const playBehavior = 'REPLACE_ALL';
const podcastUrl = 'https://192.168.0.102/audio_track.mp3';

return handlerInput.responseBuilder
const response = handlerInput.responseBuilder
.speak(speakOutput)
.addAudioPlayerPlayDirective(
playBehavior,
Expand All @@ -49,6 +49,21 @@ const PlayAudioIntentHandler = {
playbackInfo.offsetInMilliseconds
)
.getResponse();

if (response.directives) {
response.directives.forEach(directive => {
if (directive.type === 'AudioPlayer.Play') {
directive.audioItem.stream.httpHeaders = {
"all": [{
"name": "X-Alexa-Issue",
"value": "https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/issues/610#issuecomment-1483729767"
}]
}
}
})
}

return response;
}
};

Expand Down

0 comments on commit cc616b0

Please sign in to comment.