Screen Sharing
  • Electron : JavaScript
  • Windows
  • SDK Downloads
  • Sample Codes
  • Quick Starts
  • Documentation
  • Screen Sharing
  • Quick Starts
  • Sharing Publish Streaming

Sharing Publish Streaming

Last updated:2022-03-22 13:06

1 Introduction

Publish streaming sharing means that after screen capture or window capture is started, it can be combined with the custom video capture function of zego-express-engine-elctron to push the collected data out to achieve screen sharing.

2 Publish Streaming Operation

2.1 zgEngine Enables Custom Video Capture Function

Push streaming operation needs to enable the custom video capture function of zego-express-engine-elctron. For more information about the use of zego-express-engine-electron, please refer to SDK Integration Guidelines.

// Open custom video capture before logging in to the room
zgEngine.enableCustomVideoCapture(true, zgDefines.ZegoPublishChannel.Main);

// Login room
zgEngien.loginRoom(xxx)

// start preview and push
zgEngine.startPreview(xxx)
zgEngine.startPublishStream(xxx)

2.2 zgScreenCapture Transmits Data to zgEngine

After zgEngine enables the custom video capture function, zgScreenCapture calls enablePublishVideo to automatically transmit to zgEngine every time the screen or window data is captured. zgEngine will preview and push the stream after receiving the data.

// Call enablePublishVideo(true), and automatically transmit to zgEngine every time the screen or window data is collected
zgScreenCapture.enablePublishVideo(true, zgDefines.ZegoPublishChannel.Main);

// Call enablePublishVideo(false) to stop the transmission process
// zgScreenCapture.enablePublishVideo(false, zgDefines.ZegoPublishChannel.Main);
Page Directory