Skip to content

Commit

Permalink
Merge pull request #29 from thegeekybaniya/dev
Browse files Browse the repository at this point in the history
Added 'You' online status for voice channel
  • Loading branch information
niklabh authored May 9, 2020
2 parents a8a2639 + 7cfdae6 commit 279632c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
9 changes: 4 additions & 5 deletions webapp/src/actions/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable no-magic-numbers */
/* eslint-disable max-nested-callbacks */
/* eslint-disable no-console */
/* eslint-disable no-shadow */
/* eslint-disable no-unused-vars */
import axios from 'axios';
Expand Down Expand Up @@ -307,7 +306,7 @@ function listenAccept(userId, peerId) {
cPeer = peer;

const data = JSON.parse(payload.toString());
console.info('received data', {id, data});
debug('received data', {id, data});

if (data.type === 'receivedHandshake') {
getUserMedia((error, stream) => {
Expand Down Expand Up @@ -366,7 +365,7 @@ function listenAccept(userId, peerId) {
});

sw.on('disconnect', (peer, id) => {
console.info('disconnected from a peer:', peer, id);
debug('disconnected from a peer:', peer, id);
cPeer = null;
dispatch({
type: ActionTypes.PEER_LOST,
Expand Down Expand Up @@ -470,7 +469,7 @@ export function acceptCall() {

const data = JSON.parse(payload.toString());

console.info('received data', {id, data});
debug('received data', {id, data});

if (data.type === 'receivedHandshake') {
getUserMedia((error, stream) => {
Expand Down Expand Up @@ -530,7 +529,7 @@ export function acceptCall() {
});

sw.on('disconnect', (peer, id) => {
console.info('disconnected from a peer:', peer, id);
debug('disconnected from a peer:', peer, id);
cPeer = null;
dispatch({
type: ActionTypes.PEER_LOST,
Expand Down
13 changes: 11 additions & 2 deletions webapp/src/components/modals/audio_group_call/audio_group_call.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class AudioCallPanel extends React.Component {
config,
} = this.state;
const roomCode = `mattermost-webrtc-video-${config.DiagnosticId}`;

debug('Room', roomCode);
const iceServers = [
{url: 'stun:stun.l.google.com:19302'},
{url: 'stun:stun1.l.google.com:19302'},
Expand Down Expand Up @@ -349,7 +349,6 @@ class AudioCallPanel extends React.Component {
}

render() {
// eslint-disable-next-line no-console
const {
userId, initialized, swarmInitialized, audioOn, speakerOn, peerStreams,
} = this.state;
Expand Down Expand Up @@ -382,6 +381,16 @@ class AudioCallPanel extends React.Component {
/>
</div>
<ul style={style.list}>
{swarmInitialized && (
<li
style={style.listItem}

key={0}
>
<i
className={'icon fa fa-circle'}
style={style.online}
/>{'You'}</li>)}
{Object.keys(peerStreams).map((id) => {
return (
<li
Expand Down

0 comments on commit 279632c

Please sign in to comment.