With help from @AlexSwe I have MediaResponse
working for Action Builder.
Try this code:
this.$googleAction.$audioPlayer.playAudio(
{
name: 'Media name',
description: 'Media description',
url:
'https://storage.googleapis.com/automotive-media/Jazz_In_Paris.mp3',
image: {
large: {
alt: 'Jazz in Paris album art',
height: 0,
url:
'https://storage.googleapis.com/automotive-media/album_art.jpg',
width: 0,
},
},
},
);
this.ask('start audio');
CALLBACK FUNCTIONS
AUDIOPLAYER: {
'GoogleAction.Paused'() {
// no response posible
this.tell('Playback paused');
},
'GoogleAction.Stopped'() {
// no response posible
},
'GoogleAction.Finished'() {
this.tell('Playback finished');
},
'GoogleAction.Failed'() {
this.tell('Playback failed');
},
},
With MediaPlayer beware:
But the behavior is weird sometimes. Some events don’t get called in the simulator.
It’s more of a Google thing. Unfortunately we can’t fix that - @AlexSwe