@solyd/jitsi-sdk
v4.0.7
Published
* State saved in react context * SDK should be based on hooks and not provide any frontend code
Downloads
1
Readme
Solyd Client SDK
State saved in react context
SDK should be based on hooks and not provide any frontend code
TODO: how to disconnect (connected variable and execute leave method on hangup?)
Notification should include user avatar with fallback to favicon
disconnect and reconnect if token has changed and already connected
electron events on leave to trigger window closing
Install
npm install react react-redux redux @solyd/jitsi-sdk
# or
yarn add react react-redux redux @solyd/jitsi-sdk
Usage
import { useSolyd, Track, SolydProvider } from '@solyd/jitsi-sdk';
const MyClient = () => {
const { connected, muted, setMuted, participants } = useSolyd({
endpoint: process.env.JITSI_HOSTNAME,
token: 'hj85ingmg9950tjmmvdrpo90jgpo'
});
return connected ? (
<div>
{participants.map(({ avatar, tracks }) => (
<>
<image src={avatar} />
{tracks.map((track) => <Track track={track} />)}
</>
))}
<button onClick={() => setMuted(!muted)}>
{muted ? 'muted' : 'mute'}
</button>
</div>
): null;
};
const App = () => (
<SolydProvider>
<MyClient />
</SolydProvider>
);