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

145
Views
use handleSeeked() function in videojs

I'm using videojs to play videos on the site and I'm trying to create log on video streams but I have difficulty logging users seeking in videos. I need seek start and end time and it seems that the built in handleSeeked() function in videojs does the job but I can't get it to work. Does anybody know how to use this function?

Update

It seems that this question is about the same problem but the solutions aren't fully working and each one has a little problem.

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

0

I was able to get what I wanted with the following code but I had to handle everything on my own so if there's still a better way to do this I'd be happy if you could help me.

    var previousTime = 0,
    currentTime = 0,
    completeTime = 0,
    position = 0;

player.on('timeupdate', function () {
    previousTime = currentTime;
    currentTime = Math.floor(player.currentTime());

    // save 'position' so long as time is moving forward with each update
    if (previousTime < currentTime) {
        position = previousTime;
        console.log('pos',position)

        previousTime = currentTime;
        console.log('pre',previousTime)
    }
});

player.on('seeked', function () {
    completeTime = Math.floor(player.currentTime());
    console.log("User came from: " + position);
    console.log("User ended at: " + completeTime);
    position= Math.floor(player.currentTime())
});
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!