logo
On this page

How to solve screen sharing quality issues on the Web platform?

2021-09-09
Products / Plugins:Video Call / Audio Call / Live streaming
Platform / Framework:Web

When using screen sharing to publish on the Web platform and encountering blurry or stuttering shared images, you can refer to the following troubleshooting steps.

  1. It is recommended to use the latest version of Chrome browser.

  2. When publishing startPublishingStream, set the video codec videoCodec to "VP8".

Note

The playing end needs to play "VP8" or transcode.

// localStream is the MediaStream object obtained from creating a stream
zg.startPublishingStream(streamID, localStream, { videoCodec: 'VP8' })
  1. Confirm whether you are sharing an application window.
    • If yes, it is recommended to change to sharing the entire screen or sharing a browser tab.
  2. When calling the createStream interface to create a screen sharing stream, you can set the screen sharing video quality (resolution, frame rate, and bitrate) through the "videoQuality" parameter under the screen object based on your requirements for image quality (clarity and smoothness).
    • If not, check whether the screen encoding configuration you set in the createStream interface is normal, that is, perform "Step 4".

The values and meanings of this parameter are as follows:

ValueResolutionFrame Rate (fps)Bitrate (kbps)Application Scenario
1Actual shared resolution width × Actual shared resolution height20800"1" is the preset value with a higher frame rate, suitable for scenarios with high requirements for video smoothness.
2Actual shared resolution width × Actual shared resolution height151500"2" is the preset value, suitable for scenarios that balance video smoothness and clarity.
3Actual shared resolution width × Actual shared resolution height52000"3" is the preset value with a higher bitrate, suitable for scenarios with high requirements for video clarity.
4width × heightframeRatebitrate"4" is a custom value, suitable for scenarios where developers want to set the shared area, frame rate, and bitrate according to their needs.
const screenStream = await zg.createStream({
    screen: {
        videoQuality: 2,
    },
});
Note

For detailed feature introduction and implementation process, please refer to Video Advanced - Screen Sharing.

Previous

How to handle the no audio issue?

Next

How to resolve video anomalies (such as black screen, green screen, corrupted screen, etc.) when Web platform and Native platform interoperate?