[RN] Fix for creating video track when conference is ending.

This commit is contained in:
Daniel Ornelas 2018-06-18 10:19:59 -05:00 committed by Saúl Ibarra Corretgé
parent 8c7a3f16b1
commit ad259988b9
4 changed files with 13 additions and 7 deletions

View File

@ -451,15 +451,21 @@ export function p2pStatusChanged(p2p: boolean) {
* *
* @param {boolean} audioOnly - True if the conference should be audio only; * @param {boolean} audioOnly - True if the conference should be audio only;
* false, otherwise. * false, otherwise.
* @param {boolean} ensureVideoTrack - Define if conference should ensure
* to create a video track.
* @returns {{ * @returns {{
* type: SET_AUDIO_ONLY, * type: SET_AUDIO_ONLY,
* audioOnly: boolean * audioOnly: boolean,
* ensureVideoTrack: boolean
* }} * }}
*/ */
export function setAudioOnly(audioOnly: boolean) { export function setAudioOnly(
audioOnly: boolean,
ensureVideoTrack: boolean = false) {
return { return {
type: SET_AUDIO_ONLY, type: SET_AUDIO_ONLY,
audioOnly audioOnly,
ensureVideoTrack
}; };
} }
@ -665,6 +671,6 @@ export function toggleAudioOnly() {
return (dispatch: Dispatch<*>, getState: Function) => { return (dispatch: Dispatch<*>, getState: Function) => {
const { audioOnly } = getState()['features/base/conference']; const { audioOnly } = getState()['features/base/conference'];
return dispatch(setAudioOnly(!audioOnly)); return dispatch(setAudioOnly(!audioOnly, true));
}; };
} }

View File

@ -273,7 +273,7 @@ function _setAudioOnly({ dispatch, getState }, next, action) {
setVideoMuted( setVideoMuted(
newValue, newValue,
VIDEO_MUTISM_AUTHORITY.AUDIO_ONLY, VIDEO_MUTISM_AUTHORITY.AUDIO_ONLY,
/* ensureTrack */ true)); action.ensureVideoTrack));
if (typeof APP !== 'undefined') { if (typeof APP !== 'undefined') {
// TODO This should be a temporary solution that lasts only until video // TODO This should be a temporary solution that lasts only until video

View File

@ -162,7 +162,7 @@ function _setRoom({ dispatch, getState }, next, action) {
sendAnalytics(createStartAudioOnlyEvent(audioOnly)); sendAnalytics(createStartAudioOnlyEvent(audioOnly));
logger.log(`Start audio only set to ${audioOnly.toString()}`); logger.log(`Start audio only set to ${audioOnly.toString()}`);
dispatch(setAudioOnly(audioOnly)); dispatch(setAudioOnly(audioOnly, false));
return next(action); return next(action);
} }

View File

@ -55,7 +55,7 @@ function _maybeSetAudioOnly(
{ dispatch }, { dispatch },
{ settings: { startAudioOnly } }) { { settings: { startAudioOnly } }) {
if (typeof startAudioOnly === 'boolean') { if (typeof startAudioOnly === 'boolean') {
dispatch(setAudioOnly(startAudioOnly)); dispatch(setAudioOnly(startAudioOnly, true));
} }
} }