Whenever we use chrome desktop capture to record our screen from a chrome extension, we get the following window at the bottom. It provides option to stop screen sharing or hide screen sharing Stop/Hide Screen sharing
I am developing an extension to start and stop desktop recording. I want this window to disappear when the user clicks on "Stop" button of my extension. What is the way to do it?
I have tried passing the request id to this API chrome.desktopCapture.cancelChooseDesktopMedia(pending_request_id), but that did not seem to work.
to hide the chrome stop sharing bar, all you need to do is stop the related mediastream( i.e by stopping all it's mediatracks), e.g you could assign the action to any element's onclick:
element.onclick = () => screenStream.getTracks().forEach(track => track.stop())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With