[Linphone Android] 帶視訊的呼叫
阿新 • • 發佈:2019-02-12
在呼叫的時候預設進行視訊請求:
public int call(String strDestinationAddr, boolean enableVideo){
String strIdentify = strDestinationAddr;
if(-1 == strIdentify.indexOf("@")){
strIdentify = "sip" + strDestinationAddr +"@" + mLinphoneCore.getDefaultProxyConfig().getDomain();
}
try {
LinphoneAddress lpAddress = LinphoneCoreFactory.instance().createLinphoneAddress(strIdentify);
LinphoneCallParams params = mLinphoneCore.createDefaultCallParameters();
if (enableVideo && params.getVideoEnabled()) {
params.setVideoEnabled(true );
} else {
params.setVideoEnabled(false);
}
mLinphoneCall = mLinphoneCore.inviteAddressWithParams(lpAddress, params);
if(enableVideo){
mLinphoneCore.enableVideo(true, true);
enableCamera(mLinphoneCall, true );
}
mLinphoneCore.enableSpeaker(true);
}catch (LinphoneCoreException exception){
Log.d(TAG, exception.toString());
return -1;
}
return 0;
}