AgoraIO-Community / VideoUIKit-Web-React

A Web library to simply integrate Agora Video Calling or Live Video Streaming to your website with just a few lines of code.
MIT License
50 stars 40 forks source link

Show screen share instead of video #29

Closed jalamprea closed 1 year ago

jalamprea commented 1 year ago

If I enable the screenshare, I would like to show my screen instead of my video. Is it something possible with recomposing? do you have any example?

Also, if I'm using the component in audience mode, how can I view the screen share from another participant?

EkaanshArora commented 1 year ago

That isn't a planned feature - you can share both your screen and video at the same time. If that's not something you want, you can add an event callback to mute your camera feed when you start screen sharing.

jalamprea commented 1 year ago

I tried to use the Screenshare callback but looks like there is an issue... When the user presses the button to start the screen share session and the browser asks for the screen/window/tab to share, the event is triggered even if the user cancels the operation. Also, when I finish a screen share session, the callback is never triggered.

BTW, do you have an example of how to mute the local video programmatically from the screensharing callback?

EkaanshArora commented 1 year ago

I think it would be nice to create two separate events for when the screenshare button is clicked and when the actual screenshare is started. I'll add this to the roadmap.

jalamprea commented 1 year ago

In the end, I used the user-published event to detect the screen share uid. In that way, it is triggered only when the screen share has already started