npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ringcentral/video-sdk-react

v0.4.0

Published

The RingCentral Client Video SDK makes it easy to do the collaborative audio calling, video calling, and screen sharing based on the RingCentral platform service.

Downloads

21

Readme

RingCentral Client Video SDK React Components Library

The RingCentral Client Video SDK makes it easy to do the collaborative audio calling, video calling, and screen sharing based on the RingCentral platform service.

The RingCentral Client Video SDK React Component Library supplies client-side state management and reusable UI components for common web interfaces used in audio and video conferencing applications, including:

  • ActionBar
  • Baisc Actions
    • AudioAction
    • VideoAction
    • MeetingInfoAction
    • ParticipantAction
    • LogoIcon
    • ScreenSharingAction
    • InviteAction
    • LeaveAction
  • Advanced Actions
    • ChatAction
    • RecordAction
    • MoreAction
    • ClosedCaptionAction
    • LiveTranscriptionAction
  • Layout
    • Gallery
    • Speaker
    • Filmstrip
    • Custom
  • Device list panel
  • Participant panel
  • Chat panel
  • Meeting info panel

All components follow Google's Material Design, based on Material UI Library.

Samples

All samples refer to ringcentral videosdk js samples.

Installation

If you are adding this library to your existing application, add @ringcentral/video-sdk and the necessary peer dependencies to your project.

pnpm/npm install @ringcentral/video-sdk react react-dom

The following versions of react are recommended:

"react": ">=16.14.0",
"react-dom": ">=16.14.0",

Getting Started

Step 1: Inject rcv instance to the uikit provider

To implement an audio/video communications experience, you just need to:

  1. initialize a @ringcentral/video-sdk instance.
  2. join or start a meeting by rcv instance.
  3. Inject rcv instance to RcvEngineProvider.

For example, a simple App to join the meeting.

import { RcvEngine } from '@ringcentral/video-sdk'
import { RcvEngineProvider } from '@ringcentral/video-sdk-react'

const MyApp = ({ config, children }) => {
    const [rcvEngine, setRcvEngine] = useState()
    const [isMeetingJoined, setMeetingJoined] = useState(false)

    useEffect(() => {
        const initSDK = async () => {
            const { clientId, clientSecret, jwt, userName, password } = config
            const engine = RcvEngine.create({
                clientId,
                clientSecret,
            })
            // if config jwt, initialize SDK with jwt
            // else initialize SDK with password
            await engine.authorize({
                grantType: jwt ? GrantType.JWT : GrantType.PASSWORD,
                jwt,
                username: userName,
                password,
            })

            engine.on(EngineEvent.MEETING_JOINED, (meetingId, errorCode) => {
                // todo
                setMeetingJoined(true)
            })
            engine.on(EngineEvent.MEETING_LEFT, () => {
                // todo
                setMeetingJoined(false)
            })
            setRcvEngine(engine)
        }

        initSDK()
    }, [])

    const joinMeeting = async () => {
        // get meetingId and password (if the meeting requires password) from a form
        await rcvEngine.joinMeeting(meetingId, { password })
    }

    return (
        <>
            <button onClick={joinMeeting}>Join</button>
            <RcvEngineProvider rcvEngine={rcvEngine}>{children}</RcvEngineProvider>
        </>
    )
}

export default MyApp

Step 2: Render UI components

Layout component renders all meeting session video tiles in a responsive grid layout. This includes the local tile and remote tiles. ActionBar component is a container to wrapper action widgets.

// MyApp is the above React component, see Step 1.
import { MyApp } from './app'
import {
    ActionBar,
    AudioAction,
    ChatAction,
    LeaveAction,
    LogoIcon,
    MeetingInfoAction,
    ParticipantAction,
    RecordAction,
    VideoAction,
    Layout,
    LayoutType,
} from '@ringcentral/video-sdk-react'

const MyDemo = () => {
    return (
        <MyApp>
            <div
                style={{
                    display: 'flex',
                    width: '100%',
                    height: '300px',
                    flexDirection: 'column',
                    boxSizing: 'border-box',
                }}>
                <Layout
                    defaultLayout={LayoutType.gallery}
                    style={{
                        flex: 1,
                    }}
                />
                <ActionBar
                    leftActions={[<MeetingInfoAction key={'meeting-info-action'} />]}
                    centerActions={[
                        <AudioAction key={'audio-action'} />,
                        <VideoAction key={'video-action'} />,
                        <ParticipantAction key={'participant-action'} />,
                        <ChatAction key={'chat-action'} />,
                        <RecordAction key={'record-action'} />,
                        <LeaveAction key={'leave-action'} />,
                    ]}
                    rightActions={[<LogoIcon key={'logo-icon'} />]}
                />
            </div>
        </MyApp>
    )
}