@roadzen/videostream-web
v0.0.3
Published
Videostreaming using sockets and webrtc built in react
Downloads
3
Readme
videostream-web
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