How do I keep my resolution constant in a screen sharing app?

In a typical video chat interaction, WebRTC will try to optimize video frame resolution based on factors like network kbps, cpu processing power etc . For example if the network is congested WebRTC optimization lowers the resolution of the video frame sent/published.

In a screen sharing application (where a bitmap of the screen is sent via the network, and a camera is not used)  , this downgrading of resolution can make the subscribed image (for example, the fonts in your shared notes)  appear coarse. To prevent this, you can set a flag on your publisher instructing WebRTC not to downgrade the resolution and optimize the sharing experience by other ways , say reducing frame rate.  It is done as follows:

 [_publisher setVideoType:OTPublisherKitVideoTypeScreen];

In a typical video chat session using a camera, we recommend that you do not use the above setting and let WebRTC handle the optimization on its own.

In some "point and shoot"  applications (for example, pointing your mobile phone camera towards a faulty wiring and publishing that to an technician on the other side) the resolution needs to be kept constant , as the captured video information/display are critical in nature (say the specification number on a faulty wire, in the same example mentioned above). In such a case, you can still set the above flag and keep the resolution constant, even though you are using the camera and not sending screen sharing bitmaps. 


Have more questions? Submit a request