Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ buildscript {
kotlin_version = "1.3.50"
supportLibVersion = "28.0.0"
libre_build = !(isPlay.toBoolean())
jitsi_url = isPlay ? "https://github.com/RocketChat/jitsi-maven-repository/raw/master/releases" : "https://github.com/RocketChat/jitsi-maven-repository/raw/libre/releases"
jitsi_version = isPlay ? "2.10.2" : "2.10.0-libre"
jitsi_url = isPlay ? "http://github.com/RocketChat/jitsi-maven-repository/raw/3.7.0/releases" : "https://github.com/jitsi/jitsi-maven-repository/raw/libre/releases"

Copy link
Copy Markdown
Member Author

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https instead

jitsi_version = isPlay ? "3.7.0" : "3.7.0-libre"
}

repositories {
Expand Down
55 changes: 33 additions & 22 deletions app/views/JitsiMeetView.js
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';
Expand All @@ -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 }`
Expand All @@ -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) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The 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.
For some reason I didn't understand, Android is not working this way anymore.

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();
}
Expand All @@ -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));
Expand All @@ -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}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what triggers the call on Android from now on.

/>
);
}
Expand Down
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The 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

Expand Down
17 changes: 9 additions & 8 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ PODS:
- GoogleUtilities/UserDefaults (6.7.1):
- GoogleUtilities/Logger
- hermes-engine (0.7.2)
- JitsiMeetSDK (2.10.2)
- JitsiMeetSDK (3.7.0)
- KeyCommands (2.0.3):
- React
- libevent (2.1.12)
Expand Down Expand Up @@ -403,8 +403,8 @@ PODS:
- React-Core
- react-native-document-picker (5.2.0):
- React-Core
- react-native-jitsi-meet (2.4.0):
- JitsiMeetSDK
- react-native-jitsi-meet (3.7.0):
- JitsiMeetSDK (= 3.7.0)
- React
- react-native-mmkv-storage (0.3.5):
- MMKV (= 1.2.1)
Expand Down Expand Up @@ -614,7 +614,7 @@ DEPENDENCIES:
- FlipperKit/SKIOSNetworkPlugin (~> 0.75.1)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- hermes-engine (~> 0.7.2)
- JitsiMeetSDK (from `https://github.com/RocketChat/jitsi-meet-ios-sdk-releases.git`)
- JitsiMeetSDK (from `https://github.com/RocketChat/jitsi-meet-ios-sdk-releases.git`, branch `3.7`)
- KeyCommands (from `../node_modules/react-native-keycommands`)
- libevent (~> 2.1.12)
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
Expand Down Expand Up @@ -764,6 +764,7 @@ EXTERNAL SOURCES:
glog:
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
JitsiMeetSDK:
:branch: '3.7'
:git: https://github.com/RocketChat/jitsi-meet-ios-sdk-releases.git
KeyCommands:
:path: "../node_modules/react-native-keycommands"
Expand Down Expand Up @@ -920,7 +921,7 @@ EXTERNAL SOURCES:

CHECKOUT OPTIONS:
JitsiMeetSDK:
:commit: 34660a3a34798fe28fcfd340f9ad30184b9fa0d1
:commit: f81bd9554640f7a51783d15ed36487c47e6bad41
:git: https://github.com/RocketChat/jitsi-meet-ios-sdk-releases.git

SPEC CHECKSUMS:
Expand Down Expand Up @@ -960,7 +961,7 @@ SPEC CHECKSUMS:
GoogleDataTransportCCTSupport: 489c1265d2c85b68187a83a911913d190012158d
GoogleUtilities: e121a3867449ce16b0e35ddf1797ea7a389ffdf2
hermes-engine: 7d97ba46a1e29bacf3e3c61ecb2804a5ddd02d4f
JitsiMeetSDK: ef6dd5cfa6d9badf009c7dba1a2c1365bfaae6b0
JitsiMeetSDK: 1bedd99910a335035fbee5045379d8444f134f79
KeyCommands: f66c535f698ed14b3d3a4e58859d79a827ea907e
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
libwebp: 946cb3063cea9236285f7e9a8505d806d30e07f3
Expand All @@ -986,7 +987,7 @@ SPEC CHECKSUMS:
react-native-cameraroll: 88f4e62d9ecd0e1f253abe4f685474f2ea14bfa2
react-native-cookies: 2cb6ef472da68610dfcf0eaee68464c244943abd
react-native-document-picker: f1b5398801b332c77bc62ae0eae2116f49bdff26
react-native-jitsi-meet: f2407aca85566e031ee7b222e497ee5ecb6623de
react-native-jitsi-meet: c59c8f7c766101e1a7ed5c17a8fe205be29113de
react-native-mmkv-storage: 48729fe90e850ef2fdc9d3714b7030c7c51d82b0
react-native-netinfo: e849fc21ca2f4128a5726c801a82fc6f4a6db50d
react-native-notifications: ee8fd739853e72694f3af8b374c8ccb106b7b227
Expand Down Expand Up @@ -1049,6 +1050,6 @@ SPEC CHECKSUMS:
Yoga: 575c581c63e0d35c9a83f4b46d01d63abc1100ac
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 70acbdf88ff07173b5e52fdbfd3825f5b6a07b83
PODFILE CHECKSUM: 74b43d55ce52dbda5c6e08c479618ceb0354ed2b

COCOAPODS: 1.10.1
17 changes: 9 additions & 8 deletions ios/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading