Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: 04oct23 release notes #1795

Merged
merged 14 commits into from
Oct 10, 2023
14 changes: 14 additions & 0 deletions docs/javascript/v2/changelog/release-notes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ description: Release Notes for 100ms JavaScript SDK
| @100mslive/hms-video-react(deprecated) | [![npm version](https://badge.fury.io/js/%40100mslive%2Fhms-video-react.svg)](https://badge.fury.io/js/%40100mslive%2Fhms-video-react) |


## 2023-10-04
Released: `@100mslive/[email protected]`, `@100mslive/[email protected]`, `@100mslive/[email protected]`, `@100mslive/[email protected]`

### Added:
- [New API](/javascript/v2/how-to-guides/set-up-video-conferencing/peerlist-optimizations) for handling peer list in large rooms
- Reduced time taken for updating the hls live status
raviteja83 marked this conversation as resolved.
Show resolved Hide resolved
- Roomkit Prebuilt: Prebuilt now shows a warning to users trying to use the prebuilt in mweb landscape mode. Warning requests users to use Portrait mode. We plan to fix Landscape UI in the coming releases.

### Fixed:
- Events not getting logged to analytics when audio/video permissions are denied
- Error codes not getting added in some exceptions.
- Autoplay handling for hls in Prebuilt

## 2023-09-22
Released: `@100mslive/[email protected]`, `@100mslive/[email protected]`, `@100mslive/[email protected]`, `@100mslive/[email protected]`

Expand Down Expand Up @@ -73,6 +86,7 @@ Released: `@100mslive/[email protected]`, `@100mslive/[email protected]`, `

### Fixed:
- `selectIsLocalVideoEnabled` returning true when permissions denied
- `hmsActions.setVolume` not working when a value between 0 and 100 is set

## 2023-07-25
Released: `@100mslive/[email protected]`, `@100mslive/[email protected]`, `@100mslive/[email protected]`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
title: Handling peerlist in large room
nav: 1.23
---

Prerequisites:

**Minimum required [SDK version](../../changelog/release-notes#2023-10-04)**

In case of large rooms(more than 2.5k peers), it does not make sense to show all the peers at once as the peers of interest would be limited. So we updated our implementation
to show peers of interest(peers with publish permissions, peers who handraised) in the initial peer list.

However, if you wish to query for additional peers, we introduced new set of API's to achieve this.

```ts
interface HMSPeerListIteratorOptions {
role?: HMSRoleName;
group?: HMSGroupName;
peerIds?: string[];
limit?: number; // max 100 and defaults to 10
}

interface HMSPeerListIterator {
hasNext(): boolean;
next(): Promise<HMSPeer[]>;
getTotal(): number;
findPeers(): Promise<HMSPeer[]>;
}
```


<Tabs id="large-room-peers" items={['Javascript', 'React']} />

<Tab id='large-room-peers-0'>

```js
let peers;
async function PaginatedParticipants() {
const iterator = hmsActions.getPeerListIterator({ role: 'roleName', limit: 20 });
const peers = await iterator.findPeers(); // this will give you initial set of peers
// to check if there are more peers
const hasNext = iterator.hasNext();
// To fetch more peers from this point, you can call:
peers = peers.concat(await iterator.next());
}
```

</Tab>

<Tab id='large-room-peers-1'>

```jsx
import { usePaginatedParticipants } from '@100mslive/react-sdk';

const PaginatedPeers = () => {
const { peers, total, loadPeers, loadMorePeers } = usePaginatedParticipants({ role: roleName, limit: 20 });
// to check if there are more peers
const hasNext = total > peers.length;
raviteja83 marked this conversation as resolved.
Show resolved Hide resolved

useEffect(() => {
loadPeers();
}, []);

return (
<>
{peers.map(peer => <div>{peer.name}</div>)}
</>
)
};

// You can add a load more button or infinite pagination and make the call to loadMorePeers in the above implementation to get the next peers.
```

</Tab>


> NOTE: The data given by the API might become stale, so it is recommended to poll the `iterator.findPeers()` for Javascript and `loadPeers()` for React, so that if any peer
has left it would be updated
Loading