Step-1: SurfaceViewRenderer cannot be converted to Callbacks
See original GitHub issueHello, I am doing the very first step but I met a problem in the last line of code in MainActivity:
localVideoTrack.addRenderer(new VideoRenderer(videoView));
Is this connected with the library which I use? I got it from here:
implementation 'org.webrtc:google-webrtc:1.0.23171'
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
webrtc/sdk/android/api/org/webrtc/SurfaceViewRenderer.java
VideoRenderer.Callbacks by displaying the video stream on a SurfaceView. * renderFrame() is asynchronous to avoid blocking the calling thread.
Read more >How to add callback: cannot be converted to ... - Stack Overflow
I am gotten this code from an online tutorial but it doesn't seem to work. android · google-api · Share.
Read more >SurfaceViewRenderer (Video Android 6.4.1)
Register a callback to be invoked when a new video frame has been received. void, clearImage(). Post a task to clear the SurfaceView...
Read more >SurfaceHolder.Callback - Android Developers
holder, SurfaceHolder : The SurfaceHolder whose surface has changed. This value cannot be null . format, int : The new PixelFormat of the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@soommy12 thank you! Your comment helped me a lot.
Hello @niroj08 , according to the official Android WebRTC example here (which is, unfortunately, a little bit complicated) you should create a private class which extends
VideoSink:private static class ProxyVideoSink implements VideoSink { private VideoSink target; @Override synchronized public void onFrame(VideoFrame frame) { if (target == null) { Logging.d(TAG, "Dropping frame in proxy because target is null."); return; } target.onFrame(frame); } synchronized void setTarget(VideoSink target) { this.target = target; } }Then, you need to create it:
private final ProxyVideoSink localProxyVideoSink = new ProxyVideoSink();and instead of adding a new render you add this sink to local video track:
localVideoTrack.addSink(localProxyVideoSink);