2

Is there a way to play back a media objects for a specified period using nodejs actions sdk ?

For example in the code below in the code below the file is for 1 minutes and 42 seconds. But suppose I had a file that was 60 minutes long, I want to be able to pass a parameter to the object that will specify the duration of the play back, which would be less than the total duration .

function yourFunctionHandler(agent) {
    let conv = agent.conv();
    conv.ask(new SimpleResponse("Here is a funky Jazz tune"));
    conv.ask(new Suggestions(['suggestion 1', 'suggestion 2']));
    conv.close(new MediaObject({
      name: 'Jazz in Paris',
      url: 'https://storage.googleapis.com/automotive-media/Jazz_In_Paris.mp3',
      description: 'A funky Jazz tune',
      icon: new Image({
        url: 'https://storage.googleapis.com/automotive-media/album_art.jpg',
        alt: 'Media icon',
      }),
    }));   }
Naresh MG
  • 633
  • 2
  • 11
  • 19

1 Answers1

2

No, there is currently no way to limit the playback from a Media Response to a limited time, to specify a start point in the media, or to specify an end point in the media.

Prisoner
  • 49,922
  • 7
  • 53
  • 105
  • Any plans in the pipeline that you are aware of please ? – Naresh MG Dec 27 '18 at 22:54
  • I don't work for Google, so I don't know what is planned. They're always looking at what features would be useful and what the use cases for the features are, so you never know. There are many current issues with Media Responses, so hopefully all of these will be addressed soon. – Prisoner Dec 28 '18 at 02:10
  • [This link](https://developers.google.com/assistant/conversational/prompts-media#MediaResponseProperties) in the doc shows that it's possible but I'm unsure on how to apply that myself in Dialogflow – FrenchMajesty Jun 26 '20 at 01:03
  • @FrenchMajesty - The feature was only recently added, at the same time the Actions Builder was introduced. It may not be available in the older libraries, or may not be available, even if you're sending JSON back. If you have a further question on this, I suggest you open a new Question, showing exactly the code you're using, and describing what you're trying to do. – Prisoner Jun 26 '20 at 02:17
  • @FrenchMajesty if you do open a new question for this as suggested by @ Prisoner then if you could comment and mention the link here that would be great – Naresh MG Jun 26 '20 at 16:51