This file contains 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
class PlaybackFailureHandler : RequestHandler { | |
override fun canHandle(input: HandlerInput) = | |
input.matches(Predicates.requestType(PlaybackFailedRequest::class.java)) | |
override fun handle(input: HandlerInput): Optional<Response> { | |
val request = input.requestEnvelope.request | |
val intentRequest = request as PlaybackFailedRequest | |
return when (intentRequest.error.type) { |
This file contains 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
class PlaybackStartedHandler : RequestHandler { | |
override fun canHandle(input: HandlerInput) = | |
input.matches(Predicates.requestType(PlaybackStartedRequest::class.java)) | |
override fun handle(input: HandlerInput) = input.responseBuilder.build() | |
} |
This file contains 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
override fun handle(input: HandlerInput) = input.responseBuilder | |
.addAudioPlayerStopDirective() | |
.withShouldEndSession(true) | |
.build() |
This file contains 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
return input.responseBuilder | |
.addAudioPlayerPlayDirective( | |
PlayBehavior.REPLACE_ALL, | |
OL, | |
null, | |
"audioSkill", | |
"https://skill-chistes.s3.[region].amazonaws.com/chiste-[n].mp3" | |
) | |
.build() |
This file contains 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
{ | |
"name": "PlayTheVideoIntent", | |
"slots": [], | |
"samples": [ | |
"pon el video", | |
"reproduce el video", | |
"dale al play" | |
] | |
} |
This file contains 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
{ | |
"body": { | |
"version": "1.0", | |
"response": { | |
"directives": [ | |
{ | |
"type": "AudioPlayer.Play", | |
"playBehavior": "REPLACE_ALL", | |
"audioItem": { | |
"stream": { |
This file contains 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
{ | |
"name": "PlayTheAudioIntent", | |
"slots": [], | |
"samples": [ | |
"pon algo", | |
"pon el audio", | |
"el audio", | |
"algo" | |
] | |
} |
This file contains 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
class NextPageIntentHandler : RequestHandler { | |
override fun canHandle(input: HandlerInput): Boolean { | |
return input.supportAPL() && input.matches(Predicates.intentName("NextPageIntent")) | |
} | |
override fun handle(input: HandlerInput): Optional<Response> { | |
val directive = ExecuteCommandsDirective.builder() | |
.withToken("newReleasesSkillAPLToken") | |
.addCommandsItem(SetPageCommand.builder() | |
.withComponentId("moviesPager") |