Skip to content

Commit

Permalink
Merge pull request #6 from maikthomas/bugfixes
Browse files Browse the repository at this point in the history
Several small bugfixes
  • Loading branch information
adrice727 authored Mar 15, 2017
2 parents 3f7fdaa + b577933 commit dae4aee
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
10 changes: 10 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ body {
background-image: url(https://assets.tokbox.com/solutions/images/icon-no-video.png);
}

.App-control-container .ots-video-control.end-call {
background-image: url(https://assets.tokbox.com/solutions/images/icon-hang-up.png);
background-color: red;
}


.App-video-container {
position: relative;
width: 100%;
Expand Down Expand Up @@ -163,6 +169,10 @@ body {
width: 100%;
}

.App-video-container .video-container.active-gt2.hidden {
display: none;
}

.App-video-container .video-container.active-gt2 .OT_subscriber {
margin: 0;
padding: 0;
Expand Down
27 changes: 16 additions & 11 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const otCoreOptions = {
}[pubSub][type];
},
controlsContainer: '#controls',
packages: ['textChat', 'screenSharing', 'annotation', 'archiving'],
packages: ['textChat', 'screenSharing', 'annotation'],
communication: {
callProperites: null, // Using default
},
Expand Down Expand Up @@ -63,10 +63,6 @@ const otCoreOptions = {
subscriber: '.App-video-container'
}
},
archiving: {
startURL: 'https://example.com/startArchive',
stopURL: 'https://example.com/stopArchive',
},
};

/**
Expand All @@ -83,16 +79,17 @@ const containerClasses = (state) => {
const screenshareActive = viewingSharedScreen || sharingScreen;
return {
controlClass: classNames('App-control-container', { hidden: !active }),
localAudioClass: classNames('ots-video-control circle audio', { muted: !localAudioEnabled }),
localVideoClass: classNames('ots-video-control circle video', { muted: !localVideoEnabled }),
cameraPublisherClass: classNames('video-container', { hidden: !active, small: !!activeCameraSubscribers || sharingScreen, left: screenshareActive }),
screenPublisherClass: classNames('video-container', { hidden: !sharingScreen }),
cameraSubscriberClass: classNames('video-container', { hidden: !activeCameraSubscribers },
localAudioClass: classNames('ots-video-control circle audio', { hidden: !active, muted: !localAudioEnabled }),
localVideoClass: classNames('ots-video-control circle video', { hidden: !active, muted: !localVideoEnabled }),
localCallClass: classNames('ots-video-control circle end-call', { hidden: !active }),
cameraPublisherClass: classNames('video-container', { hidden: !active, small: !!activeCameraSubscribers || screenshareActive, left: screenshareActive }),
screenPublisherClass: classNames('video-container', { hidden: !active || !sharingScreen }),
cameraSubscriberClass: classNames('video-container', { hidden: !active || !activeCameraSubscribers },
{ 'active-gt2': activeCameraSubscribersGt2 && !screenshareActive },
{ 'active-odd': activeCameraSubscribersOdd && !screenshareActive },
{ small: screenshareActive }
),
screenSubscriberClass: classNames('video-container', { hidden: !viewingSharedScreen }),
screenSubscriberClass: classNames('video-container', { hidden: !viewingSharedScreen || !active }),
};
};

Expand Down Expand Up @@ -121,6 +118,7 @@ class App extends Component {
localVideoEnabled: true,
};
this.startCall = this.startCall.bind(this);
this.endCall = this.endCall.bind(this);
this.toggleLocalAudio = this.toggleLocalAudio.bind(this);
this.toggleLocalVideo = this.toggleLocalVideo.bind(this);
}
Expand Down Expand Up @@ -149,6 +147,11 @@ class App extends Component {
}).catch(error => console.log(error));
}

endCall() {
otCore.endCall()
this.setState({ active: false });
}

toggleLocalAudio() {
otCore.toggleLocalAudio(!this.state.localAudioEnabled);
this.setState({ localAudioEnabled: !this.state.localAudioEnabled });
Expand All @@ -164,6 +167,7 @@ class App extends Component {
const {
localAudioClass,
localVideoClass,
localCallClass,
controlClass,
cameraPublisherClass,
screenPublisherClass,
Expand All @@ -189,6 +193,7 @@ class App extends Component {
<div id="controls" className={controlClass}>
<div className={localAudioClass} onClick={this.toggleLocalAudio} />
<div className={localVideoClass} onClick={this.toggleLocalVideo} />
<div className={localCallClass} onClick={this.endCall} />
</div>
<div id="chat" className="App-chat-container" />
</div>
Expand Down

0 comments on commit dae4aee

Please sign in to comment.