logo
On this page

Screen sharing

Introduction

In ZEGOCLOUD UIKits, for non-participant roles in a call, video conference, and live streaming scenario, screen sharing is enabled by default.

Warning

Screen sharing feature uses the resolution of the screen itself by default, which may result in high costs. If you need to disable the screen sharing feature or config the resolution, please refer to the instructions below.

While you can disable the screen sharing feature as needed, and once it's disabled, the marked button in the following image will be hidden:

How do I disable screen sharing?

To disable the screen sharing feature, set the showScreenSharingButton to false.

Untitled
// ....
zp.joinRoom({
     // ...,
     showScreenSharingButton: false,
     // ...
});
1
Copied!

Configure the resolution of the screen sharing

  • Use the default configuration provided by the SDK
Untitled
// ....
zp.joinRoom({
     // ...,
     screenSharingConfig: {
        resolution: ZegoUIKitPrebuilt.ScreenSharingResolution_720P
    }
     // ...
});
1
Copied!

resolution provides the following default configuration:

width*heightframeRatebitrate (kbps)
ZegoUIKitPrebuilt.ScreenSharingResolution_360P640 * 36015400
ZegoUIKitPrebuilt.ScreenSharingResolution_480P640 * 48015500
ZegoUIKitPrebuilt.ScreenSharingResolution_720P1280 * 720151130
ZegoUIKitPrebuilt.ScreenSharingResolution_1080P1920 * 1080151500
ZegoUIKitPrebuilt.ScreenSharingResolution_2K2560 * 1440156000
ZegoUIKitPrebuilt.ScreenSharingResolution_4K3840 * 21601510000
ZegoUIKitPrebuilt.ScreenSharingResolution_AutoThe resolution is the actual size of the selected sharing area.15auto
  • Custom resolution
Untitled
// ....
zp.joinRoom({
     // ...,
     screenSharingConfig: {
        resolution: ZegoUIKitPrebuilt.ScreenSharingResolution_Custom,
        width: 1280, 
        height: 720,
        frameRate: 10,
        maxBitRate: 1130, // Unit is kbps
    }
     // ...
});
1
Copied!

When resolution is ZegoUIKitPrebuilt.ScreenSharingResolution_Custom, width,height, frameRate,maxBitRate are required.