Media Response
Learn how to use the Google Action Media Response with Jovo.
Introduction
The Google Action Media Response allows you to play audio content, which is longer than the 240 seconds SSML limit. While using the Media Response, you lose control of the play
, pause
, stop
and start over
commands, since Google handles these themselves, without your app even receiving the request.
You can access the Media Response features in two ways:
You can check out the official documentation here.
Features
Play a File
Google Conversational Actions expect a MediaResponse object, which will be shown inside a media card:
Optionally, you can also provide an array of media response objects to playAudio()
.
To send the response, you can use either this.tell()
or this.ask()
, which have both different use cases.
If you use this.tell()
it will be handled as a final response and you won't receive a callback regarding the media status.
this.ask()
on the other hand will keep the session open, so you can receive the callback, but it forces you to add Suggestion Chips to your response.
Media Progress
If you want to access the current progress of the media playback, use getProgress()
:
Directives
During or after the media plays, your Jovo app can receive the media status as a directive, which have to be placed in either the 'MEDIARESPONSE'
or the 'AUDIOPLAYER'
directive of your handler.