-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
邓博
authored and
邓博
committed
Jun 30, 2017
1 parent
8c054bf
commit 8223e17
Showing
23 changed files
with
451 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { | ||
NativeModules, | ||
findNodeHandle, | ||
NativeAppEventEmitter | ||
} from 'react-native'; | ||
|
||
const { Agora } = NativeModules | ||
|
||
export default { | ||
...Agora, | ||
init(options = {}) { | ||
this.listener && this.listener.remove(); | ||
Agora.init(options); | ||
}, | ||
joinChannel(channelName = '001'){ | ||
Agora.joinChannel(channelName) | ||
}, | ||
eventEmitter(fnConf) { | ||
//there are no `removeListener` for NativeAppEventEmitter & DeviceEventEmitter | ||
this.listener && this.listener.remove(); | ||
this.listener = NativeAppEventEmitter.addListener('agoraEvent', event => { | ||
fnConf[event['type']] && fnConf[event['type']](event); | ||
}); | ||
}, | ||
removeEmitter() { | ||
this.listener && this.listener.remove(); | ||
} | ||
}; |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+6.18 MB
(620%)
android/src/main/jniLibs/armeabi-v7a/libagora-rtc-sdk-jni.so
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,6 @@ | ||
import { | ||
NativeModules, | ||
findNodeHandle, | ||
NativeAppEventEmitter | ||
} from 'react-native'; | ||
|
||
const { Agora } = NativeModules | ||
import _AgoraView from './AgoraView' | ||
import _RTCEngine from './RTCEngine' | ||
|
||
export default { | ||
|
||
init(options = {}) { | ||
this.listener && this.listener.remove(); | ||
Agora.init(options); | ||
}, | ||
joinChannel(channelName = '001'){ | ||
Agora.joinChannel(channelName) | ||
}, | ||
eventEmitter(fnConf) { | ||
// const { | ||
// onFirstRemoteVideoDecoded = () => {}, | ||
// onJoinChannelSuccess = () => {}, | ||
// onUserJoined = () => {}, | ||
// onError = () => {}, | ||
// onWarning = () => {} | ||
// } = options; | ||
|
||
// let fnConf = {...options}; | ||
//there are no `removeListener` for NativeAppEventEmitter & DeviceEventEmitter | ||
this.listener && this.listener.remove(); | ||
this.listener = NativeAppEventEmitter.addListener('agoraEvent', event => { | ||
fnConf[event['type']] && fnConf[event['type']](event); | ||
}); | ||
}, | ||
removeEmitter() { | ||
this.listener && this.listener.remove(); | ||
} | ||
|
||
}; | ||
export const AgoraView = _AgoraView; | ||
export const RTCEngine = _RTCEngine; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// MyAgoraRtcEngineKit.h | ||
// RCTAgora | ||
// | ||
// Created by 邓博 on 2017/6/30. | ||
// Copyright © 2017年 Syan. All rights reserved. | ||
// | ||
|
||
#import <AgoraRtcEngineKit/AgoraRtcEngineKit.h> | ||
|
||
@interface AgoraConst : NSObject | ||
|
||
@property (nonatomic, copy) NSString *appid; | ||
|
||
+ (instancetype)share; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// MyAgoraRtcEngineKit.m | ||
// RCTAgora | ||
// | ||
// Created by 邓博 on 2017/6/30. | ||
// Copyright © 2017年 Syan. All rights reserved. | ||
// | ||
|
||
#import "AgoraConst.h" | ||
|
||
@implementation AgoraConst | ||
|
||
static AgoraConst *_person; | ||
+ (instancetype)allocWithZone:(struct _NSZone *)zone{ | ||
static dispatch_once_t predicate; | ||
dispatch_once(&predicate, ^{ | ||
_person = [super allocWithZone:zone]; | ||
}); | ||
return _person; | ||
} | ||
|
||
+ (instancetype)share { | ||
static dispatch_once_t onceToken; | ||
dispatch_once(&onceToken, ^{ | ||
_person = [[self alloc]init]; | ||
}); | ||
return _person; | ||
} | ||
|
||
- (id)copyWithZone:(NSZone *)zone { | ||
return _person; | ||
} | ||
|
||
|
||
|
||
@end |
Oops, something went wrong.