提交工单
咨询集成、功能及报价等问题
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.
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)
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);