Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

151
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda