Skip to content

Commit

Permalink
Release PR (#2320)
Browse files Browse the repository at this point in the history
* feat: web whiteboard docs (#2319)

* feat: whiteboard docs

* fix: link to whiteboard

* Update whiteboard.mdx

* Update whiteboard.mdx

* Update collaborative-whiteboard.mdx

---------

Co-authored-by: ygit <[email protected]>

* Android API reference docs PR (#2323)

Updating the API reference for SDK version

* Android release 2.9.63 (#2324)

* added changes

* Update release-notes.mdx

* Update release-notes.mdx

---------

Co-authored-by: Eswar Prasad Clinton. A <[email protected]>
Co-authored-by: ygit <[email protected]>
Co-authored-by: Mantra Manan Saraswat <[email protected]>
Co-authored-by: Aniket Kadam <[email protected]>
Co-authored-by: Gulzar <[email protected]>
  • Loading branch information
6 people authored Jul 9, 2024
1 parent c4d99b9 commit 590ef13
Show file tree
Hide file tree
Showing 32 changed files with 685 additions and 59 deletions.
5 changes: 5 additions & 0 deletions docs/android/v2/release-notes/release-notes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ import AndroidSdkVersionShield from '@/common/android-sdk-version-shield.md';
| live.100ms:video-filters: |<AndroidSdkVersionShield />|
| live.100ms:virtual-background: |<AndroidSdkVersionShield />|

## v2.9.63 - 2024-07-5

## Fixed
* Join time optimization

## v2.9.62 - 2024-06-26

## Added
Expand Down
2 changes: 1 addition & 1 deletion docs/get-started/v2/get-started/features/whiteboard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ The Whiteboard is part of [100ms' Prebuilt SDKs](/prebuilt/v2/prebuilt/quickstar
- [Android](/android/v2/how-to-guides/extend-capabilities/whiteboard)
- [React Native](/react-native/v2/how-to-guides/extend-capabilities/whiteboard)
- [Flutter](/flutter/v2/how-to-guides/extend-capabilities/whiteboard)
- Web - Coming soon
- [Web](/javascript/v2/how-to-guides/extend-capabilities/whiteboard)

### Using the Whiteboard
Once you’ve enabled and saved the configuration, the Whiteboard can be launched by the peers with launch permissions on any supported device.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
title: Collaborative Whiteboard
title: Collaborative Whiteboard (Deprecated)
nav: 1.51
---

<Note type="warning">
This feature is still in Beta and only available for Web platform. To know more or report any
issues, feel free to reach out to us over{' '}
<a href={'https://discord.com/invite/kGdmszyzq2'}>Discord</a>.
This implementation of collaborative whiteboard using Pusher has been deprecated in favor of using 100ms' own messaging infrastructure. Check the [new whiteboard documentation](/javascript/v2/how-to-guides/extend-capabilities/whiteboard) to know more.
</Note>

## Overview
Expand Down
144 changes: 144 additions & 0 deletions docs/javascript/v2/how-to-guides/extend-capabilities/whiteboard.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
---
title: Whiteboard
nav: 1.52
---

The 100ms SDK provides robust APIs for integrating whiteboard collaboration into your conferencing sessions. Participants can engage in real-time by drawing, writing, and collaborating on a shared digital whiteboard. This documentation outlines how to implement the start and stop functionality for a whiteboard and display it within an iframe or embed it as a React component.

## Requirements

- React 18 or higher
- Webpack 5 or higher if you're using it to bundle your app
- User roles must be configured to enable whiteboard functionality via the 100ms dashboard for starting or viewing the whiteboard. [Refer here](/get-started/v2/get-started/features/whiteboard#enabling-and-configuring-the-whiteboard)
- If you're on React and are not using the `@100mslive/roomkit-react` package, install the `@100mslive/hms-whiteboard` package.
```bash
yarn add @100mslive/hms-whiteboard
```

## Opening and Closing the Whiteboard

<Note type="warning" title="How to know if a role is allowed to open/close whiteboard">
Javascript users can use the `selectPermissions` selector which fetches the whiteboard specific permissions array from the local peer's role permissions.

React users can check for the `toggle` function returned by the utility hook `useWhiteboard`.

</Note>

<Tabs id="toggle" items={['JavaScript', 'React']} />

<Tab id='toggle-0'>

```js
import { selectPermissions, selectWhiteboard } from '@100mslive/hms-video-store';

const permissions = hmsStore.getState(selectPermissions)?.whiteboard; // Array<'read' | 'write' | 'admin'>
const isAdmin = !!permissions?.includes('admin');
const whiteboard = hmsStore.getState(selectWhiteboard);
const isOwner = whiteboard?.owner === localPeerUserId;

const toggle = async () => {
if (!isAdmin) {
return;
}

if (whiteboard?.open) {
isOwner && (await actions.interactivityCenter.whiteboard.close());
} else {
await actions.interactivityCenter.whiteboard.open();
}
};

// usage
const toggleButton = document.getElementById('toggle-whiteboard');
// non-admin users cannot toggle the whiteboard
toggleButton.disabled = !isAdmin;
toggleButton.onclick = toggle;
```
</Tab>
<Tab id='toggle-1'>
```jsx
import React from 'react';
import { useWhiteboard } from '@100mslive/react-sdk';

export const WhiteboardToggle = () => {
const { toggle, open, isOwner } = useWhiteboard();

// non-admin users cannot toggle the whiteboard
if (!toggle) {
return null;
}

return (
<Button onClick={toggle} active={!open} disabled={open && !isOwner}>
Toggle Whitboard
</Button>
);
};
```
</Tab>
## Displaying the Collaborative Whiteboard
You can display the whiteboard when it's open by embedding it as an iframe or as a React component for more fine grained controls, if your app is built using React.
<Tabs id="display" items={['JavaScript', 'React']} />
<Tab id='display-0'>
```js
import { selectWhiteboard } from '@100mslive/hms-video-store';

const whiteboard = hmsStore.subscribe((whiteboard) => {
if (whiteboard?.open && whiteboard?.url) {
const whiteboardIframe = document.createElement('iframe');
whiteboardIframe.src = whiteboard.url;
} else {
const whiteboardIframe = document.getElementById('whiteboard');
whiteboardIframe?.remove();
}
}, selectWhiteboard);
```
</Tab>
<Tab id='display-1'>
```jsx
import React from 'react';
import { useWhiteboard } from '@100mslive/react-sdk';
import { Whiteboard } from '@100mslive/hms-whiteboard';
import '@100mslive/hms-whiteboard/index.css';

const WhiteboardEmbed = () => {
const { token, endpoint } = useWhiteboard();

if (!token) {
return null;
}

return (
<div style={{ width: '100%', height: '650px' }}>
<Whiteboard
token={token}
endpoint={`https://${endpoint}`}
onMount={({ store, editor }) => {
console.log(store, editor);
}}
/>
</div>
);
};
```
</Tab>
<Note type="warning" title="CSS Styling required for Whiteboard">
Whiteboard related CSS needs to be imported in your app's top level CSS files using `@import '@100mslive/hms-whiteboard/index.css';`(recommended) or in one of your top level JS file using `import '@100mslive/hms-whiteboard/index.css';`.
Note that if you're using `@100mslive/roomkit-react` you'll need to import `@100mslive/roomkit-react/index.css` accordingly.
</Note>
18 changes: 14 additions & 4 deletions public/api-reference/android/v2/hls-player/navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,11 @@
<a href="../lib/live.hms.video.factories/-h-m-s-video-decoder-factory/index.html"><span class="nav-link-grid"><span class="nav-link-child nav-icon class-kt"></span><span class="nav-link-child"><span>HMSVideo</span><wbr><span>Decoder</span><wbr><span><span>Factory</span></span></span></span></a>
</div>
</div>
<div class="sideMenuPart" id="lib-nav-submenu-14-1" pageid="lib::live.hms.video.factories/SafeVariable///PointingToDeclaration//1464059712">
<div class="overview">
<a href="../lib/live.hms.video.factories/-safe-variable/index.html"><span class="nav-link-grid"><span class="nav-link-child nav-icon class-kt"></span><span class="nav-link-child"><span>Safe</span><wbr><span><span>Variable</span></span></span></span></a>
</div>
</div>
</div>
<div class="sideMenuPart" id="lib-nav-submenu-15" pageid="lib::live.hms.video.factories.noisecancellation////PointingToDeclaration//1464059712">
<div class="overview">
Expand Down Expand Up @@ -3142,17 +3147,22 @@
<a href="../lib/live.hms.video.utils/to-map.html"><span class="nav-link-grid"><span class="nav-link-child nav-icon function"></span><span class="nav-link-child"><span>to</span><wbr><span><span>Map()</span></span></span></span></a>
</div>
</div>
<div class="sideMenuPart" id="lib-nav-submenu-46-29" pageid="lib::live.hms.video.utils/WertcAudioUtils///PointingToDeclaration//1464059712">
<div class="sideMenuPart" id="lib-nav-submenu-46-29" pageid="lib::live.hms.video.utils//traceTime/#kotlin.String#kotlin.Function0[TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration//1464059712">
<div class="overview">
<a href="../lib/live.hms.video.utils/trace-time.html"><span class="nav-link-grid"><span class="nav-link-child nav-icon function"></span><span class="nav-link-child"><span>trace</span><wbr><span><span>Time()</span></span></span></span></a>
</div>
</div>
<div class="sideMenuPart" id="lib-nav-submenu-46-30" pageid="lib::live.hms.video.utils/WertcAudioUtils///PointingToDeclaration//1464059712">
<div class="overview">
<span class="navButton" onclick="document.getElementById(&quot;lib-nav-submenu-46-29&quot;).classList.toggle(&quot;hidden&quot;);"><span class="navButtonContent"></span></span><a href="../lib/live.hms.video.utils/-wertc-audio-utils/index.html"><span class="nav-link-grid"><span class="nav-link-child nav-icon class-kt"></span><span class="nav-link-child"><span>Wertc</span><wbr><span>Audio</span><wbr><span><span>Utils</span></span></span></span></a>
<span class="navButton" onclick="document.getElementById(&quot;lib-nav-submenu-46-30&quot;).classList.toggle(&quot;hidden&quot;);"><span class="navButtonContent"></span></span><a href="../lib/live.hms.video.utils/-wertc-audio-utils/index.html"><span class="nav-link-grid"><span class="nav-link-child nav-icon class-kt"></span><span class="nav-link-child"><span>Wertc</span><wbr><span>Audio</span><wbr><span><span>Utils</span></span></span></span></a>
</div>
<div class="sideMenuPart" id="lib-nav-submenu-46-29-0" pageid="lib::live.hms.video.utils/WertcAudioUtils.Companion///PointingToDeclaration//1464059712">
<div class="sideMenuPart" id="lib-nav-submenu-46-30-0" pageid="lib::live.hms.video.utils/WertcAudioUtils.Companion///PointingToDeclaration//1464059712">
<div class="overview">
<a href="../lib/live.hms.video.utils/-wertc-audio-utils/-companion/index.html"><span class="nav-link-grid"><span class="nav-link-child nav-icon object"></span><span class="nav-link-child"><span><span>Companion</span></span></span></span></a>
</div>
</div>
</div>
<div class="sideMenuPart" id="lib-nav-submenu-46-30" pageid="lib::live.hms.video.utils/YuvFrame///PointingToDeclaration//1464059712">
<div class="sideMenuPart" id="lib-nav-submenu-46-31" pageid="lib::live.hms.video.utils/YuvFrame///PointingToDeclaration//1464059712">
<div class="overview">
<a href="../lib/live.hms.video.utils/-yuv-frame/index.html"><span class="nav-link-grid"><span class="nav-link-child nav-icon class"></span><span class="nav-link-child"><span>Yuv</span><wbr><span><span>Frame</span></span></span></span></a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,11 @@
<a href="../lib/live.hms.video.factories/-h-m-s-video-decoder-factory/index.html"><span class="nav-link-grid"><span class="nav-link-child nav-icon class-kt"></span><span class="nav-link-child"><span>HMSVideo</span><wbr><span>Decoder</span><wbr><span><span>Factory</span></span></span></span></a>
</div>
</div>
<div class="sideMenuPart" id="lib-nav-submenu-14-1" pageid="lib::live.hms.video.factories/SafeVariable///PointingToDeclaration//1464059712">
<div class="overview">
<a href="../lib/live.hms.video.factories/-safe-variable/index.html"><span class="nav-link-grid"><span class="nav-link-child nav-icon class-kt"></span><span class="nav-link-child"><span>Safe</span><wbr><span><span>Variable</span></span></span></span></a>
</div>
</div>
</div>
<div class="sideMenuPart" id="lib-nav-submenu-15" pageid="lib::live.hms.video.factories.noisecancellation////PointingToDeclaration//1464059712">
<div class="overview">
Expand Down Expand Up @@ -3142,17 +3147,22 @@
<a href="../lib/live.hms.video.utils/to-map.html"><span class="nav-link-grid"><span class="nav-link-child nav-icon function"></span><span class="nav-link-child"><span>to</span><wbr><span><span>Map()</span></span></span></span></a>
</div>
</div>
<div class="sideMenuPart" id="lib-nav-submenu-46-29" pageid="lib::live.hms.video.utils/WertcAudioUtils///PointingToDeclaration//1464059712">
<div class="sideMenuPart" id="lib-nav-submenu-46-29" pageid="lib::live.hms.video.utils//traceTime/#kotlin.String#kotlin.Function0[TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration//1464059712">
<div class="overview">
<a href="../lib/live.hms.video.utils/trace-time.html"><span class="nav-link-grid"><span class="nav-link-child nav-icon function"></span><span class="nav-link-child"><span>trace</span><wbr><span><span>Time()</span></span></span></span></a>
</div>
</div>
<div class="sideMenuPart" id="lib-nav-submenu-46-30" pageid="lib::live.hms.video.utils/WertcAudioUtils///PointingToDeclaration//1464059712">
<div class="overview">
<span class="navButton" onclick="document.getElementById(&quot;lib-nav-submenu-46-29&quot;).classList.toggle(&quot;hidden&quot;);"><span class="navButtonContent"></span></span><a href="../lib/live.hms.video.utils/-wertc-audio-utils/index.html"><span class="nav-link-grid"><span class="nav-link-child nav-icon class-kt"></span><span class="nav-link-child"><span>Wertc</span><wbr><span>Audio</span><wbr><span><span>Utils</span></span></span></span></a>
<span class="navButton" onclick="document.getElementById(&quot;lib-nav-submenu-46-30&quot;).classList.toggle(&quot;hidden&quot;);"><span class="navButtonContent"></span></span><a href="../lib/live.hms.video.utils/-wertc-audio-utils/index.html"><span class="nav-link-grid"><span class="nav-link-child nav-icon class-kt"></span><span class="nav-link-child"><span>Wertc</span><wbr><span>Audio</span><wbr><span><span>Utils</span></span></span></span></a>
</div>
<div class="sideMenuPart" id="lib-nav-submenu-46-29-0" pageid="lib::live.hms.video.utils/WertcAudioUtils.Companion///PointingToDeclaration//1464059712">
<div class="sideMenuPart" id="lib-nav-submenu-46-30-0" pageid="lib::live.hms.video.utils/WertcAudioUtils.Companion///PointingToDeclaration//1464059712">
<div class="overview">
<a href="../lib/live.hms.video.utils/-wertc-audio-utils/-companion/index.html"><span class="nav-link-grid"><span class="nav-link-child nav-icon object"></span><span class="nav-link-child"><span><span>Companion</span></span></span></span></a>
</div>
</div>
</div>
<div class="sideMenuPart" id="lib-nav-submenu-46-30" pageid="lib::live.hms.video.utils/YuvFrame///PointingToDeclaration//1464059712">
<div class="sideMenuPart" id="lib-nav-submenu-46-31" pageid="lib::live.hms.video.utils/YuvFrame///PointingToDeclaration//1464059712">
<div class="overview">
<a href="../lib/live.hms.video.utils/-yuv-frame/index.html"><span class="nav-link-grid"><span class="nav-link-child nav-icon class"></span><span class="nav-link-child"><span>Yuv</span><wbr><span><span>Frame</span></span></span></span></a>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
<title>SafeVariable</title>
<link href="../../../images/logo-icon.svg" rel="icon" type="image/svg"><script>var pathToRoot = "../../../";</script> <script>const storage = localStorage.getItem("dokka-dark-mode")
if (storage == null) {
const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
if (osDarkSchemePreferred === true) {
document.getElementsByTagName("html")[0].classList.add("theme-dark")
}
} else {
const savedDarkMode = JSON.parse(storage)
if(savedDarkMode === true) {
document.getElementsByTagName("html")[0].classList.add("theme-dark")
}
}
</script>
<script type="text/javascript" src="../../../scripts/sourceset_dependencies.js" async></script>
<link href="../../../styles/style.css" rel="Stylesheet">
<link href="../../../styles/jetbrains-mono.css" rel="Stylesheet">
<link href="../../../styles/main.css" rel="Stylesheet">
<link href="../../../styles/prism.css" rel="Stylesheet">
<link href="../../../styles/logo-styles.css" rel="Stylesheet">
<script type="text/javascript" src="../../../scripts/clipboard.js" async></script>
<script type="text/javascript" src="../../../scripts/navigation-loader.js" async></script>
<script type="text/javascript" src="../../../scripts/platform-content-handler.js" async></script>
<script type="text/javascript" src="../../../scripts/main.js" defer></script>
<script type="text/javascript" src="../../../scripts/prism.js" async></script>
<script type="text/javascript" src="../../../scripts/symbol-parameters-wrapper_deferred.js" defer></script></head>
<body>
<div class="navigation-wrapper" id="navigation-wrapper">
<div id="leftToggler"><span class="icon-toggler"></span></div>
<div class="library-name">
<a href="../../../index.html">
<span>Android SDK 100ms</span> </a> </div>
<div>
</div>
<div class="pull-right d-flex">
<button id="theme-toggle-button"><span id="theme-toggle"></span></button>
<div id="searchBar"></div>
</div>
</div>
<div id="container">
<div id="leftColumn">
<div id="sideMenu"></div>
</div>
<div id="main">
<div class="main-content" id="content" pageids="lib::live.hms.video.factories/SafeVariable/SafeVariable/#/PointingToDeclaration//1464059712">
<div class="breadcrumbs"><a href="../../index.html">lib</a><span class="delimiter">/</span><a href="../index.html">live.hms.video.factories</a><span class="delimiter">/</span><a href="index.html">SafeVariable</a><span class="delimiter">/</span><span class="current">SafeVariable</span></div>
<div class="cover ">
<h1 class="cover"><span>Safe</span><wbr><span><span>Variable</span></span></h1>
</div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":lib:dokkaHtmlPartial/release"><div class="symbol monospace"><span class="token keyword"></span><span class="token keyword">fun </span><a href="-safe-variable.html"><span class="token function">SafeVariable</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span></div></div></div>
</div>
<div class="footer">
<span class="go-to-top-icon"><a href="#content" id="go-to-top-link"></a></span><span>© 2024 Copyright</span><span class="pull-right"><span>Generated by </span><a href="https://github.com/Kotlin/dokka"><span>dokka</span><span class="padded-icon"></span></a></span>
</div>
</div>
</div>

</body></html>

Loading

0 comments on commit 590ef13

Please sign in to comment.