Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

183
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda