0.0.3 • Published 5 years ago

@roadzen/videostream-web v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

videostream-web

NPM JavaScript Style Guide

Install

npm install --save @roadzen/videostream-web

Usage

Add the following to your index.html Div tag to mount the videostream modal <div id="video-root"></div>

Script tag to include webrtc adapter <script src="https://webrtc.github.io/adapter/adapter-latest.js" crossorigin="anonymous"></script>

Import and include the component in your component Example.jsx

import React, { Component } from 'react'

import VideoStream from '@roadzen/videostream-web'

class Example extends Component {
  state = {
    openModal: false,
  }

  render () {
    return (
      <VideoStream
        token='xxxxx'
        isModalOpen={openModal}
        handleToggleModal={(value) => this.setState({ openModal: value })}
        socketURL='xxxxx'
        apiURL='xxxxx'
        turnServerDetails={{
          url:'xxxxx',
          username:'xxxxx',
          credential:'xxxxx',
        }}
      />
    )
  }
}

License

MIT © iamsaksham