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

react-jitsi

v1.0.4

Published

React and Typescript component to include Jitsi Meet with ease

Downloads

2,396

Readme

Jitsi Meet React Component

license built with typescript

An unofficial React component which wraps the standard Jitsi Meet JS API. It is written in Typescript to help you configure the library with ease, and get your super important meetings up and going, in a blink of an eye🌪.

Live Demo

Install

npm install react-jitsi --save

Usage

Basic

The easiest way for you to create a meeting is by simply including the React Jitsi component in your app.

import React, { useState } from 'react'
import Jitsi from 'react-jitsi'

export const App = () => (
  <>
    <h2>My First Meeting!</h2>
    <Jitsi />
  </>
)

However, this is not recommended, as it will create and join a random room (ex. hp6y791054a), which is possibly not unique.

Basic, but better

We advise you to create a meeting specifying at least a room name (that you know is unique) and the user's display name.

import React, { useState } from 'react'
import Jitsi from 'react-jitsi'

const roomName = 'my-super-secret-meeting-123e4567-e89b-12d3-a456-426655440000'
const userFullName = 'Joseph Strawberry'

export const App = () => (
  <>
    <h2>My First Meeting!</h2>
    <Jitsi roomName={roomName} displayName={userFullName} />
  </>
)

A more complete example

import React, { useState } from 'react'
import Jitsi from 'react-jitsi'
import Loader from './components/Loader'

export const App = () => {

  const [displayName, setDisplayName] = useState('')
  const [roomName, setRoomName] = useState('')
  const [password, setPassword] = useState('')
  const [onCall, setOnCall] = useState(false)

  return onCall
    ? (
      <Jitsi
        roomName={roomName}
        displayName={displayName}
        password={password}
        loadingComponent={Loader}
        onAPILoad={JitsiMeetAPI => console.log('Good Morning everyone!')}
      />)
    : (
      <>
        <h1>Crate a Meeting</h1>
        <input type='text' placeholder='Room name' value={roomName} onChange={e => setRoomName(e.target.value)} />
        <input type='text' placeholder='Your name' value={displayName} onChange={e => setDisplayName(e.target.value)} />
        <button onClick={() => setOnCall(true)}> Let&apos;s start!</button>
      </>
    )

}

Custom styles

The Jitsi Meet conference iframe is wrapped by two containers

<div id='react-jitsi-container' style={...}>
  <Loader/>
  <div id='react-jitsi-frame' style={...}>
    <iframe>
  </div>
</div>

You can specify custom styles for each container in two ways:

  • Using CSS, through the #react-jitsi-container and #react-jitsi-frame selectors
  • Using inline styling, through the containerStyle and frameStyle props

For example

<Jitsi containerStyle={{ width: '1200px', height: '800px' }}>

Conference Configuration

Configuration over both the conference core settings (such as startAudioOnly option) and the interface settings (such as filmStripOnly option) can be passed through the config and interfaceConfig props.

For example

<Jitsi
  config={{ startAudioOnly: true }}
  interfaceConfig={{ filmStripOnly: true }}>

Available props

| Prop | Required | Description | Default | | ---------------- | -------- | ------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | | containerStyle | no | Object containing main container styles (see above for details) | { width:'800px', height: '400px' } | | frameStyle | no | Object containing frame container styles (see above for details) | { display: loading?'none' : 'block',width: '100%',height: '100% }' | | loadingComponent | no | Component shown until the Jitsi Meet video conference is not started | <div>Loading meeting...</div> | | onAPILoad | no | Callback function invoked with Jitsi Meet API object when the library is loaded | | onIframeLoad | no | Callback function invoked when the conference iframe is loaded | | domain | no | Domain used to build the conference URL | meet.jit.si | | roomName | no | Name of the room to join | A random string | | password | no | Password to set for the meeting room | | displayName | no | Participant's name | | config | no | Overrides for the default meeting settings | | interfaceConfig | no | Overrides for default meeting interface options | | noSSL | no | Boolean indicating if the server should be contacted using HTTP or HTTPS | true | | jwt | no | JWT token to pass to the domain | | devices | no | A map containing information about the initial devices that will be used in the call. | | userInfo | no | Object containing information about the participant opening the meeting |

Controlling the Conference

The Jitsi Meet API exposes several methods which allow great control over the conference. Such methods can be accessed through the api object passed as an argument to the callback specified in the onAPILoad prop.

For example, to retrieve the device list:

import React, { useState } from 'react'
import Jitsi from 'react-jitsi'

const handleAPI = (JitsiMeetAPI) => {
  JitsiMeetAPI.executeCommand('toggleVideo')
}

export const App = () => (
  <>
    <h2>My First Meeting!</h2>
    <Jitsi onAPILoad={handleAPI} password={password} />
  </>
)

Contributing

We love contributions from everyone. If you have any bug to report, open an issue. If want to submit a fix, or any kind of improvement, create a pull request here on Github.

Organizations and projects using this component

| | | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Dascuola.it | Westudents.it |

If you are using this component in your organization/project and would like to be shown in the above list, send us an email!


MIT License.