I'm implementing an app that retrieves a video stream using WebRTC (libjingle_peerconnection library). At some moment, the stream (RTCVideoTrack) could be removed. When this happens in the UIView (RTCEAGLVideoView) still show the last frame of the stream. I want to set that View to black. How can I do it?
For now I'm removing the stream with the following code, but as I said, last frame keeps showing on the view.
remoteVideoTrack.setEnabled(false) // RTCVideoTrack object
remoteVideoTrack.remove(videoView) // videoView is the RTCEAGLVideoView UI object
remotePeerConnection.close()
I encountered a similar issue. However, in may case a black view wasn't acceptable and I needed the renderer view to become completely transparent.
Since the video chat view controller in my case is displayed in a container, I was able to make the renderer last frame disappear by completely reloading the container.
This is the relevant code: