AddVideo handles already in video directly.
Before that it required a listener.
This commit is contained in:
parent
bc134cfec9
commit
ed627d416e
2 changed files with 13 additions and 22 deletions
|
@ -598,6 +598,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
void onCallStateChanged(LinphoneCall call, State state, String message);
|
void onCallStateChanged(LinphoneCall call, State state, String message);
|
||||||
void onRingerPlayerCreated(MediaPlayer mRingerPlayer);
|
void onRingerPlayerCreated(MediaPlayer mRingerPlayer);
|
||||||
void onDisplayStatus(String message);
|
void onDisplayStatus(String message);
|
||||||
|
void onAlreadyInVideoCall();
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface EcCalibrationListener {
|
public interface EcCalibrationListener {
|
||||||
|
@ -803,4 +804,11 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
|
|
||||||
e.commit();
|
e.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addVideo() {
|
||||||
|
if (!LinphoneManager.getLc().isIncall()) return;
|
||||||
|
if (!reinviteWithVideo()) {
|
||||||
|
serviceListener.onAlreadyInVideoCall();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,35 +26,18 @@ import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Guillaume Beraudo
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class AddVideoButton extends ImageButton implements OnClickListener {
|
public class AddVideoButton extends ImageButton implements OnClickListener {
|
||||||
|
|
||||||
private AlreadyInVideoCallListener alreadyInVideoCallListener;
|
|
||||||
|
|
||||||
public AddVideoButton(Context context, AttributeSet attrs) {
|
public AddVideoButton(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
setOnClickListener(this);
|
setOnClickListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (!LinphoneManager.getLc().isIncall()) return;
|
LinphoneManager.getInstance().addVideo();
|
||||||
|
|
||||||
// If not in video call; try to reinvite with video
|
|
||||||
boolean alreadyInVideoCall = !LinphoneManager.reinviteWithVideo();
|
|
||||||
if (alreadyInVideoCall && alreadyInVideoCallListener != null) {
|
|
||||||
// In video call; going back to video call activity
|
|
||||||
alreadyInVideoCallListener.onAlreadyInVideoCall();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setOnAlreadyInVideoCallListener(AlreadyInVideoCallListener listener) {
|
|
||||||
this.alreadyInVideoCallListener = listener;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static interface AlreadyInVideoCallListener {
|
|
||||||
void onAlreadyInVideoCall();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue