question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

On Google Home devices MediaObject stops playing after one second

See original GitHub issue

I have an action that automatically loops on a collection of shorts audio tracks (each about 30 secs). The action (same action, same code) on Google Assistant app executed on real smartphone works well, but on Google Home devices it has a strange behavior:

  • first track plays entirely
  • second track stops playing after 1 sec
  • third track plays entirely
  • fourth track stops playing after 1 sec
  • and so on, alternately one track plays entirely and the next one not.

So, is there any difference between the MediaObject on smartphone and the Google Home one? Any hints, please? Thanks

UPDATE sept 2019: The behavior of the Home device got worse over the last week (without changes to the active code): now the first track plays completely, the second stops after a second, the third doesn’t sound at all and the loop stops (crashes?).

SAMPLE CODE:

-> The next track automatically plays at receiving MEDIA_STATUS = FINISHED

app.intent('Media Status', (conv) => {
   const mediaStatus = conv.arguments.get('MEDIA_STATUS');
   if (mediaStatus && mediaStatus.status === 'FINISHED') {
      // Automatically start playing the next track
      nextTrackPower(conv, true, false, datapower);
   } else {
      console.log('Unknown media status received.');
      conv.close(getRandomPrompt(conv, 'error'));
   }
});

-> Then I emit three ask command from nextTrackPower() function (an intro text, in the middle the right MediaObject, finally some suggestion chips)

const nextTrackPower = (conv, intro, backwards, datapower) => {
   // Loops the tracks
	--- OMITTED ---
   // Plays the next track
   trackpower = datapower[conv.user.storage.trackpower - 1];

   // Add a prompt intro
   if (intro) {
      conv.ask(nextPrompt);
   }

   // Create a media response
   conv.ask(new MediaObject({
    name: trackpower.title,
    url: POWER_BASE_URL + trackpower.clip,
    description: trackpower.artist,
    icon: new Image({
      url: POWER_BASE_URL + trackpower.link,
      alt: 'Media icon'
       })
    }));

   // Add suggestions to continue the conversation
     conv.ask(suggestions1 );
};

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Flekercommented, Aug 15, 2019

Can you provide a code sample to reproduce this behavior? Are you jumping from one media response directly into the next one? Are you adding in any simple text responses?

0reactions
GPack1commented, Sep 12, 2019

I added updates about behavior on Home device.

Read more comments on GitHub >

github_iconTop Results From Across the Web

On Google Home devices next MediaObject stops playing ...
UPDATE sept 2019: The behavior of the Home device got worse over the last week (without changes to the active code): now the...
Read more >
Media Stops Playing After a Few Seconds
Start playing to a group and after about 5 seconds it just stops on all of the speakers. I have about 12 devices...
Read more >
How to fix Google Home automatically stopping music after a ...
The easiest way to fix your Google Home or Nest device problem of stopping music after a few seconds is by factory resetting...
Read more >
What to Do When Google Home Stops Playing Music - Lifewire
Reboot Google Home. This should be your first step in fixing sound problems. You can either unplug the device from the wall, wait...
Read more >
Media responses | Conversational Actions - Google Developers
Media responses let your Actions play audio content with a playback ... 0-based index of the first MediaObject in media_objects to play.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found