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

182
Vistas
getUserMedia nondeterministically returns desktop resolution on mobile

I call

navigator.mediaDevices.getUserMedia({video: true, audio: false,  width: 640, height: 480})

On desktop this returns the specified resolution. On mobile portrait (specifically Safari iOS) this returns 480x640 video on the first call of getUserMedia, which is expected behavior.

My app is structured so that one can click outside of the app and click to resume it again in a browser.

The "click out" triggers this bit of code

  stream_global.getTracks().forEach(function(track) { track.stop(); });

stream_global is set as such:

navigator.mediaDevices.getUserMedia( {video: true, audio: false} ).then(function(stream) { stream_global = stream; // and the rest of the function

And the "resume" triggers the same getUserMedia call with the same parameters.

navigator.mediaDevices.getUserMedia({video: true, audio: false,  width: 640, height: 480})

When I trigger these events the video.videoWidth and video.videoHeight will confusingly toggle between the values of 640x480 and 480x640 respectively, without any orientation change. I know this for a fact because I append these values (video.videoWidth, video.videoHeight) to a p element as innerHTML every time I call getUserMedia. Sometimes getUserMedia will return one of these resolutions a couple times in a row, then switch. I started observing this behavior a couple days ago, and while I cannot know when exactly it started, it definitely wasn't there about a year ago.

This behavior is extremely confusing to me, and any help is appreciated.

For reference, this is the adapter.js I use

https://webrtchacks.github.io/adapter/adapter-latest.js

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