I am interested in utilizing Screensharing in Chrome. After following a guide and creating an extension to access the deviceId for getUserMedia, I was able to successfully start streaming my screen. However, when I attempted to stop the stream using the provided code
_localScreenStream.getTracks().forEach(function (track) {
track.stop();
});
and then tried to restart the stream, I encountered an InvalidStateError.
You can find a complete code example here
It seems like I may not be freeing all resources properly, but I have been unable to pinpoint where the issue lies.