Esempio n. 1
0
  private void updateRecordTip() {

    if (CallStateEnum.isAudioMode(callingState)) {
      avChatAudio.showRecordView(AVChatManager.getInstance().isRecording(), recordWarning);
    }
    if (CallStateEnum.isVideoMode(callingState)) {
      avChatVideo.showRecordView(AVChatManager.getInstance().isRecording(), recordWarning);
    }
  }
Esempio n. 2
0
 public void resetRecordTip() {
   uiHandler.removeCallbacks(runnable);
   recordWarning = false;
   if (CallStateEnum.isAudioMode(callingState)) {
     avChatAudio.showRecordView(AVChatManager.getInstance().isRecording(), recordWarning);
   }
   if (CallStateEnum.isVideoMode(callingState)) {
     avChatVideo.showRecordView(AVChatManager.getInstance().isRecording(), recordWarning);
   }
 }
Esempio n. 3
0
  @Override
  public void toggleRecord() {
    if (AVChatManager.getInstance().isRecording()) {
      AVChatManager.getInstance()
          .stopRecord(
              new AVChatCallback<Void>() {
                @Override
                public void onSuccess(Void aVoid) {}

                @Override
                public void onFailed(int code) {}

                @Override
                public void onException(Throwable exception) {}
              });

      uiHandler.removeCallbacks(runnable);
      recordWarning = false;

    } else {
      recordWarning = false;

      if (AVChatManager.getInstance()
          .startRecord(
              new AVChatCallback<Void>() {
                @Override
                public void onSuccess(Void aVoid) {}

                @Override
                public void onFailed(int code) {}

                @Override
                public void onException(Throwable exception) {}
              })) {

        if (CallStateEnum.isAudioMode(callingState)) {
          Toast.makeText(context, "仅录制你说话的内容", Toast.LENGTH_SHORT).show();
        }

        if (CallStateEnum.isVideoMode(callingState)) {
          Toast.makeText(context, "仅录制你的声音和图像", Toast.LENGTH_SHORT).show();
        }

        uiHandler.post(runnable);

      } else {

        Toast.makeText(context, "录制失败", Toast.LENGTH_SHORT).show();
      }
    }

    updateRecordTip();
  }