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

190
Visualizações
MediaRecorder "onstop" event is fired twice in Safari

In my app, I'm using MediaRecorder to record a short video (up to 30s) from a user and then send it to the backend. To detect that recording has stopped, I use "onstop" event of MediaRecorder and in its callback I construct a video file and invoke uploading process. In Chrome and Edge it works fine. The event invokes only once, but in Safari I see different behavior, the "onstop" and "ondataavailable" events invoke twice. Therefore, my logic is broken, the backend receives two video files, the first one is broken usually, the second one is ok.

this.mediaRecorder = new MediaRecorder(stream, {
  mimeType,
  videoBitsPerSecond,
});

this.mediaRecorder.addEventListener('dataavailable', () => {
  console.debug('dataavailable');
});

this.mediaRecorder.addEventListener('stop', () => {
  console.debug('stop');
});

this.mediaRecorder.start();
console.debug('start');

Is this a bug of Safari or normal behavior?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Maybe you can create a own player with own stop-button and an onclick-event. eg.:

<video id=recoder></video>
<button onclick='document.getElementByID('recoder').pause()'>Stop/Pause</button>
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