Templates Plugins Courses

How do you reset time to zero in Audio Player plugin

Two problems I am having with the Audio Player plugin (which is otherwise brilliant).

  1. How do I get the player to be visible even if there’s no file selected yet.

  2. If a file is playing and the using clicks NEXT, and there isn’t another track how do I get the time to go back to be being 0. At the moment it just keeps the previous audio still loaded, so if the user hit play again it would play the previous track, whereas it should really play nothing and show the start and end times as zero.

Thanks for helping with this.

Hi @Siddhartha,

Thanks for reaching out and your feedback.

Unfortunately, it is not possible with our plugin. It is only visible when you indicate the source. Perhaps we’ll consider this point as future possibility for improvement, if feasible. :pray:

This is a custom implementation question. Meaning, this functionality would have to be implemented if you will. I’m afraid I cannot offer exact solutions on this matter, but you can use plugin’s Set To Position action (in seconds):

image

And perhaps plugin’s state:

image

To set your conditions so when the last song of your playlist is ended, you set the time to 0.

Hope it helps and thanks for understanding.

Best,
Alex

1 Like

Thanks for the help Alex. Much appreciated.

I’m having a bit of trouble getting it to go to the next song. I have a date type called ‘Playlist’ and the player loads and plays the first file on that list perfectly.

When someone clicks Next, the workflow needs to take them to do four things:

  1. Stop playing the current file
  2. Load the next file from the data type ‘Playlist’
  3. Start playing the next file
  4. Delete the first entry in the data type ‘Playlist’

All of this sounds straight forward, but try as I might I just can’t get the next file to play. I can get it to load. I can see the total time (ie. the figure on the right of the player) has changed. But it just sits there waiting for the user to hit the play button.

What am I doing wrong?

Hi @Siddhartha,

Thanks for feedback. I think your setup is an overkill a bit. You can simply use plugin’s Play next action and the plugin will take care of it, so you don’t have to manually set the logic to stop the current file, load the next file and then start playing the next file.

Please check our demo how it is set up, so you can replicate on your side as well if you will. :pray:

And if you want to specifically delete the previous file, you can do it with Bubble’s delete logic.

Best,

Hi Alexandru,

You were right. I revisited it and did it the way you suggested and it works great. Just one question.

I have a cover image for each of the tracks in the playlist (that actually comes from the album field stored within the track details). How can I get this to display alongside the currently playing track?

Hi @Siddhartha,

Thanks for feedback. You just place an image element in your RepeatingGroup next to track element, or any other place you want, and set the dynamic link to pull the image from the current track/album.

For more Bubble related help, please post your request here https://forum.bubble.io/.

Thanks!