# Add video capability to the Contact Center SDK for Android After initializing the SDK, call the `getZoomCCVideoService` (Java) or `zoomCCVideoService` (Kotlin) function to get `ZoomCCVideoService` and initialize it with the chat entry ID. Then call `fetchUI` to open the `WaitingRoom` view. ## Show video from the requesting server ```java ZoomCCChatService service = ZoomCCInterface.INSTANCE.getZoomCCVideoService(); service.init("VideoEntryId"); service.fetchUI(); ``` ```kotlin val service = ZoomCCInterface.INSTANCE.zoomCCVideoService service.init("VideoEntryId") service.fetchUI() ``` ## End video ```java ZoomCCChatService service = ZoomCCInterface.INSTANCE.getZoomCCChatService(); service.endVideo(); ``` ```kotlin val service = ZoomCCInterface.INSTANCE.zoomCCVideoService service.endVideo() ``` ### Log off of the service If you don't want to receive further callbacks from the SDK, call `logoff()`. ```java ZoomCCVideoService videoService = ZoomCCInterface.INSTANCE.getZoomCCVideoService(); videoService.logoff(); ``` ```kotlin var videoService = ZoomCCInterface.INSTANCE.zoomCCVideoService videoService.logoff() ``` ### Release SDK resources To release SDK resources, call `releaseZoomCCService` in `onDestroy()`. ```java protected void onDestroy() { ZoomCCInterface.INSTANCE.releaseZoomCCService("VideoEntryId"); super.onDestroy(); } ``` ```kotlin override fun onDestroy() { ZoomCCInterface.INSTANCE.releaseZoomCCService("VideoEntryId") super.onDestroy() } ``` ## Forcibly end an active video engagement To forcibly end a video engagement, use the endVideo method. This action closes the video view and releases any associated service instances within the Contact Center SDK. ```java ZoomCCChatService service = ZoomCCInterface.INSTANCE.getZoomCCChatService(); service.endVideo(); ``` ```kotlin val service = ZoomCCInterface.INSTANCE.zoomCCVideoService service.endVideo() ``` ## Callbacks These callbacks are available for both chat and video. Implement listeners and see the available callback functions. ### Implement a listener To subscribe to these events, define your own instance of the `ZoomCCChatListener` object and add it to the SDK by calling the `addListener` function. See how to implement this listener and assign it to the SDK instance, along with examples of the event handlers associated with the SDK. #### Add a listener ```java ZoomCCChatService service = ZoomCCInterface.INSTANCE.getZoomCCChatService(); service.addListener(your listener); ``` ```kotlin val service = ZoomCCInterface.INSTANCE.zoomCCChatService service.addListener(your listener) ``` ### Callback functions These examples show callback functions provided by the Contact Center SDK. Use these functions and implement any additional operations as needed after receiving the result of the callback function. #### `onLoginStatus` Get login status. - `entryId` - (integer) the entry ID. - `status` - the login status. #### `onError` Login failed. - `entryId` - (string) the entry ID. - `error` - (integer) the service error code. See [errors](/docs/contact-center/android/errors/) for details. - `detail` - (long) the error code. #### `onEngagementStart` Sent after the service creates an engagement. - `engagementId` - (string) the engagement identifier. #### `onEngagementEnd` Sent after the engagement ends. - `engagementId` - (string) the engagement identifier. #### `unreadMsgCountChanged` Sent when the number of unread messages changes. - `unreadMsgCountChanged` - (integer) the number of unread messages. #### `onClientEvent` Called when `VIDEO_STARTED`, `VIDEO_END`, `NOTIFICATION_JOIN_CALL`, `VIDEO_CLIENT_END`, `VIDEO_FORCE_END`, and `TASK_CREATED` events are triggered. - `ClientEvent` - (integer)