How to correctly handle video constraints in webrtc

Viewed 196

I have a simple WebRTC application that is working correctly to set calls when constraint={audio: true, video: true}. My issue is that when I change the video constraint to 1080p, it does not work:

constraints.video = {
          width: { ideal: 1920 },
          height: { ideal: 1080 },
        };

I have an iphone and a macbook pro. The macbook has a camera that supports up to 720p. The iphone does support 1080p. If I start the call from the iphone, the call is stablished, but the video stream will stop working locally, and will not be transmitted to the remote peer. If I start the call from the macbook, the call works as expected, with both peers transmitting at 720.

I suspect that the sdp offer has something to do with it, because the resolution used for both videos is the same, and fails if one of the peers is unable to match it (according to my observations).

I am using safari in the iphone. In the macbook, the same issue happens with chrome and firefox (it does work on safari). In the case of safari, I get a video at 1080p, and the other one at 720p (which is what I want). In chrome and firefox, when I check the width and height of the video, I get a 0, and checking webrtc-internals it looks like nothing is being transmitted.

What may be causing this issue? Is there any way to get the desired behaviour on all browsers?

0 Answers
Related