Last active
June 17, 2018 19:47
-
-
Save Mazuh/925aee7a540265fefe98f10c1f9da7ce to your computer and use it in GitHub Desktop.
Dumb sample of SimpleWebRTC lib.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import SimpleWebRTC from 'simplewebrtc'; | |
import './App.css'; | |
export default class App extends React.Component { | |
componentDidMount() { | |
const webrtc = new SimpleWebRTC({ | |
autoRequestMedia: true, | |
localVideoEl: 'local-video', | |
remoteVideosEl: 'remote-videos-container', | |
}); | |
webrtc.on('readyToCall', () => { | |
webrtc.joinRoom('mazuh'); | |
}); | |
} | |
render() { | |
return ( | |
<React.Fragment> | |
<h1>Simple Video Conference</h1> | |
<video id="local-video"/> | |
<div id="remote-videos-container"/> | |
</React.Fragment> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment