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 // The room ID
this._roomId = roomId; this._roomId = roomId;
store.dispatch(stateActions.setRoomName(roomId));
// mediasoup-client Device instance. // mediasoup-client Device instance.
// @type {mediasoupClient.Device} // @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) async changeAudioDevice(deviceId)
{ {
logger.debug('changeAudioDevice() [deviceId: %s]', deviceId); logger.debug('changeAudioDevice() [deviceId: %s]', deviceId);
@ -2467,7 +2484,7 @@ export default class RoomClient
try try
{ {
logger.debug('_getAudioDeviceId() | calling _updateWebcams()'); logger.debug('_getAudioDeviceId() | calling _updateAudioDeviceId()');
await this._updateAudioDevices(); 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) => export const setRoomState = (state) =>
{ {
return { return {

View File

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