alexa-js / alexa-app

A framework for Alexa (Amazon Echo) apps using Node.js
https://www.youtube.com/watch?v=pzM4jv7k7Rg
MIT License
1.03k stars 212 forks source link

app.playbackController is not a function. #365

Open getmohanraj95 opened 6 years ago

getmohanraj95 commented 6 years ago

When i use this

app.playbackController('NextCommandIssued', (request, response) => {
  var stream = {
    "url": "https://next-song-url",
    "token": "some_token",
    "expectedPreviousToken": "some_previous_token",
    "offsetInMilliseconds": 0
  };
  response.audioPlayerPlayStream("REPLACE_ALL", stream);
});

i receive this error =app.playbackController is not a function.

can any one help me out from this.

fremail commented 5 years ago

@getmohanraj95 I suppose you don't construct Alexa.app object before calling app.playbackController.

You have to do something like this:


var Alexa = require('alexa-app');
var app = new Alexa.app('MySkill');

app.playbackController('NextCommandIssued', (request, response) => {
    // ...
});```