Remote Control


Contents

1. Remote Control

2. Action

3. Listener

1. Remote Control

The first thing to start using remote control services is to get an InMeetingRemoteController instance from InMeetingService:

public MeetingRemoteControlHelper(CustomShareView shareView) {
  this.customShareView = shareView;
  mInMeetingRemoteController = ZoomSDK.getInstance().getInMeetingService().getInMeetingRemoteController();
  mInMeetingRemoteController.addListener(this);
  mInMeetingService = ZoomSDK.getInstance().getInMeetingService();
}

2. Action

You can start remote controlling by calling startRemoteControl method:

@Override
public void remoteControlStarted(long userId) {
    long myUserId = mInMeetingService.getMyUserID();
    boolean isMe = userId == myUserId;

    boolean hasPriv = mInMeetingRemoteController.hasRemoteControlPrivilegeWithUserId(myUserId);
    boolean isRc = mInMeetingRemoteController.isRemoteController();

    Log.d(TAG, "remoteControlStarted userId:" + userId + " myUserId:" + myUserId + " hasPriv:" + hasPriv + " isRc:" + isRc);
    if (isMe) {
        if (isRc) {
            mInMeetingRemoteController.startRemoteControl();
        }
    } else {
        customShareView.enableRC(hasPriv, isRc);
    }
}

3. Listeners

Overriding the following methods allow you to monitor the events while remote controlling:

@Override
public void onUserGetRemoteControlPrivilege(long userId) {
    long myUserId = mInMeetingService.getMyUserID();
    boolean isMe = userId == myUserId;

    boolean hasPriv = mInMeetingRemoteController.hasRemoteControlPrivilegeWithUserId(myUserId);
    boolean isRc = mInMeetingRemoteController.isRemoteController();
    if (isMe) {
        customShareView.enableRC(hasPriv, isRc);
    }
    Log.d(TAG, "onUserGetRemoteControlPrivilege userId:" + userId + " myUserId:" + myUserId + " hasPriv:" + hasPriv + " isRc:" + isRc);
}

public void onDestroy() {
    if (null != mInMeetingRemoteController) {
        mInMeetingRemoteController.removeListener(this);
    }
}