I am currently using another company's implementation for WebRTC video conferencing and it is integrated into our web app via an iframe. We would like to make the integration more seamless and provide our own toggle button for screen sharing so we can execute other logic in the background without additional user actions.
I know that I can stop the media stream video tracks through code but unfortunately that requires that I have the initial media stream objects in the first place. Since we are using another company's implementation, I am not the one creating the connection or the media stream.
I have also looked into Chrome's own webrtc-internals to see if I could use this page or their own code to access existing web rtc sessions via our web app. The applicable code would be addwebuilistener but it appears this is locked down for obvious security reasons.
The only possible option that I could imagine would be a solution is creating a chrome extension for our web app but I do not want to dive into that if it's not necessary.
Therefore My questions are:
- Is there a way to programmatically press the Stop Sharing button that Chrome displays during a screen share? I have looked through the Chrome API documentation and cannot seem to find anything.
- Is there a way to access the initiated web rtc connection objects or existing media stream from my web app even though it is occurring from another server via the iframe? I assume this is a no due to security risks but worth asking.