Skip to content

Commit

Permalink
Merge branch 'qa' into flutter/transcription
Browse files Browse the repository at this point in the history
  • Loading branch information
Decoder07 authored Jun 26, 2024
2 parents 3ce5eda + 1f3cf83 commit a52fc44
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions docs/javascript/v2/quickstart/prebuilt-quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,41 @@ HMSPrebuilt accepts the following props:
- `userId` (optional): The user ID to be assigned to the peer.


## Accessing events, states and more

HMSPrebuilt accepts a ref which is assigned the following:
```
{
hmsActions,
hmsStats,
hmsStore,
hmsNotifications,
};
```

You can then listen to events, subscribe to states as required in the parent code.

```
import { selectRoomState } from '@100mslive/hms-video-store';
import { HMSPrebuilt } from '@100mslive/roomkit-react';
import { useEffect, useRef } from 'react';
import { getRoomCodeFromUrl } from './utils';
export default function App() {
const roomCode = getRoomCodeFromUrl();
const prebuiltRef = useRef(null);
useEffect(() => {
if (prebuiltRef.current) {
prebuiltRef.current.hmsNotifications.onNotification(msg => console.log(msg));
prebuiltRef.current.hmsStore.subscribe(currentRoomState => console.log(currentRoomState), selectRoomState);
}
}, []);
return <HMSPrebuilt roomCode={roomCode} ref={prebuiltRef} />;
}
```

## Deploying with customization

To further customize the prebuilt UI, [the repository](https://github.com/100mslive/web-sdks) can be easily forked and edited. The README lists the steps and commands needed for the same, including deployment.

0 comments on commit a52fc44

Please sign in to comment.