Skip to content

Commit

Permalink
Merge branch 'jitsi:master' into wilson-jitsi-meet-8
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonfurtado2000 authored Jan 20, 2025
2 parents 3be97eb + 44bd701 commit af18936
Show file tree
Hide file tree
Showing 51 changed files with 656 additions and 321 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ tsconfig.json
react-native-sdk/*.tgz
react-native-sdk/android/src
!react-native-sdk/android/src/main/java/org/jitsi/meet/sdk/JitsiMeetReactNativePackage.java
!react-native-sdk/android/src/main/java/org/jitsi/meet/sdk/JitsiMeetOngoingConferenceService.java
!react-native-sdk/android/src/main/java/org/jitsi/meet/sdk/JMOngoingConferenceModule.java
!react-native-sdk/android/src/main/java/org/jitsi/meet/sdk/RNOngoingNotification.java
react-native-sdk/images
react-native-sdk/ios
react-native-sdk/lang
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ext {
kotlinVersion = "1.9.24"
buildToolsVersion = "34.0.0"
compileSdkVersion = 34
minSdkVersion = 24
minSdkVersion = 26
targetSdkVersion = 34
supportLibVersion = "28.0.0"
ndkVersion = "26.1.10909125"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import android.content.Context;
import android.media.AudioManager;
import android.os.Build;
import android.telecom.CallAudioState;
import androidx.annotation.RequiresApi;

Expand All @@ -34,7 +33,6 @@
* {@link AudioModeModule.AudioDeviceHandlerInterface} module implementing device handling for
* Android versions >= O when ConnectionService is enabled.
*/
@RequiresApi(Build.VERSION_CODES.O)
class AudioDeviceHandlerConnectionService implements
AudioModeModule.AudioDeviceHandlerInterface,
RNConnectionService.CallAudioStateListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import android.media.AudioDeviceInfo;
import android.media.AudioFocusRequest;
import android.media.AudioManager;
import android.os.Build;

import java.util.HashSet;
import java.util.Set;
Expand Down Expand Up @@ -227,22 +226,17 @@ public boolean setMode(int mode) {
audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
audioManager.setMicrophoneMute(false);

int gotFocus;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
gotFocus = audioManager.requestAudioFocus(new AudioFocusRequest.Builder(AudioManager.AUDIOFOCUS_GAIN)
.setAudioAttributes(
new AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_VOICE_COMMUNICATION)
.setContentType(AudioAttributes.CONTENT_TYPE_SPEECH)
.build()
)
.setAcceptsDelayedFocusGain(true)
.setOnAudioFocusChangeListener(this)
.build()
);
} else {
gotFocus = audioManager.requestAudioFocus(this, AudioManager.STREAM_VOICE_CALL, AudioManager.AUDIOFOCUS_GAIN);
}
int gotFocus = audioManager.requestAudioFocus(new AudioFocusRequest.Builder(AudioManager.AUDIOFOCUS_GAIN)
.setAudioAttributes(
new AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_VOICE_COMMUNICATION)
.setContentType(AudioAttributes.CONTENT_TYPE_SPEECH)
.build()
)
.setAcceptsDelayedFocusGain(true)
.setOnAudioFocusChangeListener(this)
.build()
);

if (gotFocus == AudioManager.AUDIOFOCUS_REQUEST_FAILED) {
JitsiMeetLogger.w(TAG + " Audio focus request failed");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import android.app.Activity;
import android.content.Context;
import android.media.AudioManager;
import android.os.Build;

import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Promise;
Expand Down Expand Up @@ -58,7 +57,6 @@
* Before a call has started and after it has ended the
* {@code AudioModeModule.DEFAULT} mode should be used.
*/
@SuppressLint("AnnotateVersionCheck")
@ReactModule(name = AudioModeModule.NAME)
class AudioModeModule extends ReactContextBaseJavaModule {
public static final String NAME = "AudioMode";
Expand All @@ -84,11 +82,10 @@ class AudioModeModule extends ReactContextBaseJavaModule {
/**
* Whether or not the ConnectionService is used for selecting audio devices.
*/
private static final boolean supportsConnectionService = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
private static boolean useConnectionService_ = supportsConnectionService;
private static boolean useConnectionService_ = true;

static boolean useConnectionService() {
return supportsConnectionService && useConnectionService_;
return useConnectionService_;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
*
* @author Pawel Domas
*/
@RequiresApi(api = Build.VERSION_CODES.O)
public class ConnectionService extends android.telecom.ConnectionService {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,7 @@ private static void doLaunch(Context context, HashMap<String, Object> extraData)
ComponentName componentName;

try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
componentName = context.startForegroundService(intent);
} else {
componentName = context.startService(intent);
}
componentName = context.startForegroundService(intent);
} catch (RuntimeException e) {
// Avoid crashing due to ForegroundServiceStartNotAllowedException (API level 31).
// See: https://developer.android.com/guide/components/foreground-services#background-start-restrictions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
import androidx.annotation.StringRes;
import androidx.core.app.NotificationCompat;

import android.os.Build;


/**
* Helper class for creating the ongoing notification which is used with
Expand All @@ -45,10 +43,6 @@ class OngoingNotification {
static final String ONGOING_CONFERENCE_CHANNEL_ID = "JitsiOngoingConferenceChannel";

static void createNotificationChannel(Activity context) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
return;
}

if (context == null) {
JitsiMeetLogger.w(TAG + " Cannot create notification channel: no current context");
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import android.app.Activity;
import android.app.ActivityManager;
import android.app.PictureInPictureParams;
import android.os.Build;
import android.util.Rational;

import com.facebook.react.bridge.Promise;
Expand Down Expand Up @@ -53,7 +52,7 @@ public PictureInPictureModule(ReactApplicationContext reactContext) {
// Android Go devices don't support PiP. There doesn't seem to be a better way to detect it than
// to use ActivityManager.isLowRamDevice().
// https://stackoverflow.com/questions/58340558/how-to-detect-android-go
isSupported = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !am.isLowRamDevice();
isSupported = !am.isLowRamDevice();
}

/**
Expand Down Expand Up @@ -82,7 +81,6 @@ public Map<String, Object> getConstants() {
* including when the activity is not visible (paused or stopped), if the
* screen is locked or if the user has an activity pinned.
*/
@TargetApi(Build.VERSION_CODES.O)
public void enterPictureInPicture() {
if (!isEnabled) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import android.annotation.SuppressLint;
import android.content.Context;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.telecom.DisconnectCause;
import android.telecom.PhoneAccount;
Expand Down Expand Up @@ -32,7 +31,6 @@
*
* @author Pawel Domas
*/
@RequiresApi(api = Build.VERSION_CODES.O)
@ReactModule(name = RNConnectionService.NAME)
class RNConnectionService extends ReactContextBaseJavaModule {

Expand All @@ -53,7 +51,6 @@ class RNConnectionService extends ReactContextBaseJavaModule {
* @param audioRoute the new audio route to be set. See
* {@link android.telecom.CallAudioState} constants prefixed with "ROUTE_".
*/
@RequiresApi(api = Build.VERSION_CODES.O)
static void setAudioRoute(int audioRoute) {
for (ConnectionService.ConnectionImpl c
: ConnectionService.getConnections()) {
Expand Down
25 changes: 8 additions & 17 deletions conference.js
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ export default {
},

/**
* Will be filled with values only when config.debug is enabled.
* Will be filled with values only when config.testing.testMode is true.
* Its used by torture to check audio levels.
*/
audioLevelsMap: {},
Expand Down Expand Up @@ -1399,28 +1399,19 @@ export default {
/**
* Creates desktop (screensharing) {@link JitsiLocalTrack}
*
* @param {Object} [options] - Screen sharing options that will be passed to
* createLocalTracks.
* @param {Object} [options.desktopSharing]
* @param {Object} [options.desktopStream] - An existing desktop stream to
* use instead of creating a new desktop stream.
* @return {Promise.<JitsiLocalTrack>} - A Promise resolved with
* {@link JitsiLocalTrack} for the screensharing or rejected with
* {@link JitsiTrackError}.
*
* @private
*/
_createDesktopTrack(options = {}) {
_createDesktopTrack() {
const didHaveVideo = !this.isLocalVideoMuted();

const getDesktopStreamPromise = options.desktopStream
? Promise.resolve([ options.desktopStream ])
: createLocalTracksF({
desktopSharingSourceDevice: options.desktopSharingSources
? null : config._desktopSharingSourceDevice,
desktopSharingSources: options.desktopSharingSources,
devices: [ 'desktop' ]
});
const getDesktopStreamPromise = createLocalTracksF({
desktopSharingSourceDevice: config._desktopSharingSourceDevice,
devices: [ 'desktop' ]
});

return getDesktopStreamPromise.then(desktopStreams => {
// Stores the "untoggle" handler which remembers whether was
Expand Down Expand Up @@ -1597,9 +1588,9 @@ export default {
newLvl = 0;
}

if (config.debug) {
if (config.testing?.testMode) {
this.audioLevelsMap[id] = newLvl;
if (config.debugAudioLevels) {
if (config.testing?.debugAudioLevels) {
logger.log(`AudioLevel:${id}/${newLvl}`);
}
}
Expand Down
74 changes: 46 additions & 28 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ var config = {

// Dump transcripts to a <transcript> element for debugging.
// dumpTranscript: false,

// Log the audio levels.
// debugAudioLevels: true,

// Will replace ice candidates IPs with invalid ones in order to fail ice.
// failICE: true,
},

// Disables moderator indicators.
Expand Down Expand Up @@ -362,9 +368,6 @@ var config = {

// Recording

// DEPRECATED. Use recordingService.enabled instead.
// fileRecordingsEnabled: false,

// Enable the dropbox integration.
// dropbox: {
// appKey: '<APP_KEY>', // Specify your app key here.
Expand Down Expand Up @@ -785,6 +788,9 @@ var config = {
// and microsoftApiApplicationClientID
// enableCalendarIntegration: false,

// The client id for the google APIs used for the calendar integration, youtube livestreaming, etc.
// googleApiApplicationClientID: '<client_id>',

// Configs for prejoin page.
// prejoinConfig: {
// // When 'true', it shows an intermediate page before joining, where the user can configure their devices.
Expand Down Expand Up @@ -819,10 +825,6 @@ var config = {
// set or the lobby is not enabled.
// enableInsecureRoomNameWarning: false,

// Whether to automatically copy invitation URL after creating a room.
// Document should be focused for this option to work
// enableAutomaticUrlCopy: false,

// Array with avatar URL prefixes that need to use CORS.
// corsAvatarURLs: [ 'https://www.gravatar.com/avatar/' ],

Expand Down Expand Up @@ -1620,19 +1622,47 @@ var config = {
// For external entities (e. g. email), the localStorage key holding the token value for directory authentication
// peopleSearchTokenLocation: "mytoken",


// Options related to visitors.
// visitors: {
// // Starts audio/video when the participant is promoted from visitor.
// enableMediaOnPromote: {
// audio: true,
// video: true
// },
// },
// The default type of desktop sharing sources that will be used in the electron app.
// desktopSharingSources: ['screen', 'window'],

// Disables the echo cancelation for local audio tracks.
// disableAEC: true,

// Disables the auto gain control for local audio tracks.
// disableAGC: true,

// Disables the audio processing (echo cancelation, auto gain control and noise suppression) for local audio tracks.
// disableAP: true,

// Disables the anoise suppression for local audio tracks.
// disableNS: true,

// Replaces the display name with the JID of the participants.
// displayJids: true,

// Enables disables talk while muted detection.
// enableTalkWhileMuted: true,

// Sets the peer connection ICE transport policy to "relay".
// forceTurnRelay: true,

// List of undocumented settings used in jitsi-meet
/**
_immediateReloadThreshold
debug
debugAudioLevels
deploymentInfo
dialOutAuthUrl
dialOutCodesUrl
dialOutRegionUrl
disableRemoteControl
displayJids
firefox_fake_device
googleApiApplicationClientID
iAmRecorder
iAmSipGateway
microsoftApiApplicationClientID
Expand All @@ -1651,14 +1681,7 @@ var config = {
_peerConnStatusRtcMuteTimeout
avgRtpStatsN
desktopSharingSources
disableAEC
disableAGC
disableAP
disableHPF
disableLocalStats
disableNS
enableTalkWhileMuted
forceTurnRelay
hiddenDomain
hiddenFromRecorderFeatureEnabled
ignoreStartMuted
Expand Down Expand Up @@ -1825,9 +1848,10 @@ var config = {
// //disableLogCollector: true,
// // Individual loggers are customizable.
// loggers: {
// // The following are too verbose in their logging with the default level.
// 'modules/RTC/TraceablePeerConnection.js': 'info',
// 'modules/xmpp/strophe.util.js': 'log',
// // The following are too verbose in their logging with the default level.
// 'modules/RTC/TraceablePeerConnection.js': 'info',
// 'modules/xmpp/strophe.util.js': 'log',
// },
// },

// Application logo url
Expand Down Expand Up @@ -1885,12 +1909,6 @@ var config = {
// hideLoginButton: true,
};

// Temporary backwards compatibility with old mobile clients.
config.flags = config.flags || {};
config.flags.sourceNameSignaling = true;
config.flags.sendMultipleVideoStreams = true;
config.flags.receiveMultipleVideoStreams = true;

// Set the default values for JaaS customers
if (enableJaaS) {
config.dialInNumbersUrl = 'https://conference-mapper.jitsi.net/v1/access/dids';
Expand Down
Loading

0 comments on commit af18936

Please sign in to comment.