Skip to content

Commit

Permalink
Update whiteboard.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
gulzar1996 committed Apr 9, 2024
1 parent f69f527 commit 75e5629
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/android/v2/how-to-guides/extend-capabilities/whiteboard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,13 @@ In this case, you can implement the necessary logic to handle the stop of the wh

## Starting whiteboard
To start a whiteboard, ensure that the role has the appropriate permission and the current whiteboard is not already open.
The callback will be sent to `setWhiteboardUpdateListener()`.
The callback will be sent as `HMSWhiteboardUpdate.Start` in `setWhiteboardUpdateListener()`.

> Note: Remember to check if the peer starting whiteboard has owner permission
```kotlin
val currentWhiteBoardModel : HMSWhiteboard? = //you can get HMSWhiteboard model from HMSWhiteboardUpdate

//make sure you the current whiteboard is not opened by someone else
if (currentWhiteBoardModel?.isOpen == true && currentWhiteBoardModel.isOwner.not())
return


if (currentWhiteBoardModel == null || currentWhiteBoardModel?.isOpen == false) {
localHmsInteractivityCenter.startWhiteboard(
Expand All @@ -104,7 +102,7 @@ if (currentWhiteBoardModel == null || currentWhiteBoardModel?.isOpen == false) {
## Stopping whiteboard

To stop currently opened whiteboard make sure the role has appropriate permission and the current whiteboard session is opened by the user.
The callback will be sent to `setWhiteboardUpdateListener()`.
The callback will be sent as `HMSWhiteboardUpdate.Stop` in `setWhiteboardUpdateListener()`.


```kotlin
Expand All @@ -126,6 +124,8 @@ if (currentWhiteBoardModel?.isOpen == true) {

If the `isOwner` is true in `HMSWhiteboard` model then user has to refresh and close the `WebView` to make the whiteboard session stop.

> Note: Only owner can close the currently opened whiteboard session
```kotlin
webview?.loadUrl(")
```

0 comments on commit 75e5629

Please sign in to comment.