0

I am trying to set default video quality for video like this (from the example) :

createLocalTracks({
  audio: true,
  video: { width: 640 }
}).then(localTracks => {
  return connect('$TOKEN', {
    name: 'my-room-name',
    tracks: localTracks
  });
}).then(room => {
  console.log('Connected to Room:', room.name);
});

instead of width : 640 i want to set dynamic resolution for the video base on user's internet connection. How can I do that?

Anand Siddharth
  • 967
  • 1
  • 9
  • 30
  • 1
    May be you can use the idea from this question: [how-to-detect-internet-speed-in-javascript](https://stackoverflow.com/questions/5529718/how-to-detect-internet-speed-in-javascript) – HDJEMAI Mar 24 '18 at 19:01
  • 1
    Peraps you can load a file or page of a known size, this won't be totally correct, but will give you some kind of estimate. You a callback when the file was loaded and check how much time elapsed – Aryeh Armon Mar 24 '18 at 19:09
  • @anand were you able to get a solution to this? Were you able to change video resolution based on the network conditions? Not just during initialization but also once the call has started? – Uday Reddy Oct 27 '18 at 02:49
  • @UdayReddy not yet – Anand Siddharth Oct 28 '18 at 15:27

0 Answers0