-
Notifications
You must be signed in to change notification settings - Fork 459
[Android] Video support on incomingCall #251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
I was just curious what stage this is at? I would love to test on an upcoming app as we need the features implemented here, but wasn't sure the stability of the current progress. |
Hello, i have some issue with android 11 and i have no time to continue for the moment ... Help and feedback are welcome ;) |
Sure! I'd be happy too. I have a Pixel phone w/ Android 11 ready to go actually ;) When I have time I'll switch to this branch and see if I can help contribute. In the meantime, thanks for the quick reply! |
any progress on this feature? |
If there was.... there would be an update on the issue
…On Sun, 6 Dec 2020 at 08:42, podvipodvert ***@***.***> wrote:
any progress on this feature?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#251 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAB3LLLRUKJRRICB52SWWJLSTM7WNANCNFSM4PLSY2XA>
.
|
@@ -479,7 +481,7 @@ private void registerPhoneAccount(Context appContext) { | |||
String appName = this.getApplicationName(this.getAppContext()); | |||
|
|||
PhoneAccount.Builder builder = new PhoneAccount.Builder(handle, appName) | |||
.setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER); | |||
.setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER | PhoneAccount.CAPABILITY_VIDEO_CALLING); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes the phone account disappear on restart. Just investigating this myself and have tracked it down to this line - even changing it to PhoneAccount.CAPABILITY_SUPPORTS_VIDEO_CALLING breaks it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But based on https://android.googlesource.com/platform/cts/+/cc920ce%5E%21/ this should be allowed.
If you enable this, enable the calling account etc, and then restart the phone your calling account won't be there until you launch the app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh... it appears on first look of the settings and then disappears! So maybe the above is wrong...
@jonastelzio @danjenkins we're kind of stuck with this feature 😕 When display the native video incoming call scene, Android provides a surface where to display the remote video. I've this piece of code (waiting for react-native-webrtc/react-native-webrtc#987 to be merged): @ReactMethod
public void setRemoteVideo(String streamURL, String uuid) {
Log.d("RNCK", "setRemoteVideo: " + streamURL);
Context context = reactContext.getApplicationContext();
Handler mainHandler = new Handler(context.getMainLooper());
Runnable myRunnable = new Runnable() {
@Override
public void run() {
Connection connection = VoiceConnectionService.getConnection(uuid);
if (connection == null) {
Log.w("RNCK", "No connection found for call uuid: " + uuid);
return;
}
VideoConnectionProvider videoProvider = (VideoConnectionProvider) connection.getVideoProvider();
Surface remoteSurface = videoProvider.getRemoteSurface();
// Get video track
VideoTrack videoTrack = null;
WebRTCModule module = reactContext.getNativeModule(WebRTCModule.class);
MediaStream stream = module.getStreamForReactTag(streamURL);
if (stream != null) {
List<VideoTrack> videoTracks = stream.videoTracks;
if (!videoTracks.isEmpty()) {
videoTrack = videoTracks.get(0);
}
}
if (videoTrack == null) {
Log.w("RNCK", "No WebRTC video track found for call uuid: " + uuid);
return;
}
SurfaceViewRenderer surfaceViewRenderer = new SurfaceViewRenderer(context);
EglBase.Context sharedContext = EglUtils.getRootEglBaseContext();
surfaceViewRenderer.init(sharedContext, null);
videoTrack.addSink(surfaceViewRenderer);
EglBase eglBase = EglUtils.getRootEglBase();
Log.w("RNCK", "remoteSurface: " + remoteSurface);
eglBase.createSurface(remoteSurface);
eglBase.makeCurrent();
}
};
mainHandler.post(myRunnable);
} This method should be called when the video stream and the remote Surface is available. The issue is that I can't find a way to render the Thanks ! |
@manuquentin any update in this regards ? Found react-native-webrtc/react-native-webrtc#987 is merged and released in latest version. Thanks |
This PR add video support on incomingCall. Video support means when you received a video call, your phone replace the answer button by a video button, add an icon to explain you you are receiving a video call from the caller. This PR add a new arg to displayIncomingCall hasVideo (boolean). I only tested on my pixel phone for the moment and it missed some stuff to work correctly when screen is locked but it works.