Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

271
Views
Is it possible to check how long someone has played the mp3 sound?

I need to check how long someone played the mp3 file, I read about the .buffored function, which allows you to check how many times where or when it was stopped, but you have some option to count the listening time of mp3

const myAudio = document.getElementById('my-audio');
const bufferedTimeRanges = myAudio.buffered;
<audio id="my-audio" controls src="music.mp3">
</audio>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

const audio = document.querySelector('audio');

audio.ontimeupdate = (event) => {
  console.log('The currentTime attribute has been updated. Again.');
};

you can use the ontimeupdate event to receive currentTime information about the audio file. You can combine it with the onended event to count how many times the user ended the audio and you'll have the whole feature done.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!