Session Controllers
Zoho Lens SDK provides the following controls to the user:
- Session State Functions
- Audio/Video Functions
- AR Functions
- Annotation Functions
- Scan Functions
- Miscellaneous Functions
Session State Functions
- LensSDK.setToken(context: Context, token: String) - To specify the context for LensSDK & the SDK token to be used to validate sessions.
- LensSDK.setCallbackListener(callback: ISessionCallback)- Used to set the callback handler that will receive the callbacks from LensSDK
- LensSDK.setARMode(flag: Boolean) - Used to specify the mode in which the session should be started.
- LensSDK.addStreamingView(view: View) - Used to add the rendering view, which will be used to display local and remote view.
- LensSDK.setUserInfo(info: UserInfo) - Used to set the user information.
- LensSDK.startSession(sessionKey: String, baseUrl: String) - Used to validate the session key and SDK token. `sessionConnectionState` callback will be called with success or error after validation is completed.
- LensSDK.joinSession() - Used to join a successfully validated session.
- LensSDK.closeSession() - Used to close the session.
Audio/Video Functions
- LensSDK.muteVideo(flag: Boolean) - Used to mute the video stream if the flag is true, or unmute if flag is false.
- LensSDK.muteAudio(flag: Boolean) - Used to mute the audio stream if the flag is true, or unmute if flag is false.
- LensSDK.switchAudioMode(device: AudioDevice)- Switch the audio device that is currently used for the session. The possible values for `AudioDevice` are,
- AudioDevice.SPEAKER_PHONE
- AudioDevice.EARPIECE
- AudioDevice.BLUETOOTH
- AudioDevice.BLUETOOTH
- AudioDevice.NONE
- LensSDK.onSwapCamera() - Swaps the video stream between the front and rear cameras.
- LensSDK.isCameraFrontFacing() - Used to determine if the front camera is being streamed.
- LensSDK.setZoomPercentage(value: Float) - Set the zoom level of the camera. The value must be in the range [0f, 1f]. Default value is 0f.
setZoomPercentage(value) is only available in AR mode. - LensSDK.shareCameraRequest() - Shares the camera stream of the user.
- LensSDK.stopCameraRequest() - Stops streaming the camera.
AR Functions
- LensSDK.isARMode() - Returns true if the current streamer is in AR mode, else it will return false.
- LensSDK.setResolution(flag: Boolean) - Used to set the resolution quality of AR camera stream. The flag needs to be set to `true` for high resolution & `false` for low resolution.
- LensSDK.getResolution() - Used to get the resolution quality of the AR camera stream. Function will return `true` for high resolution & `false` for low resolution.
- LensSDK.setPlaneDetection(flag: Boolean) - Used to show planes that have been detected during an AR session. The flag needs to be set to `true` to show planes & `false` to hide planes.
- LensSDK.setPointCloud(flag: Boolean) - Used to show the feature points that have been detected during an AR session. The flag needs to be set to `true` to show feature points & `false` to hide them.
Annotation Functions
- LensSDK.setAnnotationColor(colorCode: String) - Used to set the color of the annotation.
- LensSDK.setAnnotationDrawStyle(style: AnnotationType, colorCode: Any, size: Float) - Used to set the style of the 2D annotation.
- LensSDK.clearAllAnnotations() - Used to clear all the annotations drawn by the user.
- LensSDK.undoAnnotation() - Used to undo the last annotation drawn by the user. Only available for AR annotations.
- LensSDK.clearSelectedAnnotations() - Used to clear the currently selected annotation. Only available for AR annotations.
Scan Functions
- LensSDK.requestOCR() - Used to initiate OCR request, after processing the request, the success/error response will be informed via `onOCRStateChanged` callback.
- LensSDK.requestQR(retryMode: QRHandler.RetryMode) - Used to initiate QR request to detect QR/Barcodes, the success/error response will be informed via `onQRSuccess` & `onQRFailure`. `RetryMode` is used to determine what happens when QR scan fails. The possible values for `RetryMode` are,
- NONE - Scan will not be retried.
- RETRY_CONTINOUSLY - Will repeatedly try to scan for QR/Barcodes upon failure.
- RETRY_UNTIL_TIME_LIMIT - Will repeatedly try to scan for QR/Barcode for upto 10 seconds.
- LensSDK.cancelQRRequest() - Used to cancel the currently running QR request.
Miscellaneous Functions
- LensSDK.getCurrentStreamingUserName() - Returns the name of the currently streaming user.
- LensSDK.sendMessage(chatMessage: String) - Used to send a chat message to the other participants in the session.
- LensSDK.getChatLetView() - To obtain the webview of the chat.
- LensSDK.refreshChatLet() - To refresh the chat page.
- LensSDK.sendMessageThroughChatLet(rawMessage: String, senderName: String) - To send a message to chat via webview from a notification, live text, or QR result.
- LensSDK.getChatLetEnabled() - To check if webview based chat is supported and enabled.
- LensSDK.attachFileCallBackForChat(toTypedArray: Array
?) - To attach files for chat. - LensSDK.getFlashSupportEnabled - Used to determine whether flash is supported, when technician is streaming camera.
- LensSDK.getFlashLightStatus - Used to get the current status of the flash for technician who is streaming camera.
- LensSDK.setFlashOn - Used to switch on the flash for technician who is streaming camera.
- LensSDK.setFlashOff - Used to switch off the flash for technician who is streaming camera.