|
|
6 年 前 | |
|---|---|---|
| android | 6 年 前 | |
| docs | 6 年 前 | |
| ios | 6 年 前 | |
| samples | 6 年 前 | |
| src | 6 年 前 | |
| .gitattributes | 6 年 前 | |
| .gitignore | 6 年 前 | |
| .npmignore | 6 年 前 | |
| LICENSE | 7 年 前 | |
| README.md | 6 年 前 | |
| package.json | 6 年 前 | |
| react-native-agora.podspec | 6 年 前 | |
| tsconfig.json | 6 年 前 | |
| yarn.lock | 6 年 前 |
Install with npm:
npm install --save react-native-agora
Or, install with yarn:
yarn add react-native-agora
Either way, then link with:
react-native link react-native-agora
| Property | Type | Description |
|---|---|---|
| init | object {appid: ‘agora注册的应用id’, channelProfile: ‘频道模式’, videoProfile: ‘视频模式’, clientRole: ‘角色’, swapWidthAndHeight: ‘bool值’} | 初始化Agora引擎 |
| joinChannel | string channelName (房间名称) number uid (用户设置的uid 传0系统会自动分配) | 加入房间 |
| leaveChannel | 离开频道 | |
| destroy | 销毁引擎实例 | |
| configPublisher | object{} config参数请前往Agora文档查看 | 配置旁路直播推流方法 |
| setLocalRenderMode | number mode (1 2 3) | 设置本地视频显示模式 |
| setRemoteRenderMode | number uid number mode (1 2 3) | 设置远端视频显示模式 |
| enableAudioVolumeIndication | number interval (时间间隔) number smooth(平滑系数。可以设置为 3) | 启用说话者音量提示 |
| startPreview | 开启视频预览 | |
| stopPreview | 关闭视频预览 | |
| switchCamera | 切换前置/后置摄像头 | |
| enableVideo | 开启视频模式 | |
| disableVideo | 关闭视频 | |
| setCameraAutoFocusFaceModeEnabled | 是否开启人脸对焦功能 | |
| setDefaultAudioRouteToSpeakerphone | 修改默认的语音路由 | |
| setCameraTorchOn | 是否打开闪光灯 | |
| setEnableSpeakerphone | bool | 开启扬声器 trun: 音频输出至扬声器 false: 音频输出至听筒 |
| muteLocalAudioStream | bool (default false) | 将自己静音 |
| muteAllRemoteAudioStreams | bool (default false) | 静音所有远端 音频 |
| muteRemoteAudioStream | number uid(用户uid) bool mute(是否静音) | 静音指定用户 音频 |
| muteLocalVideoStream | bool (default false) | 暂停发送本地 视频流 |
| enableLocalVideo | bool (default false) | 禁用本地视频功能 |
| muteAllRemoteVideoStreams | bool (default false) | 暂停所有远端视频流 |
| muteRemoteVideoStream | number uid(用户uid) bool mute(是否暂停) | 暂停指定远端视频流 |
| startRecordingService (iOS only) | string recordingKey | 启动服务端录制服务 |
| stopRecordingService (iOS only) | string recordingKey | 停止服务端录制服务 |
| getSdkVersion | callback | 获取版本号 |
| createDataStream | (boolean reliable, boolean ordered, (streamId) => {}), 其中 reliable, ordered 请参考官方文档同名方法说明 | 创建数据流通道 |
| sendStreamMessage | (number streamId, string message, (errorCode) => {}) | 发送数据 |
RtcEngine.eventEmitter({
onFirstRemoteVideoDecoded: data => {},
onJoinChannelSuccess: data => {},
onUserOffline: data => {},
onUserJoined: data => {},
onError: data => {},
onWarning: data => {},
onLeaveChannel: data => {},
onAudioVolumeIndication: data => {},
onStreamMessage: ({uid, streamId, data}) => {},
onStreamMessageError: ({uid, streamId, error, missed, cached}) => {},
})
| Name | Description |
|---|---|
| onFirstRemoteVideoDecoded | 远端首帧视频接收解码回调 |
| onJoinChannelSuccess | 加入频道成功的回调 |
| onUserOffline | 其他用户离开当前频道 |
| onUserJoined | 其他用户加入当前频道 |
| onError | 错误信息 |
| onWarning | 警告 |
| onLeaveChannel | 退出频道 |
| onAudioVolumeIndication | 音量提示回调 |
| onStreamMessage | 接收到对方数据流消息的回调 |
| onStreamMessageError | 接收到对方数据流消息错误的回调 |
| Name | Description |
|---|---|
| showLocalVideo | 是否显示本地视频(bool) |
| remoteUid | 显示远程视频(number 传入uid) |
| zOrderMediaOverlay (Android only) | 多视频界面覆盖 设置为true优先在上层(bool) |
更新Agora SDK 为 2.0.2
新增方法 是否开启人脸对焦功能 setCameraAutoFocusFaceModeEnabled
新增方法 修改默认的语音路由 setDefaultAudioRouteToSpeakerphone
新增方法 是否打开闪光灯 setCameraTorchOn
修复 Android 说话者音量提示bug
更新 Agora SDK 为 1.12
init 不再默认开启视频预览 根据自己需求和时机调用startPreview
init options 新增参数 是否交换宽和高 swapWidthAndHeight 默认false
新增方法 配置旁路直播推流方法 configPublisher
新增方法 设置本地视频显示模式 setLocalRenderMode
新增方法 设置远端视频显示模式 setRemoteRenderMode
新增方法 启用说话者音量提示 enableAudioVolumeIndication
新增音量提示回调 onAudioVolumeIndication
Android AgoraView 新增zOrderMediaOverlay属性 解决多视频界面覆盖 设置为true优先在上层