feat(aot-prejoin) Add support for showing AOT on prejoin

This commit is contained in:
Horatiu Muresan
2022-08-30 11:42:29 +03:00
committed by GitHub
parent dbcbafe088
commit cc5a3e499f
8 changed files with 160 additions and 59 deletions

View File

@@ -41,9 +41,11 @@ import {
isLocalParticipantModerator,
hasRaisedHand,
grantModerator,
overwriteParticipantsNames
overwriteParticipantsNames,
LOCAL_PARTICIPANT_DEFAULT_ID
} from '../../react/features/base/participants';
import { updateSettings } from '../../react/features/base/settings';
import { getDisplayName } from '../../react/features/base/settings/functions.web';
import { isToggleCameraEnabled, toggleCamera } from '../../react/features/base/tracks';
import {
autoAssignToBreakoutRooms,
@@ -63,6 +65,7 @@ import { openChat } from '../../react/features/chat/actions.web';
import {
processExternalDeviceRequest
} from '../../react/features/device-selection/functions';
import { appendSuffix } from '../../react/features/display-name';
import { isEnabled as isDropboxEnabled } from '../../react/features/dropbox';
import { setMediaEncryptionKey, toggleE2EE } from '../../react/features/e2ee/actions';
import { setVolume } from '../../react/features/filmstrip';
@@ -299,7 +302,7 @@ function initCommands() {
'toggle-video': () => {
sendAnalytics(createApiEvent('toggle-video'));
logger.log('Video toggle: API command received');
APP.conference.toggleVideoMuted(false /* no UI */);
APP.conference.toggleVideoMuted(false /* no UI */, true /* ensure track */);
},
'toggle-film-strip': () => {
sendAnalytics(createApiEvent('film.strip.toggled'));
@@ -1451,6 +1454,39 @@ class API {
});
}
/**
* Notify external application (if API is enabled) that the prejoin video
* visibility had changed.
*
* @param {boolean} isVisible - Whether the prejoin video is visible.
* @returns {void}
*/
notifyPrejoinVideoVisibilityChanged(isVisible: boolean) {
this._sendEvent({
name: 'on-prejoin-video-changed',
isVisible
});
}
/**
* Notify external application (if API is enabled) that the prejoin
* screen was loaded.
*
* @returns {void}
*/
notifyPrejoinLoaded() {
const state = APP.store.getState();
const { defaultLocalDisplayName } = state['features/base/config'];
const displayName = getDisplayName(state);
this._sendEvent({
name: 'prejoin-screen-loaded',
id: LOCAL_PARTICIPANT_DEFAULT_ID,
displayName,
formattedDisplayName: appendSuffix(displayName, defaultLocalDisplayName)
});
}
/**
* Notify external application of an unexpected camera-related error having
* occurred.