Media player is playing well on Google Assistant while Simulator is not
I implemented simple Media Player on AOG by using MediaResponse
The Media Player can play correctly both side :
Actions on Google
simulator
Google Assistant
on Mobile Phone
Then,
While It able to do these features on Google Assistant
:
Play
Pause
Stop
Resume
Simulator
can not do this (as the image, it always ask me again)
I wonder why?
People who know, help me explain?
p/s :
And, what is difference between pause
and stop
?
On Google Assistant, I saw that they have same feature, it means stop
totally similar with pause
.
MediaPlayerUtils.js
// Library
const
MediaObject,
MediaResponse,
SimpleResponse,
Suggestions
= require('actions-on-google');
class MediaPlayerUtils
getMediaResponse(song)
// This object used to play Media on Google Home
var mediaResponse = new MediaResponse();
mediaResponse.mediaType = "AUDIO";
var mediaObject = new MediaObject(
url: ""
);
mediaObject.name = song.title;
mediaObject.contentUrl = song.url;
mediaResponse.mediaObjects = ;
mediaResponse.mediaObjects.push(mediaObject);
var Media = require('../model/data/Media');
// Media Response : Play audio
return new Media(song, mediaResponse);
playSong(conv, song)
var media = require('../model/data/Media');
media = this.getMediaResponse(song);
console.log("playSong() " + song.title + " " + song.url);
// Media Response : Play audio
conv.ask(new SimpleResponse(" ")); // Able to set song title before playing song in here
conv.ask(media.mediaResponse);
conv.ask(new Suggestions(
"next",
"back",
"previous",
"play",
"pause",
"resume",
"stop"));
conv.ask(new SimpleResponse(""));
;
module.exports = MediaPlayerUtils;
routes.js
'use strict';
const
dialogflow
= require('actions-on-google');
const assistant = dialogflow( debug: true );
const MediaPlayerUtils = require('./util/MediaPlayerUtils');
const mediaPlayer = new MediaPlayerUtils();
module.exports = function (app)
assistant.intent('Default Fallback Intent', (conv) =>
conv.close("Goodbye");
);
assistant.intent('Default Welcome Intent', (conv) =>
var song =
title: "Test",
url: "https://TEST_URL.mp3"
;
console.log("Default Welcome Intent");
mediaPlayer.playSong(conv, song);
);
module.exports.googleHomeActions = assistant;
app.post('/webhook', assistant);
;
Media.js
var Media = function (song, mediaResponse)
this.song = song;
this.mediaResponse = mediaResponse;
module.exports = Media;
node.js dialogflow actions-on-google
add a comment |
I implemented simple Media Player on AOG by using MediaResponse
The Media Player can play correctly both side :
Actions on Google
simulator
Google Assistant
on Mobile Phone
Then,
While It able to do these features on Google Assistant
:
Play
Pause
Stop
Resume
Simulator
can not do this (as the image, it always ask me again)
I wonder why?
People who know, help me explain?
p/s :
And, what is difference between pause
and stop
?
On Google Assistant, I saw that they have same feature, it means stop
totally similar with pause
.
MediaPlayerUtils.js
// Library
const
MediaObject,
MediaResponse,
SimpleResponse,
Suggestions
= require('actions-on-google');
class MediaPlayerUtils
getMediaResponse(song)
// This object used to play Media on Google Home
var mediaResponse = new MediaResponse();
mediaResponse.mediaType = "AUDIO";
var mediaObject = new MediaObject(
url: ""
);
mediaObject.name = song.title;
mediaObject.contentUrl = song.url;
mediaResponse.mediaObjects = ;
mediaResponse.mediaObjects.push(mediaObject);
var Media = require('../model/data/Media');
// Media Response : Play audio
return new Media(song, mediaResponse);
playSong(conv, song)
var media = require('../model/data/Media');
media = this.getMediaResponse(song);
console.log("playSong() " + song.title + " " + song.url);
// Media Response : Play audio
conv.ask(new SimpleResponse(" ")); // Able to set song title before playing song in here
conv.ask(media.mediaResponse);
conv.ask(new Suggestions(
"next",
"back",
"previous",
"play",
"pause",
"resume",
"stop"));
conv.ask(new SimpleResponse(""));
;
module.exports = MediaPlayerUtils;
routes.js
'use strict';
const
dialogflow
= require('actions-on-google');
const assistant = dialogflow( debug: true );
const MediaPlayerUtils = require('./util/MediaPlayerUtils');
const mediaPlayer = new MediaPlayerUtils();
module.exports = function (app)
assistant.intent('Default Fallback Intent', (conv) =>
conv.close("Goodbye");
);
assistant.intent('Default Welcome Intent', (conv) =>
var song =
title: "Test",
url: "https://TEST_URL.mp3"
;
console.log("Default Welcome Intent");
mediaPlayer.playSong(conv, song);
);
module.exports.googleHomeActions = assistant;
app.post('/webhook', assistant);
;
Media.js
var Media = function (song, mediaResponse)
this.song = song;
this.mediaResponse = mediaResponse;
module.exports = Media;
node.js dialogflow actions-on-google
Please file a bug: developers.google.com/actions/support
– Leon Nicholls
Nov 15 '18 at 16:56
I asked them already. As the Docs said : Media responses are supported on Android phones and on Google Home
– Huy Tower
Nov 16 '18 at 2:05
add a comment |
I implemented simple Media Player on AOG by using MediaResponse
The Media Player can play correctly both side :
Actions on Google
simulator
Google Assistant
on Mobile Phone
Then,
While It able to do these features on Google Assistant
:
Play
Pause
Stop
Resume
Simulator
can not do this (as the image, it always ask me again)
I wonder why?
People who know, help me explain?
p/s :
And, what is difference between pause
and stop
?
On Google Assistant, I saw that they have same feature, it means stop
totally similar with pause
.
MediaPlayerUtils.js
// Library
const
MediaObject,
MediaResponse,
SimpleResponse,
Suggestions
= require('actions-on-google');
class MediaPlayerUtils
getMediaResponse(song)
// This object used to play Media on Google Home
var mediaResponse = new MediaResponse();
mediaResponse.mediaType = "AUDIO";
var mediaObject = new MediaObject(
url: ""
);
mediaObject.name = song.title;
mediaObject.contentUrl = song.url;
mediaResponse.mediaObjects = ;
mediaResponse.mediaObjects.push(mediaObject);
var Media = require('../model/data/Media');
// Media Response : Play audio
return new Media(song, mediaResponse);
playSong(conv, song)
var media = require('../model/data/Media');
media = this.getMediaResponse(song);
console.log("playSong() " + song.title + " " + song.url);
// Media Response : Play audio
conv.ask(new SimpleResponse(" ")); // Able to set song title before playing song in here
conv.ask(media.mediaResponse);
conv.ask(new Suggestions(
"next",
"back",
"previous",
"play",
"pause",
"resume",
"stop"));
conv.ask(new SimpleResponse(""));
;
module.exports = MediaPlayerUtils;
routes.js
'use strict';
const
dialogflow
= require('actions-on-google');
const assistant = dialogflow( debug: true );
const MediaPlayerUtils = require('./util/MediaPlayerUtils');
const mediaPlayer = new MediaPlayerUtils();
module.exports = function (app)
assistant.intent('Default Fallback Intent', (conv) =>
conv.close("Goodbye");
);
assistant.intent('Default Welcome Intent', (conv) =>
var song =
title: "Test",
url: "https://TEST_URL.mp3"
;
console.log("Default Welcome Intent");
mediaPlayer.playSong(conv, song);
);
module.exports.googleHomeActions = assistant;
app.post('/webhook', assistant);
;
Media.js
var Media = function (song, mediaResponse)
this.song = song;
this.mediaResponse = mediaResponse;
module.exports = Media;
node.js dialogflow actions-on-google
I implemented simple Media Player on AOG by using MediaResponse
The Media Player can play correctly both side :
Actions on Google
simulator
Google Assistant
on Mobile Phone
Then,
While It able to do these features on Google Assistant
:
Play
Pause
Stop
Resume
Simulator
can not do this (as the image, it always ask me again)
I wonder why?
People who know, help me explain?
p/s :
And, what is difference between pause
and stop
?
On Google Assistant, I saw that they have same feature, it means stop
totally similar with pause
.
MediaPlayerUtils.js
// Library
const
MediaObject,
MediaResponse,
SimpleResponse,
Suggestions
= require('actions-on-google');
class MediaPlayerUtils
getMediaResponse(song)
// This object used to play Media on Google Home
var mediaResponse = new MediaResponse();
mediaResponse.mediaType = "AUDIO";
var mediaObject = new MediaObject(
url: ""
);
mediaObject.name = song.title;
mediaObject.contentUrl = song.url;
mediaResponse.mediaObjects = ;
mediaResponse.mediaObjects.push(mediaObject);
var Media = require('../model/data/Media');
// Media Response : Play audio
return new Media(song, mediaResponse);
playSong(conv, song)
var media = require('../model/data/Media');
media = this.getMediaResponse(song);
console.log("playSong() " + song.title + " " + song.url);
// Media Response : Play audio
conv.ask(new SimpleResponse(" ")); // Able to set song title before playing song in here
conv.ask(media.mediaResponse);
conv.ask(new Suggestions(
"next",
"back",
"previous",
"play",
"pause",
"resume",
"stop"));
conv.ask(new SimpleResponse(""));
;
module.exports = MediaPlayerUtils;
routes.js
'use strict';
const
dialogflow
= require('actions-on-google');
const assistant = dialogflow( debug: true );
const MediaPlayerUtils = require('./util/MediaPlayerUtils');
const mediaPlayer = new MediaPlayerUtils();
module.exports = function (app)
assistant.intent('Default Fallback Intent', (conv) =>
conv.close("Goodbye");
);
assistant.intent('Default Welcome Intent', (conv) =>
var song =
title: "Test",
url: "https://TEST_URL.mp3"
;
console.log("Default Welcome Intent");
mediaPlayer.playSong(conv, song);
);
module.exports.googleHomeActions = assistant;
app.post('/webhook', assistant);
;
Media.js
var Media = function (song, mediaResponse)
this.song = song;
this.mediaResponse = mediaResponse;
module.exports = Media;
node.js dialogflow actions-on-google
node.js dialogflow actions-on-google
edited Nov 15 '18 at 2:50
Huy Tower
asked Nov 14 '18 at 2:41
Huy TowerHuy Tower
3,88694072
3,88694072
Please file a bug: developers.google.com/actions/support
– Leon Nicholls
Nov 15 '18 at 16:56
I asked them already. As the Docs said : Media responses are supported on Android phones and on Google Home
– Huy Tower
Nov 16 '18 at 2:05
add a comment |
Please file a bug: developers.google.com/actions/support
– Leon Nicholls
Nov 15 '18 at 16:56
I asked them already. As the Docs said : Media responses are supported on Android phones and on Google Home
– Huy Tower
Nov 16 '18 at 2:05
Please file a bug: developers.google.com/actions/support
– Leon Nicholls
Nov 15 '18 at 16:56
Please file a bug: developers.google.com/actions/support
– Leon Nicholls
Nov 15 '18 at 16:56
I asked them already. As the Docs said : Media responses are supported on Android phones and on Google Home
– Huy Tower
Nov 16 '18 at 2:05
I asked them already. As the Docs said : Media responses are supported on Android phones and on Google Home
– Huy Tower
Nov 16 '18 at 2:05
add a comment |
1 Answer
1
active
oldest
votes
The codes is correct.
But currently as Docs said : Media responses are supported on Android phones and on Google Home
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53292426%2fmedia-player-is-playing-well-on-google-assistant-while-simulator-is-not%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The codes is correct.
But currently as Docs said : Media responses are supported on Android phones and on Google Home
add a comment |
The codes is correct.
But currently as Docs said : Media responses are supported on Android phones and on Google Home
add a comment |
The codes is correct.
But currently as Docs said : Media responses are supported on Android phones and on Google Home
The codes is correct.
But currently as Docs said : Media responses are supported on Android phones and on Google Home
answered Nov 16 '18 at 2:06
Huy TowerHuy Tower
3,88694072
3,88694072
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53292426%2fmedia-player-is-playing-well-on-google-assistant-while-simulator-is-not%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Please file a bug: developers.google.com/actions/support
– Leon Nicholls
Nov 15 '18 at 16:56
I asked them already. As the Docs said : Media responses are supported on Android phones and on Google Home
– Huy Tower
Nov 16 '18 at 2:05