Unable to pause webrtc video and resume properly when user navigates away from 'call' Android Activity

822 views
Skip to first unread message

Antonis Tsakiridis

unread,
Sep 7, 2016, 3:26:29 AM9/7/16
to discuss-webrtc
Hello, 

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:
  1. 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)
  2. Release the renderers
  3. When the call Activity is re-entered I re-initialize the new renderers
  4. 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

Christoffer Jansson

unread,
Sep 7, 2016, 8:21:07 AM9/7/16
to discuss-webrtc
Hi,

I know very little of Activities in Android hence there might be something in your logic but could you check if the the video stream is sent over the network? I.e. determine if it's a sender or receiver problem.

Do you see any decode or send errors?

/Chris

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CAM7er2OM%3DiCPp_1vWBe3ySRuapWLncNALaL9ub1VnENrCabgog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
/Chris

Antonis Tsakiridis

unread,
Sep 23, 2016, 6:32:10 AM9/23/16
to discuss-webrtc
Thanks for your prompt response Chris. For now I have reverted back to the AppRTCDemo logic which is to allow for the same functionality as long as the Call Activity isn't destroyed. Let me get back to you when I get the chance to continue this investigation.

Best regards,
Antonis
Reply all
Reply to author
Forward
0 new messages