UPDATE 1: I tried changing the video constraint like this
var mediaConstraints = {
audio: true, // We want an audio track
video: {
width: { min: 160, ideal: 320, max: 640 },
height: { min: 120, ideal: 240, max: 480 },
}
};
It has improved the call a bit. The video does still hang and cause sometimes the call to drop. I think this means the issue is slow network and not NAT.
I am still looking for answers to improve this call connection on the slow speeds.
ORIGINAL POST:
I know there are few similar questions on SO but what I am trying to ask hasn't been asked as far as my search is concerned.
webRTC video call works fine within my local network. But when I try to call my friend over the internet it sucks. I and my friend are on the same ISP and we are living in same geographic area within few miles of distance. So I would assume that this issue wouldn't be due to some NATs or firewalls but maybe I am wrong. Initially our call connects audio goes through and video goes through just few bits and then freezes or just hangs before the call drops. If we disable the video the call lasts longer and doesn't generally drop. Could this be slow network issue because we both are in the region were the internet speeds are around 150Kbps? But how does then whatsapp video calling work?
I intend to use this app within this same region with multiple ISPs and same low speeds. But if the issue is not due to speed and is due to NAT etc for which I would need TURN server then I think 100% of my calls will go through TURN and that will be very expensive for me.
I need advice if you have had any such experience or think I could improve this call setup with this low internet speed.
If this is of any help here my constraint config is:
var mediaConstraints = {
audio: true, // We want an audio track
video: {
width: { min: 240, ideal: 720, max: 1080 },
height: { min: 240, ideal: 720, max: 1080 },
}
};
Thank you