question

JDCimino avatar image
JDCimino asked

Is there a way to have a video NOT require the wake work to respond to another intent?

I have been able to write a skill that plays a video successfully. However, after the initial intent video completes, in order to get another video to play, I am required to invoke the wake work, and then say another intent in order to get a subsequent video to play. Is there a way to get the session to continue actively listening after the video completes? Here's a sample of one of my intents:


const MytestIntentHandler = {

canHandle(handlerInput) {

return handlerInput.requestEnvelope.request.type === 'IntentRequest'

&& handlerInput.requestEnvelope.request.intent.name === 'MytestIntent';

},

handle(handlerInput) {

if (supportsDisplay(handlerInput)) {


let backgroundImage = new Alexa.ImageHelper()

.withDescription(TITLE)

.addImageInstance(BACKGROUND_IMAGE_URL)

.getImage();


let primaryText = new Alexa.RichTextContentHelper()

.withPrimaryText(TEXT)

.getTextContent();


let myTemplate = {

type: 'BodyTemplate1',

token: 'Welcome',

backButton: 'HIDDEN',

backgroundImage: backgroundImage,

title: TITLE,

textContent: primaryText,

}


handlerInput.responseBuilder

.addVideoAppLaunchDirective(VIDEO_URL_1, VIDEO_TITLE, VIDEO_SUBTITLE)

.addRenderTemplateDirective(myTemplate)

.withSimpleCard(TITLE, VIDEO_SUBTITLE);


} else {

handlerInput.responseBuilder

.withSimpleCard(TITLE, "This skill requires a device with the ability to play videos.")

.speak("The video cannot be played on your device. To watch this video, try launching this skill from an echo show device.");

}


return handlerInput.responseBuilder

.withShouldEndSession(false)

.getResponse();


},

};

alexa skills kitvideo skill api
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers