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

121
Visualizações
Upload the video to the buffer, then change the src attribute
<video id=video controls mute></video>
<script>
    
    let source = new MediaSource,
    buffer = MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');

    (xhr = new XMLHttpRequest).open('get', 'frag_bunny.mp4');
    xhr.responseType = 'arraybuffer';
    xhr.onload = _ => {
        buffer.onupdateend = _ => {
            source.endOfStream();
            video.src = URL.createObjectURL(source);
            video.muted = true;
            video.play();
        };
        buffer.appendBuffer(xhr.response);
    }
    xhr.send();

 </script>

The code is not working. I really need your help

I am looking for a solution in which it is possible to preload a video file to the buffer. At the same time, change the src attribute of the video when the video is in the buffer. That is, upload a video and then insert or change the src attribute of the current video in the document. Is it possible to implement such a thing?

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