Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

133
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda