Skip to content

Instantly share code, notes, and snippets.

@Mazuh
Last active June 17, 2018 19:47
Show Gist options
  • Save Mazuh/925aee7a540265fefe98f10c1f9da7ce to your computer and use it in GitHub Desktop.
Save Mazuh/925aee7a540265fefe98f10c1f9da7ce to your computer and use it in GitHub Desktop.
Dumb sample of SimpleWebRTC lib.
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