Reputation: 134
I have IOS and Android app using sinch video and Audio (App to App ) calling integrated. isVideoOffered() Bool always gives video irrespective of incoming call.I want to receive audio screen when audio call is called from another app(Android/IOS) and video if video call is initiated from another app(Android/IOS).
Code for Android to differentiate incoming call(video or audio)
public void onIncomingCall(CallClient callClient, Call call) {
if( call.getDetails().isVideoOffered()){
Log.d(TAG, "Incoming call");
Intent intent = new Intent(SinchService.this, IncomingCallScreenActivityVideo.class);
intent.putExtra(CALL_ID, call.getCallId());
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
SinchService.this.startActivity(intent);
}
else
{
Log.d(TAG, "Incoming audio call");
Intent intent = new Intent(SinchService.this, IncomingCallScreenActivity.class);
intent.putExtra(CALL_ID, call.getCallId());
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
SinchService.this.startActivity(intent);
}
}
Code for IOS to differentiate incoming call(video or audio)
#pragma mark - SINCallClientDelegate
- (void)client:(id<SINCallClientDelegate>)client didReceiveIncomingCall:(id<SINCall>)call {
if (call.details.applicationStateWhenReceived == UIApplicationStateActive) {
if([call.details isVideoOffered]) {
[self performSegueWithIdentifier:@"callView" sender:call];
}
else
{
[self performSegueWithIdentifier:@"audioCallView" sender:call];
}
}
else {
[call answer];
}
}
Upvotes: 0
Views: 473
Reputation: 1190
I suggest using your VideoActivity layouts and classes for handling both the calls because when an audio call is received, the video portions remain hidden in your layout..
Additionally, you can set an icon that can tell you whether you're on Video Call or not.. I mean you can do somethink like.
@Override
public void onVideoTrackAdded(Call call) {
// Display some kind of icon showing it's a video call
isVideo=true;
}
Upvotes: 1
Reputation: 2703
I can confirm that this is a bug and we will fix it for a future beta release.
Upvotes: 2