-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Chore: Update Jitsi to 3.6.0 #3292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
1283e4e
70a2f68
8128eb7
2cd3354
1aac6f4
8329069
d87b46a
5984ccb
71443b0
a2ab893
be22c94
7d082d2
7da55d8
e9a1f6c
6d530d2
ec8182f
95490d3
dc2fe8e
c0e7c95
48774fc
344b5c1
6a9603b
c9d1a77
aff863a
7cd419b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| import React from 'react'; | ||
| import { StyleSheet } from 'react-native'; | ||
| import PropTypes from 'prop-types'; | ||
| import JitsiMeet, { JitsiMeetView as RNJitsiMeetView } from 'react-native-jitsi-meet'; | ||
| import BackgroundTimer from 'react-native-background-timer'; | ||
|
|
@@ -7,8 +8,8 @@ import { connect } from 'react-redux'; | |
| import RocketChat from '../lib/rocketchat'; | ||
| import { getUserSelector } from '../selectors/login'; | ||
|
|
||
| import sharedStyles from './Styles'; | ||
| import { logEvent, events } from '../utils/log'; | ||
| import { isAndroid, isIOS } from '../utils/deviceInfo'; | ||
|
|
||
| const formatUrl = (url, baseUrl, uriSize, avatarAuthURLFragment) => ( | ||
| `${ baseUrl }/avatar/${ url }?format=png&width=${ uriSize }&height=${ uriSize }${ avatarAuthURLFragment }` | ||
|
|
@@ -30,39 +31,45 @@ class JitsiMeetView extends React.Component { | |
| constructor(props) { | ||
| super(props); | ||
| this.rid = props.route.params?.rid; | ||
| this.onConferenceTerminated = this.onConferenceTerminated.bind(this); | ||
| this.onConferenceJoined = this.onConferenceJoined.bind(this); | ||
| this.url = props.route.params?.url; | ||
| this.jitsiTimeout = null; | ||
| } | ||
|
|
||
| componentDidMount() { | ||
| const { route, user, baseUrl } = this.props; | ||
| const { user, baseUrl } = props; | ||
| const { | ||
| name: displayName, id: userId, token, username | ||
| } = user; | ||
|
|
||
| const avatarAuthURLFragment = `&rc_token=${ token }&rc_uid=${ userId }`; | ||
| const avatar = formatUrl(username, baseUrl, 100, avatarAuthURLFragment); | ||
|
|
||
| setTimeout(() => { | ||
| const userInfo = { | ||
| this.state = { | ||
| userInfo: { | ||
| displayName, | ||
| avatar | ||
| }; | ||
| const url = route.params?.url; | ||
| const onlyAudio = route.params?.onlyAudio ?? false; | ||
| if (onlyAudio) { | ||
| JitsiMeet.audioCall(url, userInfo); | ||
| } else { | ||
| JitsiMeet.call(url, userInfo); | ||
| } | ||
| }, 1000); | ||
| }; | ||
| } | ||
|
|
||
| componentDidMount() { | ||
| const { route } = this.props; | ||
| const { userInfo } = this.state; | ||
|
|
||
| if (isIOS) { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm calling Jitsi on iOS the old way and Android using props. |
||
| setTimeout(() => { | ||
| const onlyAudio = route.params?.onlyAudio ?? false; | ||
| if (onlyAudio) { | ||
| JitsiMeet.audioCall(this.url, userInfo); | ||
| } else { | ||
| JitsiMeet.call(this.url, userInfo); | ||
| } | ||
| }, 1000); | ||
| } | ||
| } | ||
|
|
||
| componentWillUnmount() { | ||
| logEvent(events.JM_CONFERENCE_TERMINATE); | ||
| if (this.jitsiTimeout) { | ||
| BackgroundTimer.clearInterval(this.jitsiTimeout); | ||
| this.jitsiTimeout = null; | ||
| BackgroundTimer.stopBackgroundTimer(); | ||
| } | ||
| JitsiMeet.endCall(); | ||
| } | ||
|
|
@@ -74,6 +81,8 @@ class JitsiMeetView extends React.Component { | |
| RocketChat.updateJitsiTimeout(this.rid).catch(e => console.log(e)); | ||
| if (this.jitsiTimeout) { | ||
| BackgroundTimer.clearInterval(this.jitsiTimeout); | ||
| BackgroundTimer.stopBackgroundTimer(); | ||
| this.jitsiTimeout = null; | ||
| } | ||
| this.jitsiTimeout = BackgroundTimer.setInterval(() => { | ||
| RocketChat.updateJitsiTimeout(this.rid).catch(e => console.log(e)); | ||
|
|
@@ -83,18 +92,20 @@ class JitsiMeetView extends React.Component { | |
| onConferenceTerminated = () => { | ||
| logEvent(events.JM_CONFERENCE_TERMINATE); | ||
| const { navigation } = this.props; | ||
| if (this.jitsiTimeout) { | ||
| BackgroundTimer.clearInterval(this.jitsiTimeout); | ||
| } | ||
| navigation.pop(); | ||
| } | ||
|
|
||
| render() { | ||
| const { userInfo } = this.state; | ||
| const { route } = this.props; | ||
| const onlyAudio = route.params?.onlyAudio ?? false; | ||
| const options = isAndroid ? { url: this.url, userInfo, audioOnly: onlyAudio } : null; | ||
| return ( | ||
| <RNJitsiMeetView | ||
| onConferenceTerminated={this.onConferenceTerminated} | ||
| onConferenceJoined={this.onConferenceJoined} | ||
| style={sharedStyles.container} | ||
| style={StyleSheet.absoluteFill} | ||
| options={options} | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is what triggers the call on Android from now on. |
||
| /> | ||
| ); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ end | |
|
|
||
| abstract_target 'defaults' do | ||
| # force use our own JitsiMeetSDK | ||
| pod 'JitsiMeetSDK', :git => 'https://github.com/RocketChat/jitsi-meet-ios-sdk-releases.git' | ||
| pod 'JitsiMeetSDK', :git => 'https://github.com/RocketChat/jitsi-meet-ios-sdk-releases.git', :branch => '3.7' | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to remove this branch and reinstall pods before merging |
||
|
|
||
| all_pods | ||
|
|
||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not actively maintaining libre, so I just changed the URL to match, but there's no point to test at this time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
httpsinstead