|
|
@ -1,7 +1,5 @@ |
|
|
|
// @flow
|
|
|
|
// @flow
|
|
|
|
|
|
|
|
|
|
|
|
import UIEvents from '../../../../service/UI/UIEvents'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
import { |
|
|
|
ACTION_PINNED, |
|
|
|
ACTION_PINNED, |
|
|
|
ACTION_UNPINNED, |
|
|
|
ACTION_UNPINNED, |
|
|
@ -18,6 +16,7 @@ import { |
|
|
|
PIN_PARTICIPANT |
|
|
|
PIN_PARTICIPANT |
|
|
|
} from '../participants'; |
|
|
|
} from '../participants'; |
|
|
|
import { MiddlewareRegistry } from '../redux'; |
|
|
|
import { MiddlewareRegistry } from '../redux'; |
|
|
|
|
|
|
|
import UIEvents from '../../../../service/UI/UIEvents'; |
|
|
|
import { TRACK_ADDED, TRACK_REMOVED } from '../tracks'; |
|
|
|
import { TRACK_ADDED, TRACK_REMOVED } from '../tracks'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
import { |
|
|
@ -97,16 +96,15 @@ MiddlewareRegistry.register(store => next => action => { |
|
|
|
* @param {Action} action - The redux action CONNECTION_ESTABLISHED which is |
|
|
|
* @param {Action} action - The redux action CONNECTION_ESTABLISHED which is |
|
|
|
* being dispatched in the specified store. |
|
|
|
* being dispatched in the specified store. |
|
|
|
* @private |
|
|
|
* @private |
|
|
|
* @returns {Object} The new state that is the result of the reduction of the |
|
|
|
* @returns {Object} The value returned by {@code next(action)}. |
|
|
|
* specified action. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function _connectionEstablished(store, next, action) { |
|
|
|
function _connectionEstablished({ dispatch }, next, action) { |
|
|
|
const result = next(action); |
|
|
|
const result = next(action); |
|
|
|
|
|
|
|
|
|
|
|
// FIXME: workaround for the web version. Currently the creation of the
|
|
|
|
// FIXME: workaround for the web version. Currently the creation of the
|
|
|
|
// conference is handled by /conference.js
|
|
|
|
// conference is handled by /conference.js
|
|
|
|
if (typeof APP === 'undefined') { |
|
|
|
if (typeof APP === 'undefined') { |
|
|
|
store.dispatch(createConference()); |
|
|
|
dispatch(createConference()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
return result; |
|
|
@ -123,8 +121,7 @@ function _connectionEstablished(store, next, action) { |
|
|
|
* @param {Action} action - The redux action {@link CONFERENCE_FAILED} or |
|
|
|
* @param {Action} action - The redux action {@link CONFERENCE_FAILED} or |
|
|
|
* {@link CONFERENCE_LEFT} which is being dispatched in the specified store. |
|
|
|
* {@link CONFERENCE_LEFT} which is being dispatched in the specified store. |
|
|
|
* @private |
|
|
|
* @private |
|
|
|
* @returns {Object} The new state that is the result of the reduction of the |
|
|
|
* @returns {Object} The value returned by {@code next(action)}. |
|
|
|
* specified action. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function _conferenceFailedOrLeft({ dispatch, getState }, next, action) { |
|
|
|
function _conferenceFailedOrLeft({ dispatch, getState }, next, action) { |
|
|
|
const result = next(action); |
|
|
|
const result = next(action); |
|
|
@ -149,20 +146,17 @@ function _conferenceFailedOrLeft({ dispatch, getState }, next, action) { |
|
|
|
* @param {Action} action - The redux action CONFERENCE_JOINED which is being |
|
|
|
* @param {Action} action - The redux action CONFERENCE_JOINED which is being |
|
|
|
* dispatched in the specified store. |
|
|
|
* dispatched in the specified store. |
|
|
|
* @private |
|
|
|
* @private |
|
|
|
* @returns {Object} The new state that is the result of the reduction of the |
|
|
|
* @returns {Object} The value returned by {@code next(action)}. |
|
|
|
* specified action. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function _conferenceJoined(store, next, action) { |
|
|
|
function _conferenceJoined({ dispatch, getState }, next, action) { |
|
|
|
const result = next(action); |
|
|
|
const result = next(action); |
|
|
|
const { audioOnly, conference } |
|
|
|
|
|
|
|
= store.getState()['features/base/conference']; |
|
|
|
const { audioOnly, conference } = getState()['features/base/conference']; |
|
|
|
|
|
|
|
|
|
|
|
// FIXME On Web the audio only mode for "start audio only" is toggled before
|
|
|
|
// FIXME On Web the audio only mode for "start audio only" is toggled before
|
|
|
|
// conference is added to the redux store ("on conference joined" action)
|
|
|
|
// conference is added to the redux store ("on conference joined" action)
|
|
|
|
// and the LastN value needs to be synchronized here.
|
|
|
|
// and the LastN value needs to be synchronized here.
|
|
|
|
if (audioOnly && conference.getLastN() !== 0) { |
|
|
|
audioOnly && (conference.getLastN() !== 0) && dispatch(setLastN(0)); |
|
|
|
store.dispatch(setLastN(0)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
@ -179,11 +173,10 @@ function _conferenceJoined(store, next, action) { |
|
|
|
* @param {Action} action - The redux action PIN_PARTICIPANT which is being |
|
|
|
* @param {Action} action - The redux action PIN_PARTICIPANT which is being |
|
|
|
* dispatched in the specified store. |
|
|
|
* dispatched in the specified store. |
|
|
|
* @private |
|
|
|
* @private |
|
|
|
* @returns {Object} The new state that is the result of the reduction of the |
|
|
|
* @returns {Object} The value returned by {@code next(action)}. |
|
|
|
* specified action. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function _pinParticipant(store, next, action) { |
|
|
|
function _pinParticipant({ getState }, next, action) { |
|
|
|
const state = store.getState(); |
|
|
|
const state = getState(); |
|
|
|
const { conference } = state['features/base/conference']; |
|
|
|
const { conference } = state['features/base/conference']; |
|
|
|
|
|
|
|
|
|
|
|
if (!conference) { |
|
|
|
if (!conference) { |
|
|
@ -248,8 +241,7 @@ function _pinParticipant(store, next, action) { |
|
|
|
* @param {Action} action - The redux action SET_AUDIO_ONLY which is being |
|
|
|
* @param {Action} action - The redux action SET_AUDIO_ONLY which is being |
|
|
|
* dispatched in the specified store. |
|
|
|
* dispatched in the specified store. |
|
|
|
* @private |
|
|
|
* @private |
|
|
|
* @returns {Object} The new state that is the result of the reduction of the |
|
|
|
* @returns {Object} The value returned by {@code next(action)}. |
|
|
|
* specified action. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function _setAudioOnly({ dispatch, getState }, next, action) { |
|
|
|
function _setAudioOnly({ dispatch, getState }, next, action) { |
|
|
|
const result = next(action); |
|
|
|
const result = next(action); |
|
|
@ -286,11 +278,10 @@ function _setAudioOnly({ dispatch, getState }, next, action) { |
|
|
|
* @param {Action} action - The redux action SET_LASTN which is being dispatched |
|
|
|
* @param {Action} action - The redux action SET_LASTN which is being dispatched |
|
|
|
* in the specified store. |
|
|
|
* in the specified store. |
|
|
|
* @private |
|
|
|
* @private |
|
|
|
* @returns {Object} The new state that is the result of the reduction of the |
|
|
|
* @returns {Object} The value returned by {@code next(action)}. |
|
|
|
* specified action. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function _setLastN(store, next, action) { |
|
|
|
function _setLastN({ getState }, next, action) { |
|
|
|
const { conference } = store.getState()['features/base/conference']; |
|
|
|
const { conference } = getState()['features/base/conference']; |
|
|
|
|
|
|
|
|
|
|
|
if (conference) { |
|
|
|
if (conference) { |
|
|
|
try { |
|
|
|
try { |
|
|
@ -307,24 +298,21 @@ function _setLastN(store, next, action) { |
|
|
|
* Sets the maximum receive video quality and will turn off audio only mode if |
|
|
|
* Sets the maximum receive video quality and will turn off audio only mode if |
|
|
|
* enabled. |
|
|
|
* enabled. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param {Store} store - The Redux store in which the specified action is being |
|
|
|
* @param {Store} store - The redux store in which the specified action is being |
|
|
|
* dispatched. |
|
|
|
* dispatched. |
|
|
|
* @param {Dispatch} next - The Redux dispatch function to dispatch the |
|
|
|
* @param {Dispatch} next - The redux dispatch function to dispatch the |
|
|
|
* specified action to the specified store. |
|
|
|
* specified action to the specified store. |
|
|
|
* @param {Action} action - The Redux action SET_RECEIVE_VIDEO_QUALITY which is |
|
|
|
* @param {Action} action - The redux action SET_RECEIVE_VIDEO_QUALITY which is |
|
|
|
* being dispatched in the specified store. |
|
|
|
* being dispatched in the specified store. |
|
|
|
* @private |
|
|
|
* @private |
|
|
|
* @returns {Object} The new state that is the result of the reduction of the |
|
|
|
* @returns {Object} The value returned by {@code next(action)}. |
|
|
|
* specified action. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function _setReceiveVideoQuality({ dispatch, getState }, next, action) { |
|
|
|
function _setReceiveVideoQuality({ dispatch, getState }, next, action) { |
|
|
|
const { audioOnly, conference } = getState()['features/base/conference']; |
|
|
|
const { audioOnly, conference } = getState()['features/base/conference']; |
|
|
|
|
|
|
|
|
|
|
|
if (conference) { |
|
|
|
if (conference) { |
|
|
|
conference.setReceiverVideoConstraint(action.receiveVideoQuality); |
|
|
|
conference.setReceiverVideoConstraint(action.receiveVideoQuality); |
|
|
|
if (audioOnly) { |
|
|
|
audioOnly && dispatch(toggleAudioOnly()); |
|
|
|
dispatch(toggleAudioOnly()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return next(action); |
|
|
|
return next(action); |
|
|
@ -362,15 +350,14 @@ function _syncConferenceLocalTracksWithState({ getState }, action) { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Sets the maximum receive video quality. |
|
|
|
* Sets the maximum receive video quality. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param {Store} store - The Redux store in which the specified action is being |
|
|
|
* @param {Store} store - The redux store in which the specified action is being |
|
|
|
* dispatched. |
|
|
|
* dispatched. |
|
|
|
* @param {Dispatch} next - The Redux dispatch function to dispatch the |
|
|
|
* @param {Dispatch} next - The redux dispatch function to dispatch the |
|
|
|
* specified action to the specified store. |
|
|
|
* specified action to the specified store. |
|
|
|
* @param {Action} action - The Redux action DATA_CHANNEL_STATUS_CHANGED which |
|
|
|
* @param {Action} action - The redux action DATA_CHANNEL_STATUS_CHANGED which |
|
|
|
* is being dispatched in the specified store. |
|
|
|
* is being dispatched in the specified store. |
|
|
|
* @private |
|
|
|
* @private |
|
|
|
* @returns {Object} The new state that is the result of the reduction of the |
|
|
|
* @returns {Object} The value returned by {@code next(action)}. |
|
|
|
* specified action. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function _syncReceiveVideoQuality({ getState }, next, action) { |
|
|
|
function _syncReceiveVideoQuality({ getState }, next, action) { |
|
|
|
const state = getState()['features/base/conference']; |
|
|
|
const state = getState()['features/base/conference']; |
|
|
@ -391,8 +378,7 @@ function _syncReceiveVideoQuality({ getState }, next, action) { |
|
|
|
* @param {Action} action - The redux action TRACK_ADDED or TRACK_REMOVED which |
|
|
|
* @param {Action} action - The redux action TRACK_ADDED or TRACK_REMOVED which |
|
|
|
* is being dispatched in the specified store. |
|
|
|
* is being dispatched in the specified store. |
|
|
|
* @private |
|
|
|
* @private |
|
|
|
* @returns {Object} The new state that is the result of the reduction of the |
|
|
|
* @returns {Object} The value returned by {@code next(action)}. |
|
|
|
* specified action. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function _trackAddedOrRemoved(store, next, action) { |
|
|
|
function _trackAddedOrRemoved(store, next, action) { |
|
|
|
const track = action.track; |
|
|
|
const track = action.track; |
|
|
|