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

227
Vistas
Black screen when switching from video.srcObject to video.src using in Safari

I have an application where we are using the user's webcam for recording a video. For that i just use the following

const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: true })
video.srcObject = stream

Now I record the video using MediaRecorder API and when I stop recording, i simply set the srcObject to be null and use the recording as a url stored in the state simply using the below code.

video.srcObject = null
const url = URL.createObjectURL(recording)
setState({ url })

So what happens is, until I have something in srcObject for example while it is streaming or recording, it works fine. But when I stop the recording and set the srcObject to be null it does not autoplay the video. Although the video has received the src from the state. I have checked in the Safari dev-tools, the src is updated in the DOM properly.

Another debugging that I have already done is. If I do not set the video.srcObject = stream while starting the camera then everything works fine, like I can record, stop recording and then boom it autoplays the video that too with audio(not to forget, if I do not set the srcObject then unless I stop recording I am not able to see anything).

Any ideas or suggestions are welcome

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