Let me first describe my scenario very quick. I have an Android App that makes webrtc calls. I want to be able while a video call is ongoing to leave the call Activity but still remain inside the App, and then be able to resume by re-entering the call activity. While outside of the call Activity I should still hear audio, but the (local & remote) video should be paused (at this early point I don't really care that RTP media continue to be exchanged during the pause duration, as I understand it needs SDP renegotiation to stop that too).
The problem is that when I return back to the call Activity, even though the local video is indeed resumed and the remote party can see it, the remote video view shows up black (notice that audio is successfully heard during this whole time)
In a nutshell what I have done is the following:
- When the call Activity is left (as a result of the user pressing Back for example) and the call Activity is destroyed I set the local and remote video tracks to disabled and remove the respective renderers (i.e. SurfaceViewRenderer)
- Release the renderers
- When the call Activity is re-entered I re-initialize the new renderers
- Set the local and remote video tracks to enabled and add the new respective renderers
The result as mentioned previously is that local video is resumed fine, but remote remains black
Any ideas what might be the issue?
Some additional notes:
- In my attempt to isolate the problem, I tried to do the same in PeerConnection level but without leaving the re-entering the call Activity. That is to just disable and remove local and remote renderers and then re-enable and add the same renderers to the respective video tracks and all seems to be working fine. So it's like something happens either when I release the renderers or re-initialize them that messes things up. Still everything seems ok to me code-wise :(
- I have used the logic I found in the AppRTC Demo App for Android
- I was thinking of using the 'background' logic used by AppRTC Demo App for Android, but this only works if the call Activity stays alive and I'd like it to work even if the call Activity dies for any reason.
I haven't added any code since this post is already big, please let me know if you need more details.
Thanks in advance,
Antonis Tsakiridis