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.
add appState listener to send participant left status signal if app i…
…s inactive.
- Loading branch information
Ivan Jiang
committed
Oct 6, 2020
1 parent
8753da0
commit ed596cf
Showing
7 changed files
with
81 additions
and
131 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,9 +100,9 @@ class WaitingMessage extends Component<Props, State> { | |
} | ||
|
||
render() { | ||
const { conferenceHasStarted } = this.props; | ||
const { conferenceHasStarted, appstate } = this.props; | ||
|
||
if (conferenceHasStarted) { | ||
if (conferenceHasStarted || appstate !== "active") { | ||
return null; | ||
} | ||
|
||
|
@@ -115,28 +115,52 @@ 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 { beforeAppointmentStart, appointmentStartAt } = this.state; | ||
let header, text; | ||
header = <Text | ||
|
||
let header = <Text | ||
style={styles.waitingMessageHeader}>{waitingMessageFromProps ? waitingMessageFromProps.header | ||
: 'Waiting for the other participant to join...'}</Text>; | ||
text = <Text style={styles.waitingMessageText}>{ | ||
|
||
let text = <Text style={styles.waitingMessageText}>{ | ||
waitingMessageFromProps ? waitingMessageFromProps.text : | ||
'Sit back, relax and take a moment for yourself.' | ||
}</Text>; | ||
|
||
if (beforeAppointmentStart && appointmentStartAt && !waitingMessageFromProps) { | ||
const time = moment(appointmentStartAt, 'YYYY-MM-DD HH:mm') | ||
.format('YYYY-MM-DD HH:mm'); | ||
|
||
header = ( | ||
<Text style={styles.waitingMessageHeader}>Your appointment will | ||
begin | ||
at {getLocalizedDateFormatter(time) | ||
.format('hh:mm A')}</Text>); | ||
} | ||
|
||
return <View style={{ backgroundColor: 'transparent' }}> | ||
if (this._IsTestMode()) { | ||
header = | ||
<Text style={styles.waitingMessageHeader}>Testing your audio and | ||
video...</Text>; | ||
|
||
text = <Text style={styles.waitingMessageText}> | ||
This is just a test area. Begin your online appointment from | ||
your Upcoming Appointments page. | ||
</Text>; | ||
} | ||
|
||
return <View style={{ backgroundColor: 'transparent'}}> | ||
{ | ||
header | ||
} | ||
|
@@ -147,26 +171,14 @@ class WaitingMessage extends Component<Props, State> { | |
} | ||
|
||
_renderWaitingMessage() { | ||
const { stopAnimation} = this.props; | ||
const { beforeAppointmentStart, appointmentStartAt } = this.state; | ||
const { stopAnimation } = this.props; | ||
const animate = stopAnimation ? null : this.animatedValue.interpolate({ | ||
inputRange: [ 0, .5, 1 ], | ||
outputRange: [ .1, 1, .1 ] | ||
}); | ||
|
||
let header = <Text style={styles.waitingMessageHeader}>Waiting for the | ||
other participant to join...</Text>; | ||
const image = <Image style={styles.watermark} | ||
source={watermarkImg}/>; | ||
if (beforeAppointmentStart && appointmentStartAt) { | ||
const time = moment(appointmentStartAt, 'YYYY-MM-DD HH:mm') | ||
.format('YYYY-MM-DD HH:mm'); | ||
header = ( | ||
<Text style={styles.waitingMessageHeader}>Your appointment will | ||
begin | ||
at {getLocalizedDateFormatter(time) | ||
.format('hh:mm A')}</Text>); | ||
} | ||
|
||
return (<View style={[ styles.waitingMessageContainer ]}> | ||
<Animated.View className='waitingMessage' | ||
|
@@ -188,9 +200,11 @@ function _mapStateToProps(state) { | |
const { jwt } = state['features/base/jwt']; | ||
const participantCount = getParticipantCount(state); | ||
const remoteTracks = getRemoteTracks(state['features/base/tracks']); | ||
const appstate = state['features/background']; | ||
|
||
return { | ||
jwt, | ||
appstate: appstate && appstate.appState, | ||
conferenceHasStarted: participantCount > 1 && remoteTracks.length > 0 | ||
}; | ||
} | ||
|
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
74 changes: 0 additions & 74 deletions
74
react/features/jane-waiting-area-native/components/DeviceStatus.native.js
This file was deleted.
Oops, something went wrong.
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.