Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

136
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda