Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 0 additions & 6 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,6 @@ dependencies {
implementation('com.crashlytics.sdk.android:crashlytics:2.9.9@aar') {
transitive = true
}
implementation(project(':react-native-jitsi-meet')) {
exclude group: 'com.facebook.react', module:'react-native-fast-image'
exclude group: 'com.facebook.react', module:'react-native-vector-icons'
exclude group: 'com.facebook.react', module:'react-native-webview'
exclude group: 'com.facebook.react', module:'react-native-background-timer'
}

if (enableHermes) {
def hermesPath = "../../node_modules/hermesvm/android/";
Expand Down
13 changes: 0 additions & 13 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,7 @@
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission-sdk-23 android:name="android.permission.VIBRATE"/>

<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus"/>

<permission
android:name="${applicationId}.permission.JITSI_BROADCAST"
android:label="Jitsi Meet Event Broadcast"
android:protectionLevel="normal"
></permission>
<uses-permission android:name="${applicationId}.permission.JITSI_BROADCAST"/>

<application
android:name=".MainApplication"
Expand Down Expand Up @@ -64,7 +52,6 @@
<data android:mimeType="*/*" />
</intent-filter>
</activity>
<activity android:name="com.reactnativejitsimeet.JitsiMeetNavigatorActivity" />
<meta-data
android:name="com.bugsnag.android.API_KEY"
android:value="${BugsnagAPIKey}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import android.util.Log;
import android.content.Context;
import android.os.Bundle;

import androidx.annotation.Nullable;

import com.facebook.react.PackageList;
Expand Down Expand Up @@ -34,7 +33,6 @@
import io.invertase.firebase.perf.RNFirebasePerformancePackage;

import com.nozbe.watermelondb.WatermelonDBPackage;
import com.reactnativejitsimeet.JitsiMeetPackage;

import java.util.Arrays;
import java.util.List;
Expand All @@ -59,7 +57,6 @@ protected List<ReactPackage> getPackages() {
packages.add(new KeyboardInputPackage(MainApplication.this));
packages.add(new RNNotificationsPackage(MainApplication.this));
packages.add(new WatermelonDBPackage());
packages.add(new JitsiMeetPackage());
packages.add(new ModuleRegistryAdapter(mModuleRegistryProvider));
return packages;
}
Expand Down
2 changes: 0 additions & 2 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ include ':reactnativenotifications'
project(':reactnativenotifications').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-notifications/android/app')
include ':reactnativekeyboardinput'
project(':reactnativekeyboardinput').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-keyboard-input/lib/android')
include ':react-native-jitsi-meet'
project(':react-native-jitsi-meet').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-jitsi-meet/android')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
5 changes: 4 additions & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ const NewMessageStack = createStackNavigator({

const InsideStackModal = createStackNavigator({
Main: ChatsDrawer,
NewMessageStack
NewMessageStack,
JitsiMeetView: {
getScreen: () => require('./views/JitsiMeetView').default
}
},
{
mode: 'modal',
Expand Down
33 changes: 3 additions & 30 deletions app/lib/methods/callJitsi.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import JitsiMeet, { JitsiMeetEvents } from 'react-native-jitsi-meet';
import BackgroundTimer from 'react-native-background-timer';

import reduxStore from '../createStore';

let jitsiTimeout = null;
import Navigation from '../Navigation';

const jitsiBaseUrl = ({
Jitsi_Enabled, Jitsi_SSL, Jitsi_Domain, Jitsi_URL_Room_Prefix, uniqueID
Expand All @@ -21,33 +17,10 @@ const jitsiBaseUrl = ({
return `${ urlProtocol }${ urlDomain }${ prefix }${ uniqueIdentifier }`;
};

function callJitsi(rid, options = {}) {
function callJitsi(rid, onlyAudio = false) {
const { settings } = reduxStore.getState();

// Jitsi Update Timeout needs to be called every 10 seconds to make sure
// call is not ended and is available to web users.
JitsiMeet.initialize();
const conferenceJoined = JitsiMeetEvents.addListener('CONFERENCE_JOINED', () => {
this.updateJitsiTimeout(rid).catch(e => console.log(e));
if (jitsiTimeout) {
BackgroundTimer.clearInterval(jitsiTimeout);
}
jitsiTimeout = BackgroundTimer.setInterval(() => {
this.updateJitsiTimeout(rid).catch(e => console.log(e));
}, 10000);
});
const conferenceLeft = JitsiMeetEvents.addListener('CONFERENCE_LEFT', () => {
if (jitsiTimeout) {
BackgroundTimer.clearInterval(jitsiTimeout);
}
if (conferenceJoined && conferenceJoined.remove) {
conferenceJoined.remove();
}
if (conferenceLeft && conferenceLeft.remove) {
conferenceLeft.remove();
}
});
JitsiMeet.call(`${ jitsiBaseUrl(settings) }${ rid }`, options);
Navigation.navigate('JitsiMeetView', { url: `${ jitsiBaseUrl(settings) }${ rid }`, onlyAudio, rid });
}

export default callJitsi;
67 changes: 67 additions & 0 deletions app/views/JitsiMeetView.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import React from 'react';
import PropTypes from 'prop-types';
import JitsiMeet, { JitsiMeetView as RNJitsiMeetView } from 'react-native-jitsi-meet';
import BackgroundTimer from 'react-native-background-timer';

import RocketChat from '../lib/rocketchat';

import sharedStyles from './Styles';

class JitsiMeetView extends React.Component {
static propTypes = {
navigation: PropTypes.object
}

constructor(props) {
super(props);
this.rid = props.navigation.getParam('rid');
this.onConferenceTerminated = this.onConferenceTerminated.bind(this);
this.onConferenceJoined = this.onConferenceJoined.bind(this);
this.jitsiTimeout = null;
}

componentDidMount() {
const { navigation } = this.props;
setTimeout(() => {
const url = navigation.getParam('url');
const onlyAudio = navigation.getParam('onlyAudio', false);
if (onlyAudio) {
JitsiMeet.audioCall(url);
} else {
JitsiMeet.call(url);
}
}, 1000);
}

// Jitsi Update Timeout needs to be called every 10 seconds to make sure
// call is not ended and is available to web users.
onConferenceJoined = () => {
RocketChat.updateJitsiTimeout(this.rid).catch(e => console.log(e));
if (this.jitsiTimeout) {
BackgroundTimer.clearInterval(this.jitsiTimeout);
}
this.jitsiTimeout = BackgroundTimer.setInterval(() => {
RocketChat.updateJitsiTimeout(this.rid).catch(e => console.log(e));
}, 10000);
}

onConferenceTerminated = () => {
const { navigation } = this.props;
if (this.jitsiTimeout) {
BackgroundTimer.clearInterval(this.jitsiTimeout);
}
navigation.pop();
}

render() {
return (
<RNJitsiMeetView
onConferenceTerminated={this.onConferenceTerminated}
onConferenceJoined={this.onConferenceJoined}
style={sharedStyles.root}
/>
);
}
}

export default JitsiMeetView;
2 changes: 1 addition & 1 deletion app/views/RoomActionsView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class RoomActionsView extends React.Component {
{
icon: 'livechat',
name: I18n.t('Voice_call'),
event: () => RocketChat.callJitsi(rid, { videoMuted: true }),
event: () => RocketChat.callJitsi(rid, true),
testID: 'room-actions-voice'
},
{
Expand Down
2 changes: 1 addition & 1 deletion app/views/RoomView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ class RoomView extends React.Component {
if (jitsiTimeout < Date.now()) {
showErrorAlert(I18n.t('Call_already_ended'));
} else {
RocketChat.callJitsi(this.rid, {});
RocketChat.callJitsi(this.rid);
}
};

Expand Down
6 changes: 6 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ PODS:
- React
- react-native-document-picker (3.2.4):
- React
- react-native-jitsi-meet (2.0.0):
- React
- react-native-keyboard-input (5.3.1):
- React
- react-native-keyboard-tracking-view (5.5.0):
Expand Down Expand Up @@ -283,6 +285,7 @@ DEPENDENCIES:
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- react-native-background-timer (from `../node_modules/react-native-background-timer`)
- react-native-document-picker (from `../node_modules/react-native-document-picker`)
- react-native-jitsi-meet (from `../node_modules/react-native-jitsi-meet`)
- react-native-keyboard-input (from `../node_modules/react-native-keyboard-input`)
- react-native-keyboard-tracking-view (from `../node_modules/react-native-keyboard-tracking-view`)
- react-native-notifications (from `../node_modules/react-native-notifications`)
Expand Down Expand Up @@ -399,6 +402,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-background-timer"
react-native-document-picker:
:path: "../node_modules/react-native-document-picker"
react-native-jitsi-meet:
:path: "../node_modules/react-native-jitsi-meet"
react-native-keyboard-input:
:path: "../node_modules/react-native-keyboard-input"
react-native-keyboard-tracking-view:
Expand Down Expand Up @@ -536,6 +541,7 @@ SPEC CHECKSUMS:
React-jsinspector: 73f24a02fa684ed6a2b828ba116874a2191ded88
react-native-background-timer: 1b6e6b4e10f1b74c367a1fdc3c72b67c619b222b
react-native-document-picker: c36bf5f067a581657ecaf7124dcd921a8be19061
react-native-jitsi-meet: 27446bafcf8be0050c1e275cbddd5ea83cae7669
react-native-keyboard-input: 2a01e0aceac330592bbe9b3101761bb9d8e6d1fb
react-native-keyboard-tracking-view: 1ebd24a2b6ca2314549aa51775995678094bffa1
react-native-notifications: 163ddedac6fcc8d850ea15b06abdadcacdff00f1
Expand Down

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

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

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

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

30 changes: 30 additions & 0 deletions ios/Pods/Local Podspecs/react-native-jitsi-meet.podspec.json

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

6 changes: 6 additions & 0 deletions ios/Pods/Manifest.lock

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

Loading