Add counter to audio player

Hello,

I would like to add a time counter for an audio player. Is this possible?

Thanks.

example

2 Likes

Wow!! thanks…

It is so useful. Only a question: how can I make the button to pause the music and not stop it to start again?

Thanks.

.pause()

it’s all out there: :smile:

w3schools

mozilla

2 Likes

Finally I’m using your example in my document. Using it with a player only, it works fine (play, stop, drag…) but if I want to add another player everything works but the pause.

I’ll try to explain you the steps:

  • Copy/paste the first player.
  • Changed the ids in the second player.
  • Duplicate the javascript files.
  • Changed the id references in both copies.
  • Assign on touch both javascript to playPause. First initAudio, then playPause.
  • The same with the first playPause and removing the javascript on scene load.

I think the problem is that I have more than one javascript to preload and I only one can be used. Is it possible to make a javascript to be used by all the players?

Thanks in advance.

It’s solved. Thanks.