How-to: Setup the app for Laser Pointer
  • 25 Apr 2023
  • 1 Minute to read
  • Dark
    Light
  • PDF

How-to: Setup the app for Laser Pointer

  • Dark
    Light
  • PDF

Article summary

The Laser Pointer feature allows for the agent to indicate to the end-user where on the app the user's attention should be focused.

  1. Join the ScreenMeet Live Call session
ScreenMeet.connect(  
    code = "YOUR SESSION CODE",  
    localUserName = "John Doe",  
    completion = completion  
)
  1. Subscribe to session events with the SessionEventListener and override required methods.
ScreenMeet.registerEventListener(object : SessionEventListener {  
  
    override fun onConnectionStateChanged(newState: ScreenMeet.ConnectionState) {  
        super.onConnectionStateChanged(newState)  
    }  
  
})
  1. Start sharing the screen with the agent
ScreenMeet.shareScreen()
  1. The agent can request Laser Pointer from the their browser interface. By default, the SDK displays a permission dialog. This behavior can be further customized.
    Drawing.sketchpad.jpeg{height="" width="600"}
    Screenshot from 2023-04-25 16-28-57.png

  2. If the end-user accepts the dialog, they will be prompted to give permssions for the app to "Display over other apps". This permission is required for the Laser Pointer to be drawn on the end-user's screen.
    Drawing-1.sketchpad.jpeg

Events and Customization

For listening to Laser Pointer and Remote Control events, use the following methods in SessionEventListenener:

object: SessionEventListener {

	// Ovveride this method to handle Feature Request yourself   
	// instead of showing Dialog provided in ScreenMeet SDK
	override fun onFeatureRequest(
		feature: Feature, 
		decisionHandler: (granted: Boolean) -> Unit
	) {
	    decisionHandler.invoke(true) // Grants feature permission
	}  
	  
	override fun onFeatureRequestRejected(entitlement: Entitlement) {  
		// Called when pending Feature Request is canceled on Viewer
	}  
	  
	override fun onFeatureStarted(feature: Feature) {  
		 // Called when pending Feature Started
	}  
	  
	override fun onFeatureStopped(feature: Feature) {  
		 // Called when pending Feature Stopped
	}
}

Was this article helpful?

What's Next