|
调用部分- // 关闭声音
- findViewById(R.id.closeVoice).setOnClickListener(new OnClickListener() {
-
- @Override
- public void onClick(View v) {
- anychat.UserSpeakControl(-1, 0);
- v.setVisibility(View.GONE);
- findViewById(R.id.openVoice).setVisibility(View.VISIBLE);
- }
- });
- // 打开声音
- findViewById(R.id.openVoice).setOnClickListener(new OnClickListener() {
-
- @Override
- public void onClick(View v) {
- anychat.UserSpeakControl(-1, 1);
- v.setVisibility(View.GONE);
- findViewById(R.id.closeVoice).setVisibility(View.VISIBLE);
- }
- });
- // 关闭视频
- findViewById(R.id.closeVideo).setOnClickListener(new OnClickListener() {
-
- @Override
- public void onClick(View v) {
- anychat.UserCameraControl(-1, 0);
- bSelfVideoOpened = false;
- v.setVisibility(View.GONE);
- findViewById(R.id.openVideo).setVisibility(View.VISIBLE);
- }
- });
- // 打开视频
- findViewById(R.id.openVideo).setOnClickListener(new OnClickListener() {
-
- @Override
- public void onClick(View v) {
- anychat.UserCameraControl(-1, 1);
- bSelfVideoOpened = true;
- v.setVisibility(View.GONE);
- findViewById(R.id.closeVideo).setVisibility(View.VISIBLE);
- }
- });
复制代码 AnyChatStateChgEvent接口部分- @Override
- public void OnAnyChatCameraStateChgMessage(int dwUserId, int dwState) {
- if(dwUserId == userID){
- if (dwState != 2) {
- bOtherVideoOpened = false;
- } else {
- // 如果是采用Java视频显示,则需要设置Surface的CallBack
- if (AnyChatCoreSDK.GetSDKOptionInt(AnyChatDefine.BRAC_SO_VIDEOSHOW_DRIVERCTRL) == AnyChatDefine.VIDEOSHOW_DRIVER_JAVA) {
- int index = anychat.mVideoHelper.bindVideo(otherView.getHolder());
- anychat.mVideoHelper.SetVideoUser(index, userID);
- }
- bOtherVideoOpened = true;
- }
- }
- }
复制代码 |
|