AgoraIO-Community / AgoraWebSDK-NG

The Next Generation of Agora Web SDK
https://agoraio-community.github.io/AgoraWebSDK-NG/
161 stars 74 forks source link

Question: how to catch if a screenshare is stopped using the browser's Stop button? #112

Closed pgib closed 3 years ago

pgib commented 4 years ago

Describe the bug

When there's an active screen share, the browser (Chrome in my case) adds a banner to the top of all windows that informs the user that screen content is being shared. If I use the browser's Stop button, it's unclear how I detect that using the Agora SDK. It currently leaves the stream playing, but it's a black box.

image

HAHAHA44 commented 4 years ago

Thank you for your feedback. It is a very useful feature to know that screen sharing is turned off. We will add this feature in subsequent versions

FarazPatankar commented 3 years ago

Hey @pgib, we ran into this issue too, there's an event you can listen to and then handle it. Here's how we do it.

localScreenTrack.on('track-ended', handleStopScreenShare)

pgib commented 3 years ago

Hey @pgib, we ran into this issue too, there's an event you can listen to and then handle it. Here's how we do it.

localScreenTrack.on('track-ended', handleStopScreenShare)

@FarazPatankar Thanks, that's perfect! 💯