Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

114
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!