Simplify the source code (with the idea that source code which does not
exist does not have to be maintained).

Additionally, apply modifications to have the source code comply with the coding
style.

Overall, prepare saghul:audio-mode for merge into jitsi:master.
pull/1254/head jitsi-meet_1654
Lyubomir Marinov 8 years ago
parent 6c12681b9c
commit 3c04634609
  1. 14
      ios/app/AudioMode.h
  2. 130
      ios/app/AudioMode.m
  3. 4
      ios/app/POSIX.h
  4. 5
      ios/app/POSIX.m
  5. 6
      ios/jitsi-meet-react.xcodeproj/project.pbxproj
  6. 69
      react/features/audio-mode/middleware.js
  7. 20
      react/features/base/conference/actionTypes.js
  8. 46
      react/features/base/conference/actions.js
  9. 20
      react/features/base/react-native/AudioMode.js
  10. 1
      react/features/base/react-native/index.js

@ -1,14 +0,0 @@
#import <AVFoundation/AVFoundation.h>
#import <Foundation/Foundation.h>
#import "RCTBridgeModule.h"
@interface AudioMode : NSObject<RCTBridgeModule>
@property (nonatomic, readonly) AVAudioSession *session;
@property (nonatomic, readonly) NSString *category;
@property (nonatomic, readonly) NSString *mode;
@property (nonatomic, readonly) BOOL initialized;
@end

@ -1,8 +1,15 @@
#import "AudioMode.h" #import "RCTBridgeModule.h"
#import "RCTLog.h" #import "RCTLog.h"
#import <AVFoundation/AVFoundation.h>
@implementation AudioMode @interface AudioMode : NSObject<RCTBridgeModule>
@end
@implementation AudioMode {
NSString *_category;
NSString *_mode;
}
RCT_EXPORT_MODULE(); RCT_EXPORT_MODULE();
@ -12,20 +19,24 @@ typedef enum {
kAudioModeVideoCall kAudioModeVideoCall
} JitsiMeetAudioMode; } JitsiMeetAudioMode;
- (instancetype)init - (NSDictionary *)constantsToExport {
{ return @{
@"AUDIO_CALL" : [NSNumber numberWithInt: kAudioModeAudioCall],
@"DEFAULT" : [NSNumber numberWithInt: kAudioModeDefault],
@"VIDEO_CALL" : [NSNumber numberWithInt: kAudioModeVideoCall]
};
};
- (instancetype)init {
self = [super init]; self = [super init];
if (self) { if (self) {
_initialized = NO;
_category = nil; _category = nil;
_mode = nil; _mode = nil;
_session = [AVAudioSession sharedInstance];
} }
return self; return self;
} }
- (dispatch_queue_t)methodQueue - (dispatch_queue_t)methodQueue {
{
// Make sure all our methods run in the main thread. The route change // Make sure all our methods run in the main thread. The route change
// notification runs there so this will make sure it will only be fired // notification runs there so this will make sure it will only be fired
// after our changes have been applied (when we cause them, that is). // after our changes have been applied (when we cause them, that is).
@ -33,97 +44,90 @@ typedef enum {
} }
- (void)routeChanged:(NSNotification*)notification { - (void)routeChanged:(NSNotification*)notification {
NSDictionary *dict = notification.userInfo; NSInteger reason
NSInteger reason = [[dict valueForKey:AVAudioSessionRouteChangeReasonKey] = [[notification.userInfo
integerValue]; valueForKey:AVAudioSessionRouteChangeReasonKey]
integerValue];
switch (reason) { switch (reason) {
case AVAudioSessionRouteChangeReasonCategoryChange: { case AVAudioSessionRouteChangeReasonCategoryChange:
// The category has changed, check if it's the one we want and adjust // The category has changed. Check if it's the one we want and adjust as
// as needed. // needed.
BOOL success; [self setCategory:_category mode:_mode error:nil];
NSError *error; break;
if (_session.category != _category) {
success = [_session setCategory: _category error: &error];
if (!success || error) {
RCTLogInfo(@"Error overriding the desired session category");
}
}
if (_session.mode != _mode) {
success = [_session setMode: _mode error: &error];
if (!success || error) {
RCTLogInfo(@"Error overriding the desired session mode");
}
}
}
default: default:
// Do nothing // Do nothing.
break; break;
} }
} }
- (NSDictionary *)constantsToExport - (BOOL)setCategory:(NSString *)category
{ mode:(NSString *)mode
return @{ @"AUDIO_CALL" : [NSNumber numberWithInt: kAudioModeAudioCall], error:(NSError * _Nullable *)outError {
@"VIDEO_CALL" : [NSNumber numberWithInt: kAudioModeVideoCall], AVAudioSession *session = [AVAudioSession sharedInstance];
@"DEFAULT" : [NSNumber numberWithInt: kAudioModeDefault]
}; if (session.category != category
}; && ![session setCategory:category error:outError]) {
RCTLogError(@"Failed to (re)apply specified AVAudioSession category!");
return NO;
}
if (session.mode != mode && ![session setMode:mode error:outError]) {
RCTLogError(@"Failed to (re)apply specified AVAudioSession mode!");
return NO;
}
return YES;
}
RCT_EXPORT_METHOD(setMode:(int)mode RCT_EXPORT_METHOD(setMode:(int)mode
resolve:(RCTPromiseResolveBlock)resolve resolve:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject) { reject:(RCTPromiseRejectBlock)reject) {
NSError *error;
BOOL success;
NSString *avCategory; NSString *avCategory;
NSString *avMode; NSString *avMode;
NSError *error;
switch (mode) { switch (mode) {
case kAudioModeAudioCall: case kAudioModeAudioCall:
avCategory = AVAudioSessionCategoryPlayAndRecord; avCategory = AVAudioSessionCategoryPlayAndRecord;
avMode = AVAudioSessionModeVoiceChat; avMode = AVAudioSessionModeVoiceChat;
break; break;
case kAudioModeVideoCall:
avCategory = AVAudioSessionCategoryPlayAndRecord;
avMode = AVAudioSessionModeVideoChat;
break;
case kAudioModeDefault: case kAudioModeDefault:
avCategory = AVAudioSessionCategorySoloAmbient; avCategory = AVAudioSessionCategorySoloAmbient;
avMode = AVAudioSessionModeDefault; avMode = AVAudioSessionModeDefault;
break; break;
case kAudioModeVideoCall:
avCategory = AVAudioSessionCategoryPlayAndRecord;
avMode = AVAudioSessionModeVideoChat;
break;
default: default:
reject(@"setMode", @"Invalid mode", nil); reject(@"setMode", @"Invalid mode", nil);
return; return;
} }
// Configure AVAudioSession category if (![self setCategory:avCategory mode:avMode error:&error] || error) {
success = [_session setCategory: avCategory error: &error];
if (!success || error) {
reject(@"setMode", error.localizedDescription, error); reject(@"setMode", error.localizedDescription, error);
return; return;
} }
// Configure AVAudioSession mode // Even though the specified category and mode were successfully set, the
success = [_session setMode: avMode error: &error]; // AVAudioSession is a singleton and other parts of the application such as
if (!success || error) { // WebRTC may undo the settings. Make sure that the settings are reapplied
reject(@"setMode", error.localizedDescription, error); // upon undoes.
return; if (!_category || !_mode) {
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(routeChanged:)
name:AVAudioSessionRouteChangeNotification
object:nil];
} }
// Save the desired mode and category // Save the desired/specified category and mode so that they may be
// reapplied (upon undoes as described above).
_category = avCategory; _category = avCategory;
_mode = avMode; _mode = avMode;
// Initialize audio route changes observer if needed
if (!_initialized) {
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(routeChanged:)
name: AVAudioSessionRouteChangeNotification
object: nil];
_initialized = YES;
}
resolve(nil); resolve(nil);
} }

@ -1,4 +0,0 @@
#import "RCTBridgeModule.h"
@interface POSIX : NSObject<RCTBridgeModule>
@end

@ -1,10 +1,13 @@
#import "POSIX.h" #import "RCTBridgeModule.h"
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netdb.h> #include <netdb.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
@interface POSIX : NSObject<RCTBridgeModule>
@end
@implementation POSIX @implementation POSIX
RCT_EXPORT_MODULE(); RCT_EXPORT_MODULE();

@ -206,7 +206,6 @@
00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = "<group>"; }; 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = "<group>"; };
00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = "<group>"; }; 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = "<group>"; };
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = "<group>"; }; 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = "<group>"; };
0B42DFAC1E2FD90700111B12 /* AudioMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AudioMode.h; path = app/AudioMode.h; sourceTree = "<group>"; };
0B42DFAD1E2FD90700111B12 /* AudioMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AudioMode.m; path = app/AudioMode.m; sourceTree = "<group>"; }; 0B42DFAD1E2FD90700111B12 /* AudioMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AudioMode.m; path = app/AudioMode.m; sourceTree = "<group>"; };
0EA8C046B2BF46279796F07D /* libKCKeepAwake.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libKCKeepAwake.a; sourceTree = "<group>"; }; 0EA8C046B2BF46279796F07D /* libKCKeepAwake.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libKCKeepAwake.a; sourceTree = "<group>"; };
139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = "<group>"; }; 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = "<group>"; };
@ -226,7 +225,6 @@
821D8ABD506944B4BDBB069B /* libRNVectorIcons.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNVectorIcons.a; sourceTree = "<group>"; }; 821D8ABD506944B4BDBB069B /* libRNVectorIcons.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNVectorIcons.a; sourceTree = "<group>"; };
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; }; 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
B30EF2301DC0ED7C00690F45 /* WebRTC.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebRTC.framework; path = "../node_modules/react-native-webrtc/ios/WebRTC.framework"; sourceTree = "<group>"; }; B30EF2301DC0ED7C00690F45 /* WebRTC.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebRTC.framework; path = "../node_modules/react-native-webrtc/ios/WebRTC.framework"; sourceTree = "<group>"; };
B3A9D0231E0481E10009343D /* POSIX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = POSIX.h; path = app/POSIX.h; sourceTree = "<group>"; };
B3A9D0241E0481E10009343D /* POSIX.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = POSIX.m; path = app/POSIX.m; sourceTree = "<group>"; }; B3A9D0241E0481E10009343D /* POSIX.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = POSIX.m; path = app/POSIX.m; sourceTree = "<group>"; };
B3B083EB1D4955FF0069CEE7 /* jitsi-meet-react.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "jitsi-meet-react.entitlements"; sourceTree = "<group>"; }; B3B083EB1D4955FF0069CEE7 /* jitsi-meet-react.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "jitsi-meet-react.entitlements"; sourceTree = "<group>"; };
B96AF9B6FBC0453798399985 /* FontAwesome.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome.ttf; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf"; sourceTree = "<group>"; }; B96AF9B6FBC0453798399985 /* FontAwesome.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome.ttf; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf"; sourceTree = "<group>"; };
@ -351,14 +349,12 @@
children = ( children = (
13B07FAF1A68108700A75B9A /* AppDelegate.h */, 13B07FAF1A68108700A75B9A /* AppDelegate.h */,
13B07FB01A68108700A75B9A /* AppDelegate.m */, 13B07FB01A68108700A75B9A /* AppDelegate.m */,
0B42DFAC1E2FD90700111B12 /* AudioMode.h */,
0B42DFAD1E2FD90700111B12 /* AudioMode.m */, 0B42DFAD1E2FD90700111B12 /* AudioMode.m */,
13B07FB51A68108700A75B9A /* Images.xcassets */, 13B07FB51A68108700A75B9A /* Images.xcassets */,
13B07FB61A68108700A75B9A /* Info.plist */, 13B07FB61A68108700A75B9A /* Info.plist */,
13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 13B07FB11A68108700A75B9A /* LaunchScreen.xib */,
008F07F21AC5B25A0029DE68 /* main.jsbundle */, 008F07F21AC5B25A0029DE68 /* main.jsbundle */,
13B07FB71A68108700A75B9A /* main.m */, 13B07FB71A68108700A75B9A /* main.m */,
B3A9D0231E0481E10009343D /* POSIX.h */,
B3A9D0241E0481E10009343D /* POSIX.m */, B3A9D0241E0481E10009343D /* POSIX.m */,
); );
name = app; name = app;
@ -402,6 +398,7 @@
832341AE1AAA6A7D00B99B32 /* Libraries */ = { 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
5B09C20C78C74A548AAAC1FA /* KCKeepAwake.xcodeproj */,
BF96438F1C34FBEB00B0BBDF /* libc.tbd */, BF96438F1C34FBEB00B0BBDF /* libc.tbd */,
BF9643911C34FBF100B0BBDF /* libsqlite3.tbd */, BF9643911C34FBF100B0BBDF /* libsqlite3.tbd */,
BF9643931C34FBF900B0BBDF /* libstdc++.tbd */, BF9643931C34FBF900B0BBDF /* libstdc++.tbd */,
@ -417,7 +414,6 @@
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
146833FF1AC3E56700842450 /* React.xcodeproj */, 146833FF1AC3E56700842450 /* React.xcodeproj */,
22418656B14845609F953A42 /* RNVectorIcons.xcodeproj */, 22418656B14845609F953A42 /* RNVectorIcons.xcodeproj */,
5B09C20C78C74A548AAAC1FA /* KCKeepAwake.xcodeproj */,
); );
name = Libraries; name = Libraries;
sourceTree = "<group>"; sourceTree = "<group>";

@ -1,4 +1,4 @@
import { AudioMode } from '../base/react-native'; import { NativeModules } from 'react-native';
import { APP_WILL_MOUNT } from '../app'; import { APP_WILL_MOUNT } from '../app';
import { import {
@ -6,50 +6,51 @@ import {
CONFERENCE_LEFT, CONFERENCE_LEFT,
CONFERENCE_WILL_JOIN CONFERENCE_WILL_JOIN
} from '../base/conference'; } from '../base/conference';
import { MiddlewareRegistry } from '../base/redux'; import { MiddlewareRegistry } from '../base/redux';
/** /**
* Middleware that captures conference actions and sets the correct audio * Middleware that captures conference actions and sets the correct audio mode
* mode based on the type of conference. Audio-only conferences don't * based on the type of conference. Audio-only conferences don't use the speaker
* use the speaker by default, and video conferences do. * by default, and video conferences do.
* *
* @param {Store} store - Redux store. * @param {Store} store - Redux store.
* @returns {Function} * @returns {Function}
*/ */
MiddlewareRegistry.register(store => next => action => { MiddlewareRegistry.register(store => next => action => {
switch (action.type) { const AudioMode = NativeModules.AudioMode;
case APP_WILL_MOUNT: {
AudioMode.setMode(AudioMode.DEFAULT) // The react-native module AudioMode is implemented on iOS at the time of
.catch(err => { // this writing.
console.warn(`Error setting audio mode: ${err}`); if (AudioMode) {
}); let audioMode;
break;
} switch (action.type) {
case CONFERENCE_WILL_JOIN: { case APP_WILL_MOUNT:
let mode; case CONFERENCE_FAILED:
const state = store.getState()['features/base/conference']; case CONFERENCE_LEFT:
audioMode = AudioMode.DEFAULT;
if (state.audioOnly) { break;
// TODO(saghul): Implement audio-only mode
mode = AudioMode.AUDIO_CALL; case CONFERENCE_WILL_JOIN: {
} else { const conference = store.getState()['features/base/conference'];
mode = AudioMode.VIDEO_CALL;
audioMode
= conference.audioOnly
? AudioMode.AUDIO_CALL
: AudioMode.VIDEO_CALL;
break;
} }
AudioMode.setMode(mode) default:
.catch(err => { audioMode = null;
console.warn(`Error setting audio mode: ${err}`); break;
}); }
break;
} if (audioMode !== null) {
case CONFERENCE_FAILED: AudioMode.setMode(audioMode).catch(err => {
case CONFERENCE_LEFT: console.error(`Failed to set audio mode ${audioMode}: ${err}`);
AudioMode.setMode(AudioMode.DEFAULT)
.catch(err => {
console.warn(`Error setting audio mode: ${err}`);
}); });
break; }
} }
return next(action); return next(action);

@ -24,26 +24,26 @@ export const CONFERENCE_FAILED = Symbol('CONFERENCE_FAILED');
export const CONFERENCE_JOINED = Symbol('CONFERENCE_JOINED'); export const CONFERENCE_JOINED = Symbol('CONFERENCE_JOINED');
/** /**
* The type of the Redux action which signals that a specific conference will be * The type of the Redux action which signals that a specific conference has
* joined. * been left.
* *
* { * {
* type: CONFERENCE_WILL_JOIN, * type: CONFERENCE_LEFT,
* room: string * conference: JitsiConference
* } * }
*/ */
export const CONFERENCE_WILL_JOIN = Symbol('CONFERENCE_WILL_JOIN'); export const CONFERENCE_LEFT = Symbol('CONFERENCE_LEFT');
/** /**
* The type of the Redux action which signals that a specific conference has * The type of the Redux action which signals that a specific conference will be
* been left. * joined.
* *
* { * {
* type: CONFERENCE_LEFT, * type: CONFERENCE_WILL_JOIN,
* conference: JitsiConference * room: string
* } * }
*/ */
export const CONFERENCE_LEFT = Symbol('CONFERENCE_LEFT'); export const CONFERENCE_WILL_JOIN = Symbol('CONFERENCE_WILL_JOIN');
/** /**
* The type of the Redux action which signals that a specific conference will be * The type of the Redux action which signals that a specific conference will be

@ -125,39 +125,38 @@ function _conferenceJoined(conference) {
} }
/** /**
* Signals the intention of the application to have the local participant leave * Signals that a specific conference has been left.
* a specific conference. Similar in fashion to CONFERENCE_LEFT. Contrary to it
* though, it's not guaranteed because CONFERENCE_LEFT may be triggered by
* lib-jitsi-meet and not the application.
* *
* @param {string} room - The JitsiConference instance which will * @param {JitsiConference} conference - The JitsiConference instance which was
* be left by the local participant. * left by the local participant.
* @returns {{ * @returns {{
* type: CONFERENCE_WILL_JOIN, * type: CONFERENCE_LEFT,
* room: string * conference: JitsiConference
* }} * }}
*/ */
function _conferenceWillJoin(room) { function _conferenceLeft(conference) {
return { return {
type: CONFERENCE_WILL_JOIN, type: CONFERENCE_LEFT,
room conference
}; };
} }
/** /**
* Signals that a specific conference has been left. * Signals the intention of the application to have the local participant join a
* conference with a specific room (name). Similar in fashion
* to CONFERENCE_JOINED.
* *
* @param {JitsiConference} conference - The JitsiConference instance which was * @param {string} room - The room (name) which identifies the conference the
* left by the local participant. * local participant will (try to) join.
* @returns {{ * @returns {{
* type: CONFERENCE_LEFT, * type: CONFERENCE_WILL_JOIN,
* conference: JitsiConference * room: string
* }} * }}
*/ */
function _conferenceLeft(conference) { function _conferenceWillJoin(room) {
return { return {
type: CONFERENCE_LEFT, type: CONFERENCE_WILL_JOIN,
conference room
}; };
} }
@ -201,15 +200,14 @@ export function createConference() {
throw new Error('Cannot join conference without room name'); throw new Error('Cannot join conference without room name');
} }
// XXX Lib-jitsi-meet does not accept uppercase letters. dispatch(_conferenceWillJoin(room));
const _room = room.toLowerCase();
dispatch(_conferenceWillJoin(_room));
// TODO Take options from config. // TODO Take options from config.
const conference const conference
= connection.initJitsiConference( = connection.initJitsiConference(
_room,
// XXX Lib-jitsi-meet does not accept uppercase letters.
room.toLowerCase(),
{ openSctp: true }); { openSctp: true });
_addConferenceListeners(conference, dispatch); _addConferenceListeners(conference, dispatch);

@ -1,20 +0,0 @@
import { NativeModules } from 'react-native';
import { Platform } from '../react';
let AudioMode;
if (Platform.OS === 'ios') {
AudioMode = NativeModules.AudioMode;
} else {
// TODO(saghul): Implement for Android
AudioMode = {
DEFAULT: 0,
AUDIO_CALL: 1,
VIDEO_CALL: 2,
setMode() {
return Promise.resolve(null);
}
};
}
export default AudioMode;

@ -1,2 +1 @@
export { default as AudioMode } from './AudioMode';
export { default as POSIX } from './POSIX'; export { default as POSIX } from './POSIX';

Loading…
Cancel
Save