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

129
Views
how to show error when we upload the video and duration exceed than 1 minute in react js?

I want to prevent the video from uploading more than 1 minute in react js .

I searched a lot but I couldn't find it.

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

0

I guess you have to let the user select the video in from pc or phone, when it is loaded on the browser not uploaded yet make sure your upload button is inactive at this time and you have some message showing the user that you are busy working on the vide. That time try this

// Assume "video" is the video node
var i = setInterval(function() {
    if(video.readyState > 0) {
        var minutes = parseInt(video.duration / 60, 10);
        var seconds = video.duration % 60;

        // (Put the minutes and seconds in the display)

        clearInterval(i);
    }
}, 200);

[Link to full post on video operations in the browser][1]

I hope you find this helpful.

[1]: https://davidwalsh.name/html5-video-duration#:~:text=The%20JavaScript&text=To%20display%20the%20duration%20in,)%3B%20var%20seconds%20%3D%20video.

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!