Skip to content

Instantly share code, notes, and snippets.

@acomito
Created December 8, 2016 14:29
Show Gist options
  • Save acomito/bd93b786fa92a5ce6b279e13a8217376 to your computer and use it in GitHub Desktop.
Save acomito/bd93b786fa92a5ce6b279e13a8217376 to your computer and use it in GitHub Desktop.
import React from 'react';
import { OTSession, OTPublisher, OTStreams, OTSubscriber, createSession } from 'opentok-react';
export class TokBoxChat extends React.Component {
constructor(props){
super(props);
this.startSession = this.startSession.bind(this);
this.joinSession = this.joinSession.bind(this);
this.endSession = this.endSession.bind(this);
startSession(){
Bert.alert('session created', 'success');
}
joinSession(){
Bert.alert('session joined', 'success');
}
endSession(){
Bert.alert('session ended', 'success');
}
render() {
return (
<div>
<button onClick={this.startSession}>start session</button>
<button onClick={this.endSession}>end session</button>
<button onClick={this.joinSession}>join session</button>
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment