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

156
Views
sending blobs with websocket

i'm trying to send blob through websocket to make real time video chat, this is just simple few lines for testing, first time works then it stops working and causes

Uncaught (in promise) DOMException: Failed to load because no supported source was found.```

the first blob is working fine then the previous error happens here's my code

function socket(pk) {

    const HomeSocket = new WebSocket(
                'ws://'
                + window.location.host
                + '/ws/stream'
            );
            

            HomeSocket.onmessage = function(e) {
                var data = JSON.parse(e.data);

                    if (! data.id) {
                        fed = document.createElement('video')
                        fed.id = data.newUser
                        container.appendChild(fed)
                    } else {
                        fed.src = data.stream
                        fed.play()   
                    }

                              };  


            HomeSocket.onclose = function(e) {
            };

            var device = navigator.mediaDevices.getUserMedia({audio: true, video:true});
            var items = [];
            device.then(function(stream) {
                var recorder = new window.MediaRecorder(stream);
                recorder.start(1000);
                recorder.ondataavailable = function(e){
                    items[0] = e.data
                    var blob = new Blob(items, {type: 'audio/ogg; codecs=opus'});
                    const audio_url = window.URL.createObjectURL(blob);
                    HomeSocket.send(audio_url)

                }
                })
}

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!