Created
December 13, 2017 04:38
-
-
Save zephiransas/89558536a76efee2687181d81777772d to your computer and use it in GitHub Desktop.
Alexa Audio Player problem with Promise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let handlers = { | |
'PlayAudio_NG': function() { | |
let get_url = () => { | |
return new Promise((resolve) => { | |
... | |
resolve(url); // S3のObjectのURLを返す | |
}); | |
} | |
let self = this; | |
get_url().then((url) => { | |
self.response.speak('再生します').audioPlayerPlay('REPLACE_ALL', url, url, null, 0); | |
self.emit(':responseReady'); | |
}); | |
}, | |
'PlayAudio_OK': function() { | |
let url = 'https://s3-ap-northeast-1.amazonaws.com/hoge/sample.mp4'; | |
this.response.speak('再生します').audioPlayerPlay('REPLACE_ALL', url, url, null, 0); | |
this.emit(':responseReady'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment