Skip to content
Snippets Groups Projects
Unverified Commit a0a8d82a authored by Leon's avatar Leon Committed by GitHub
Browse files

Update README.md

parent f7be2987
No related branches found
No related tags found
No related merge requests found
...@@ -107,18 +107,19 @@ class Party extends Component { ...@@ -107,18 +107,19 @@ class Party extends Component {
// Show fellow peers in the room // Show fellow peers in the room
generateRemotes = () => this.state.peers.map((p) => ( generateRemotes = () => this.state.peers.map((p) => (
<PeerTile key={p.id}> <div key={p.id}>
<VideoContainer id={`container_${this.webrtc.getDomId(p)}`}> <div id={`container_${this.webrtc.getDomId(p)}`}>
<video <video
key={this.webrtc.getDomId(p)} key={this.webrtc.getDomId(p)}
// Important: The video element needs both an id and ref
id={this.webrtc.getDomId(p)} id={this.webrtc.getDomId(p)}
ref={(v) => this.remoteVideos[p.id] = v} ref={(v) => this.remoteVideos[p.id] = v}
/> />
</VideoContainer> </div>
<PeerInfo> <div>
<p>{p.nick}</p> <p>{p.nick}</p>
</PeerInfo> </div>
</PeerTile> </div>
)); ));
disconnect = () => { disconnect = () => {
...@@ -133,25 +134,25 @@ class Party extends Component { ...@@ -133,25 +134,25 @@ class Party extends Component {
render() { render() {
return ( return (
<Wrapper> <div>
<PeerTile> <div>
<VideoContainer> <div>
<video <video
className={styles.vid} className={styles.vid}
// Important: The local video element needs to have both an ID and ref // Important: The local video element needs to have both an ID and ref
id="localVideo" id="localVideo"
ref={(vid) => { this.localVid = vid; }} ref={(vid) => { this.localVid = vid; }}
/> />
</VideoContainer> </div>
<PeerInfo> <div>
<p>{this.state.nick}</p> <p>{this.state.nick}</p>
</PeerInfo> </div>
</PeerTile> </div>
<div id="remoteVideos"> <div id="remoteVideos">
{this.generateRemotes()} {this.generateRemotes()}
</div> </div>
</Wrapper> </div>
); );
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment