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

90
Visualizações
HTML audio breaks with uploaded files on iOS

I am trying to set a file uploaded via an input field as the source for an audio tag. Everything works fine except on iOS. When I run this code on the iPhone, the audio is correctly set to the new source and I can play it. But when I move the slider and press play/pause a few times, the slider moves without playing sound or doesn't move at all, even though the pause icon is displayed. Only when the slider is moved all the way back to the beginning does it sometimes work again.

The problem is most likely to occur with very short audio files (< 5 seconds). Maybe it is some strange behaviour when using createObjectURL under iOS? However, the problem does not occur in the iOS simulator under macOS.

Maybe some of you have had this problem before and can help me.

Thanks!

EDIT: The problem occures in the iPhone Simulator on macOS as well, after I updated it to the latest version (15.4). So it seems to be an issue with the newest iOS release.

const input = document.querySelector('input');
const audio = document.querySelector('audio');

input.addEventListener('change', (e) => {
  audio.src = URL.createObjectURL(e.target.files[0]);
})
<input type="file" accept="audio/*, .mp3" />
<audio controls />

about 4 years ago · Juan Pablo Isaza
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