pisapapiros pisapapiros - 2 months ago 28
Android Question

Pause and resume stream

I have an Android videochat app running through a Kurento WebRTC server. The websocket, room and peer connections are handled with the help of Nubomedia libraries:

The connection works fine. Now I need to implement a pause/resume button but only for one of the streams. This way one peer can send his stream to the room while other may temporary disable his stream, but still see the other one.

I'm trying to stop it with:


Which works great, but I'm not able to resume it with:


The upstream keeps frozen after resuming. Is not this a good approach? If not, is there any better? for example, sending a black stream instead of stop/start local media?


I ended up forking the library and adding my own funtion to call localVideoTrack.setEnabled(bool) in MediaResourceManager. Now I can pause/resume the outgoing video with ease.