hark running now on producers and consumers directly instead on PeerView component, now we can send audiolevel events into more places ...

This commit is contained in:
Stefan Otto
2018-07-17 12:56:58 +02:00
parent 977ffd9d24
commit 3ab603bbe7
7 changed files with 123 additions and 59 deletions
+9
View File
@@ -35,6 +35,15 @@ const consumers = (state = initialState, action) =>
return { ...state, [consumerId]: newConsumer };
}
case 'SET_CONSUMER_VOLUME':
{
const { consumerId, volume } = action.payload;
const consumer = state[consumerId];
const newConsumer = { ...consumer, volume };
return { ...state, [consumerId]: newConsumer };
}
case 'SET_CONSUMER_RESUMED':
{
const { consumerId, originator } = action.payload;
+9
View File
@@ -35,6 +35,15 @@ const producers = (state = initialState, action) =>
return { ...state, [producerId]: newProducer };
}
case 'SET_PRODUCER_VOLUME':
{
const { producerId, volume } = action.payload;
const producer = state[producerId];
const newProducer = { ...producer, volume };
return { ...state, [producerId]: newProducer };
}
case 'SET_PRODUCER_RESUMED':
{
const { producerId, originator } = action.payload;
+16
View File
@@ -331,6 +331,22 @@ export const setConsumerTrack = (consumerId, track) =>
};
};
export const setConsumerVolume = (consumerId, volume) =>
{
return {
type : 'SET_CONSUMER_VOLUME',
payload : { consumerId, volume }
};
};
export const setProducerVolume = (producerId, volume) =>
{
return {
type : 'SET_PRODUCER_VOLUME',
payload : { producerId, volume }
};
};
export const addNotification = (notification) =>
{
return {