Temasys / AdapterJS

AdapterJS Javascript Polyfill and Tools for WebRTC - Skylink WebRTC
http://skylink.io/web
Other
430 stars 100 forks source link

Free camera resource on MedaiStream.stop() #79

Closed z0r1k closed 9 years ago

z0r1k commented 9 years ago

Calling MediaStream.stop() doesn't free camera lock since usage indicator (LED) is still on.

serrynaimo commented 9 years ago

@johache Is this still a problem? Can't reproduce

johache commented 9 years ago

Cannot reproduce either. z0r1k, can you check this: https://plugin.temasys.com.sg/demo/samples/web/content/getusermedia/gum/index.html It's a VERY simple example, you can call stream.stop() from the console, it will turn off the camera indicator.

You issue might be coming from a connection with a peer. The plugin will not stop the camera if you are sharing it with someone. One this example: https://plugin.temasys.com.sg/demo/samples/web/content/peerconnection/states/index.html You have to call localstream.stop() and pc1.close() to turn off the camera.

z0r1k commented 9 years ago

Ah, OK, but this doesn't really help since my use-case is:

I establish peer connection with data channel for chat and they when someone wants to make a call I call GUM to get audio and add it to peer connection. Once someone wants to share his camera I do the same for video.

Obviously since temasys plugin doesn't support removeStream method I have to call stop on stream itself. I cannot close peer connection in this case since audio and chat still running and if someone wants to share his camera again I just renegotiate, but in this case resource is still blocked, right?

johache commented 9 years ago

Yes, I see the issue. I don't have a magic solution as it is. I think the best solution is to wait for us to implement removeStream. You are not the first one to come with this issue, we will get to it asap, but we have a big pile of things to do for the plugin...

johache commented 9 years ago

Given that remove stream was released in the latest public version, I am closing this issue. Re-open it if you think it is relevant.

santinoDu commented 5 years ago

Cannot reproduce either. z0r1k, can you check this: https://plugin.temasys.com.sg/demo/samples/web/content/getusermedia/gum/index.html It's a VERY simple example, you can call stream.stop() from the console, it will turn off the camera indicator.

You issue might be coming from a connection with a peer. The plugin will not stop the camera if you are sharing it with someone. One this example: https://plugin.temasys.com.sg/demo/samples/web/content/peerconnection/states/index.html You have to call localstream.stop() and pc1.close() to turn off the camera.

@johache hi,this two demo page are 404 now. I have tried stop, can't work, what is the 'pc1' has a 'close' method?