PraJen
PraJen

Reputation: 606

Need to get audio timing in alert box

<audio id="audio1" controls>
   <source src="audio/audio2.mp3" type="audio/mpeg">
   <source src="audio/audio2.ogg" type="audio/ogg">
 <embed height="50" width="100" src="audio/audio2.mp3">

I just want to get 1.Duration of the audio file. 2.the timing of audio file when i press pause..

please state me answer in javascript or jquery

Thanks in advance

Upvotes: 1

Views: 87

Answers (1)

Victor Zakharov
Victor Zakharov

Reputation: 26434

With jQuery:

  1. Use loadedmetadata or canplay events of the audio element.
  2. Use timeupdate event of the audio element.

Upvotes: 1

Related Questions