Hi,
I am trying to create a skill using alexa presentation language directive. I want to start playing video immediately after the launch request. The session is still alive even after video starts playing. I am able to see the blue line under my echo show device while video starts playing. So if I say something then it's trying to search for that word which I say. I thought repromt was the reason for my session still alive so I comment reprompt and added withShouldEndSession(false), but then also the issue is not solving.
I could also see that The video starts playing immediately even before the speak activity is completed fully. Before the speak activity is finished, in the middle of speech my video starts playing.
My Launch Request code
const LaunchRequestHandler = { canHandle(handlerInput) { return handlerInput.requestEnvelope.request.type ==='LaunchRequest'; }, handle(handlerInput) { const speechText ='Welcome to the rivet video list. Here's your news!';
let selectedIndex =0;
SELECTED_NEWS = NewsList;
SELECTED_NEWS.name ="Demo Video";
const attributesManager = handlerInput.attributesManager; const sessionAttributes = attributesManager.getSessionAttributes();
sessionAttributes.newsName = SELECTED_NEWS.name;
sessionAttributes.newsLength = (SELECTED_NEWS.list.length-1);
sessionAttributes.isFirstNews =true;
sessionAttributes.isLasttNews =false;
sessionAttributes.newsNumber =0;
sessionAttributes.selectedIndex =0;
attributesManager.setSessionAttributes(sessionAttributes);
return handlerInput.responseBuilder
.speak(speechText)
// .reprompt("")
.withShouldEndSession(false)
.addDirective({
type: 'Alexa.Presentation.APL.RenderDocument',
token: "homepage",
document: require('./launchReq.json'),
datasources: {
"newsListData": {
"properties": {
"backgroundImg": "https://s3.amazonaws.com/apl-community-code/drinks/barbackground.jpg", "selectedDrink": SELECTED_NEWS.list,
"name": SELECTED_NEWS.name,
"current":sessionAttributes.newsNumber
}} } })
.getResponse();
}, };