Added name for room in state on clientside

master
Stefan Otto 2019-10-30 15:00:37 +01:00
parent 9256d4c751
commit 879ea37167
3 changed files with 35 additions and 1 deletions

View File

@ -120,6 +120,7 @@ export default class RoomClient
// The room ID
this._roomId = roomId;
store.dispatch(stateActions.setRoomName(roomId));
// mediasoup-client Device instance.
// @type {mediasoupClient.Device}
@ -759,6 +760,22 @@ export default class RoomClient
}
}
async getAudioTrack()
{
await navigator.mediaDevices.getUserMedia(
{
audio : true, video : false
});
}
async getVideoTrack()
{
await navigator.mediaDevices.getUserMedia(
{
audio : false, video : true
});
}
async changeAudioDevice(deviceId)
{
logger.debug('changeAudioDevice() [deviceId: %s]', deviceId);
@ -2467,7 +2484,7 @@ export default class RoomClient
try
{
logger.debug('_getAudioDeviceId() | calling _updateWebcams()');
logger.debug('_getAudioDeviceId() | calling _updateAudioDeviceId()');
await this._updateAudioDevices();

View File

@ -6,6 +6,15 @@ export const setRoomUrl = (url) =>
};
};
export const setRoomName = (name) =>
{
return {
type : 'SET_ROOM_NAME',
payload : { name }
};
};
export const setRoomState = (state) =>
{
return {

View File

@ -1,6 +1,7 @@
const initialState =
{
url : null,
name : '',
state : 'new', // new/connecting/connected/disconnected/closed,
locked : false,
inLobby : false,
@ -31,6 +32,13 @@ const room = (state = initialState, action) =>
return { ...state, url };
}
case 'SET_ROOM_NAME':
{
const { name } = action.payload;
return { ...state, name };
}
case 'SET_ROOM_STATE':
{
const roomState = action.payload.state;