@Override
 public void onClick(View v) {
   try {
     mMikeView.setEnabled(false);
     ECVoIPSetupManager setupManager = ECDevice.getECVoIPSetupManager();
     if (setupManager != null) {
       setupManager.setMute(!isMikeEnable);
       isMikeEnable = setupManager.getMuteStatus();
     }
     if (isMikeEnable) {
       initBottomStatus(0);
     } else {
       synchronized (mLock) {
         // new Thread(mikeAnimRunnable).start();
         mLock.notify();
       }
     }
     if (mCallback != null) {
       mCallback.onMeetingMicEnable(isMikeEnable);
     }
     mMikeView.setEnabled(true);
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
Exemplo n.º 2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mCallId = getIntent().getStringExtra(ECDevice.CALLID);
    mCallNumber = getIntent().getStringExtra(ECDevice.CALLER);
    mCallName = mCallNumber;
    initResourceRefs();
    mName.setText(mCallName);
    mPhone.setText(mCallNumber);
    mVideoTopTips.setText(getString(R.string.str_vedio_call_in, mCallName));

    ECDevice.getECVoIPSetupManager().setVideoView(mVideoView, mLoaclVideoView);
    mLoaclVideoView.setVisibility(View.VISIBLE);
  }
Exemplo n.º 3
0
  @Override
  public void onInitialized() {
    ECInitParams params = SDKHelper.getInstance().getParams();

    if (!params.validate()) {
      ViewInject.toast("error");
      // Intent intent = new Intent(ACTION_SDK_CONNECT);
      // intent.putExtra("error", -1);
      // mContext.sendBroadcast(intent);
      return;
    }

    if (params.validate()) {
      ECDevice.login(params);
    }
  }
Exemplo n.º 4
0
  public void sendMessage(final Friend friend, History history) {
    try {
      ECMessage msg = ECMessage.createECMessage(ECMessage.Type.TXT);
      msg.setForm(UserCache.getInstance().getClientUser().getUserId() + "");
      msg.setMsgTime(System.currentTimeMillis());

      msg.setTo(friend.getUserId() + "");
      msg.setSessionId(friend.getUserId() + "");
      msg.setDirection(ECMessage.Direction.SEND);

      String content =
          history.getScene().getSceneId() + "/" + history.getTime() + "/" + history.getStatus();
      ECTextMessageBody msgBody = new ECTextMessageBody(content);
      LogUtil.d(TAG, "The content is " + content);
      msg.setBody(msgBody);
      ECChatManager manager = ECDevice.getECChatManager();
      manager.sendMessage(msg, mOnSendMessageListener);
    } catch (Exception e) {
      LogUtil.e(TAG, "send message fail , e=" + e.getMessage());
    }
  }