Programmatically allow remote participants to annotate my screen

I’ve searched the forum and can’t seem to find the answer I am looking for.

I want a remote user to be able to annotate my entire Android screen. When I use the screen share toolbar, this works great. After sharing my screen via InMeetingShareController, I click on the Annotation option in the screen share toolbar. Then on the remote side of the meeting, users can go under View Options->Annotate and then draw on my Android screen, even when I switch to a different app. So far so good, exactly what I want.

The problem is, my app has a custom UI and I have hidden the screen share toolbar with:

    MeetingSettingsHelper.hideAnnotationInScreenShareToolbar(true);
    MeetingSettingsHelper.hideStopShareInScreenShareToolbar(true);

When the Android user shares their screen, I want to programmatically do whatever the Annotation button is doing in the screen share toolbar. I was hoping it was as simple as calling:

    InMeetingAnnotationController.startAnnotation();

However this doesn’t do anything. SDKERR_OTHER_ERROR is being returned. The remote user can draw on my shared screen, but after a few seconds the drawing disappears on their end and it never shows up on the Android side. Even if I allow the screen share toolbar to remain on the screen, startAnnotation() returns an error.

I’m assuming I need to do more setup before calling startAnnotation(). Perhaps configure some kind of screen overlay that can display the drawings? I’ve attempted to add a MobileRTCShareView as a shared whiteboard to the screen overlay, but that only results in covering my entire Android screen in white and even then the remote user can’t draw to it. So I don’t think that is the correct path.

I must be missing something simple. If I knew what the Annotation button in the screen share toolbar was doing internally this would be a lot easier! Any suggestions or documentation on how to programmatically enable annotations for remote participants?

Using SDK v5.4.3.613

Hi @vuzix_greg, thanks for the detailed description.

Before calling startAnnotation can you please try checking the following values within the InMeetingAnnotationController class?

  • canDoAnnotation
  • isPresenter
  • isViewerAnnotationDisabled

Thanks!

@jon.zoom you got it. Here is what I’m seeing:

canDoAnnotation(): true
isPresenter(): false
isViewerAnnotationDisabled(): false
startAnnotation(): SDKERR_OTHER_ERROR

These are the values returned when I am the active participant who is sharing. Not sure why isPresenter() is false or how to make it true. This is the first time I’ve seen the term “presenter” in the API.

Hi, @vuzix_greg Did you call InMeetingShareController.startShareViewContent(MobileRTCShareView shareView) method?

1 Like

@donny.bao Thanks for the tip! I was only calling startShareScreenSession(Intent) and passing in the data returned from MediaProjectionManager. So I added an empty MobileRTCShareView to my layout and called startShareViewContent() right before calling startAnnotation() and the behavior has changed:

canDoAnnotation(): true
isPresenter(): true
isViewerAnnotationDisabled(): false
startAnnotation(): SDKERR_SUCCESS

I can finally see the remote desktop annotations show up in my app! Now I just need to move the MobileRTCShareView out of my layout and into a system overlay and I should have annotations working system wide on the Android side!

Thank you for the prompt help, it is very much appreciated!

Glad to hear it’s working!

Please let us know if you need any additional help.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.