Skip to content

Commit

Permalink
show mediasoup-client handler name in room top-left corner
Browse files Browse the repository at this point in the history
  • Loading branch information
ibc committed Jun 16, 2023
1 parent 61f1713 commit c288a64
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 6 deletions.
4 changes: 4 additions & 0 deletions app/lib/RoomClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -2251,6 +2251,10 @@ export default class RoomClient
handlerName : this._handlerName
});

store.dispatch(stateActions.setRoomMediasoupClientHandler(
this._mediasoupDevice.handlerName
));

const routerRtpCapabilities =
await this._protoo.request('getRouterRtpCapabilities');

Expand Down
1 change: 0 additions & 1 deletion app/lib/components/PeerView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,6 @@ export default class PeerView extends React.Component
<audio
ref='audioElem'
autoPlay
playsInline
muted={isMe || audioMuted}
controls={false}
/>
Expand Down
4 changes: 4 additions & 0 deletions app/lib/components/Room.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ class Room extends React.Component
<p className={classnames('text', room.state)}>{room.state}</p>
</div>

<div className='mediasoup-client-handler-name'>
<p className='text'><span className='label'>handler: </span>{room.mediasoupClientHandler}</p>
</div>

<div className='room-link-wrapper'>
<div className='room-link'>
<a
Expand Down
20 changes: 15 additions & 5 deletions app/lib/redux/reducers/room.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const initialState =
{
url : null,
state : 'new', // new/connecting/connected/disconnected/closed,
activeSpeakerId : null,
statsPeerId : null,
faceDetection : false
url : null,
state : 'new', // new/connecting/connected/disconnected/closed,
mediasoupClientHandler : undefined,
activeSpeakerId : null,
statsPeerId : null,
faceDetection : false
};

const room = (state = initialState, action) =>
Expand All @@ -28,6 +29,13 @@ const room = (state = initialState, action) =>
return { ...state, state: roomState, activeSpeakerId: null, statsPeerId: null };
}

case 'SET_ROOM_MEDIASOUP_CLIENT_HANDLER':
{
const { mediasoupClientHandler } = action.payload;

return { ...state, mediasoupClientHandler };
}

case 'SET_ROOM_ACTIVE_SPEAKER':
{
const { peerId } = action.payload;
Expand Down Expand Up @@ -67,7 +75,9 @@ const room = (state = initialState, action) =>
}

default:
{
return state;
}
}
};

Expand Down
8 changes: 8 additions & 0 deletions app/lib/redux/stateActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ export const setRoomState = (state) =>
};
};

export const setRoomMediasoupClientHandler = (mediasoupClientHandler) =>
{
return {
type : 'SET_ROOM_MEDIASOUP_CLIENT_HANDLER',
payload : { mediasoupClientHandler }
};
};

export const setRoomActiveSpeaker = (peerId) =>
{
return {
Expand Down
47 changes: 47 additions & 0 deletions app/stylus/components/Room.styl
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,53 @@
}
}

> .mediasoup-client-handler-name {
position: fixed;
z-index: 100;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
border-radius: 25px;
background-color: $COLOR_BG_1;

+desktop() {
top: 55px;
left: 20px;
height: 18px;
width: 124px;
}

+mobile() {
top: 40px;
left: 10px;
height: 18px;
width: 110px;
}

> .text {
flex: 100 0 auto;
user-select: none;
pointer-events: none;
text-align: center;
font-family: 'Roboto';
font-weight: 400;
color: rgba(#fff, 0.75);

+desktop() {
font-size: 10px;
}

+mobile() {
font-size: 9px;
}

> span.label {
color: rgba(#fff, 0.45);
}
}
}

> .room-link-wrapper {
pointer-events: none;
position: absolute;
Expand Down

0 comments on commit c288a64

Please sign in to comment.