fix(base/tracks): handle GUM in progress

This commit adds extra actions/Redux state to be able to deal with
the GUM operation being in progress. There will be early local track
stub in the Redux state for any a local track for which GUM has been
called, but not completed yet.

Local track is considered valid only after TRACK_ADDED event when it
will have JitsiLocalTrack instance set.
This commit is contained in:
paweldomas
2017-11-09 15:59:31 -06:00
committed by Lyubo Marinov
parent 90dcb251c3
commit f37a12c332
6 changed files with 220 additions and 114 deletions

View File

@@ -5,7 +5,7 @@ import { Alert, Linking, NativeModules } from 'react-native';
import { isRoomValid } from '../../base/conference';
import { Platform } from '../../base/react';
import { MiddlewareRegistry } from '../../base/redux';
import { TRACK_PERMISSION_ERROR } from '../../base/tracks';
import { TRACK_CREATE_ERROR } from '../../base/tracks';
/**
* Middleware that captures track permission errors and alerts the user so they
@@ -18,14 +18,16 @@ MiddlewareRegistry.register(store => next => action => {
const result = next(action);
switch (action.type) {
case TRACK_PERMISSION_ERROR:
case TRACK_CREATE_ERROR:
// XXX We do not currently have user interface outside of a conference
// which the user may tap and cause a permission-related error. If we
// alert whenever we (intend to) ask for a permission, the scenario of
// entering the WelcomePage, being asked for the camera permission, me
// denying it, and being alerted that there is an error is overwhelming
// me.
if (isRoomValid(store.getState()['features/base/conference'].room)) {
if (action.permissionDenied
&& isRoomValid(
store.getState()['features/base/conference'].room)) {
_alertPermissionErrorWithSettings(action.trackType);
}
break;