本文整理汇总了Java中com.csipsimple.api.SipCallSession.MediaState类的典型用法代码示例。如果您正苦于以下问题:Java MediaState类的具体用法?Java MediaState怎么用?Java MediaState使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MediaState类属于com.csipsimple.api.SipCallSession包,在下文中一共展示了MediaState类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setCallState
import com.csipsimple.api.SipCallSession.MediaState; //导入依赖的package包/类
public synchronized void setCallState(SipCallSession aCallInfo) {
callInfo = aCallInfo;
if (callInfo == null) {
updateElapsedTimer();
cachedInvState = SipCallSession.InvState.INVALID;
cachedMediaState = MediaState.ERROR;
cachedCanRecord = false;
cachedIsRecording = false;
cachedIsHold = false;
cachedVideo = false;
cachedZrtpActive = false;
cachedZrtpVerified = false;
return;
}
Log.d(THIS_FILE, "Set call state : " + callInfo.getCallState());
updateRemoteName();
updateCallStateBar();
updateQuickActions();
updateElapsedTimer();
cachedInvState = callInfo.getCallState();
cachedMediaState = callInfo.getMediaStatus();
cachedCanRecord = callInfo.canRecord();
cachedIsRecording = callInfo.isRecording();
cachedIsHold = callInfo.isLocalHeld();
cachedVideo = callInfo.mediaHasVideo();
cachedZrtpActive = callInfo.getHasZrtp();
cachedZrtpVerified = callInfo.isZrtpSASVerified();
// VIDEO STUFF -- EXPERIMENTAL
if(canVideo) {
if (callInfo.getCallId() >= 0 && cachedVideo) {
if (renderView == null) {
renderView = ViERenderer.CreateRenderer(getContext(), true);
photo.setVisibility(View.GONE);
RelativeLayout container = (RelativeLayout) findViewById(R.id.call_card_container);
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.MATCH_PARENT,
RelativeLayout.LayoutParams.MATCH_PARENT);
lp.addRule(RelativeLayout.ALIGN_LEFT, RelativeLayout.TRUE);
lp.addRule(RelativeLayout.ALIGN_RIGHT, RelativeLayout.TRUE);
lp.addRule(RelativeLayout.ALIGN_TOP, RelativeLayout.TRUE);
lp.addRule(RelativeLayout.ABOVE, R.id.call_action_bar);
renderView.setLayoutParams(lp);
container.addView(renderView, 0);
Log.d(THIS_FILE, "Render window added");
SipService.setVideoWindow(callInfo.getCallId(), renderView, false);
View v = findViewById(R.id.end_call_bar);
ViewGroup.LayoutParams lp2 = v.getLayoutParams();
lp2.height = ViewGroup.LayoutParams.WRAP_CONTENT;
v.setLayoutParams(lp2);
}
hasVideo = true;
}else {
if(renderView != null) {
renderView.setVisibility(View.GONE);
photo.setVisibility(View.VISIBLE);
}
hasVideo = false;
}
}
if (onTriggerListener != null) {
onTriggerListener.onDisplayVideo(hasVideo && canVideo);
}
// End of video stuff
//requestLayout();
/*
if(dragListener != null) {
dragListener.setCallState(callInfo);
}
*/
}