forked from jitsi/jitsi-meet
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix typo issues and centralize the participant info with the "getPart…
…icipantInfoFromJwt" function remove middleware.js from jane-wating-area component add getParticipantType function to return participant type from store. update checkRoomStatus, getRemoteParticipantsReadyStatus & updateParticipantReadyStatus functions.
- Loading branch information
Ivan Jiang
committed
Oct 19, 2020
1 parent
ed596cf
commit bfd4652
Showing
11 changed files
with
120 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ import { | |
VIDEO_QUALITY_LEVELS | ||
} from './constants'; | ||
import logger from './logger'; | ||
import jwtDecode from 'jwt-decode'; | ||
|
||
/** | ||
* Attach a set of local tracks to a conference. | ||
|
@@ -351,3 +352,15 @@ export function sendLocalParticipant( | |
|
||
conference.setDisplayName(name); | ||
} | ||
|
||
export function isJaneTestMode(state) { | ||
const { jwt } = state['features/base/jwt']; | ||
const jwtPayload = jwt && jwtDecode(jwt) || null; | ||
const context = jwtPayload && jwtPayload.context || null; | ||
const user = context && context.user || null; | ||
const participantId = user && user.participant_id; | ||
const videoChatSessionId = context && context.video_chat_session_id; | ||
const participantEmail = user && user.email; | ||
|
||
return participantId === 0 && videoChatSessionId === 0 && participantEmail === '[email protected]'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ import { getRemoteTracks } from '../../../tracks'; | |
import jwtDecode from 'jwt-decode'; | ||
import View from 'react-native-webrtc/RTCView'; | ||
import moment from 'moment'; | ||
import { isJaneTestMode } from '../../../conference'; | ||
|
||
const watermarkImg = require('../../../../../../images/watermark.png'); | ||
|
||
|
@@ -115,18 +116,8 @@ class WaitingMessage extends Component<Props, State> { | |
); | ||
} | ||
|
||
_IsTestMode() { | ||
const { jwt } = this.props; | ||
const jwtPayload = jwt && jwtDecode(jwt) || null; | ||
const participantId = jwtPayload && jwtPayload.context && jwtPayload.context.user && jwtPayload.context.user.participant_id; | ||
const videoChatSessionId = jwtPayload && jwtPayload.context && jwtPayload.context.video_chat_session_id; | ||
const participantEmail = jwtPayload && jwtPayload.context && jwtPayload.context.user && jwtPayload.context.user.email; | ||
|
||
return jwtPayload && participantId === 0 && videoChatSessionId === 0 && participantEmail === '[email protected]'; | ||
} | ||
|
||
getWaitingMessage() { | ||
const { waitingMessageFromProps } = this.props; | ||
const { waitingMessageFromProps, isJaneTestMode } = this.props; | ||
const { beforeAppointmentStart, appointmentStartAt } = this.state; | ||
|
||
let header = <Text | ||
|
@@ -149,7 +140,7 @@ class WaitingMessage extends Component<Props, State> { | |
.format('hh:mm A')}</Text>); | ||
} | ||
|
||
if (this._IsTestMode()) { | ||
if (isJaneTestMode) { | ||
header = | ||
<Text style={styles.waitingMessageHeader}>Testing your audio and | ||
video...</Text>; | ||
|
@@ -205,7 +196,8 @@ function _mapStateToProps(state) { | |
return { | ||
jwt, | ||
appstate: appstate && appstate.appState, | ||
conferenceHasStarted: participantCount > 1 && remoteTracks.length > 0 | ||
conferenceHasStarted: participantCount > 1 && remoteTracks.length > 0, | ||
isJaneTestMode: isJaneTestMode(state) | ||
}; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.