JRTCSDK-iOS
v1.0.9
API文档
|
设备模块 更多...
类方法 | |
(JCMediaDevice *__nullable) | + create:callback: |
创建 JCMediaDevice 对象 更多... | |
属性 | |
id< AudioInputCallback > | audioInputCallback |
id< AudioOutputCallback > | audioOutputCallback |
bool | isAudioInputStart |
bool | isAudioOutputStart |
bool | cameraOpen |
bool | videoFileOpen |
JCMediaDeviceCamera * | currentCamera |
NSArray< JCMediaDeviceCamera * > * | cameras |
JCMediaDeviceCamera * | defaultCamera |
JCMediaDeviceAudioParam * | audioParam |
NSString * | videoFileId |
bool | audioInterrupt |
JCMediaDeviceVideoAngle | videoAngle |
bool | aec |
bool | useInternalAudioDeviceLogic |
NSArray< JCMediaDeviceAudio * > * | audioInputs |
JCMediaDeviceAudio * | audioInput |
NSArray< JCMediaDeviceAudio * > * | audioOutputs |
JCMediaDeviceAudio * | audioOutput |
NSArray< JCMediaDeviceWindow * > * | desktops |
NSArray< JCMediaDeviceWindow * > * | windows |
JCMediaDeviceWindow * | screenshareWindow |
bool | defaultSpeakerOn |
设备模块
+ (JCMediaDevice* __nullable) create: | (JCClient *__nonnull) | client | |
callback: | (id< JCMediaDeviceCallback > __nonnull) | callback | |
创建 JCMediaDevice 对象
client | JCClient 对象 |
callback | JCMediaDeviceCallback 回调接口,用于接收 JCMediaDevice 相关通知 |
- (bool) enableScreenCapture: | (bool) | enable |
开启/关闭屏幕共享
enable | 开启或关闭屏幕共享
|
- (void) enableSpeaker: | (bool) | enable |
开启关闭扬声器
enable | 是否开启 |
- (NSString* __nullable) getAudioOutputType |
获得当前音频输出类型,如扬声器、听筒、耳机、蓝牙等
- (int) getScreenFramerate |
获得当前屏幕共享帧率
- (bool) isSpeakerOn |
获取扬声器状态
- (bool) ringPlay: | (NSString *__nonnull) | path |
播放铃声
- (void) ringStop |
停止铃声
- (void) setAudioInputCallback: | (id< AudioInputCallback > _Nullable) | callback |
设置音频输入帧回调
- (void) setAudioOutputCallback: | (id< AudioOutputCallback > _Nullable) | callback |
设置音频输出帧回调
- (void) setCameraProperty: | (int) | width | |
height: | (int) | height | |
framerate: | (int) | framerate | |
@breif 设置摄像头采集属性
width | 采集宽度,默认640 |
height | 采集高度,默认360 |
framerate | 帧速率,默认30 |
- (void) setScreenCaptureProperty: | (int) | width | |
height: | (int) | height | |
framerate: | (int) | framerate | |
@breif 设置屏幕共享采集属性
width | 采集宽度,默认640 |
height | 采集高度,默认360 |
framerate | 帧速率,默认16 |
- (void) setVideoAngle: | (JCMediaDeviceVideoAngle) | angle |
@breif 设置视频窗体角度
angle | 参看 JCMediaDeviceVideoAngle |
- (void) setVideoFileFrame: | (CVPixelBufferRef __nonnull) | srcFrame | |
angle: | (int) | angle | |
mirror: | (int) | mirror | |
向文件视频源逐帧添加视频数据
CVPixelBufferRef | 视频数据 |
angle | 角度, 为 90 的倍数 |
mirror | 是否镜像,0 不镜像,1 镜像 |
- (bool) setVideoFileFrame: | (NSData *__nonnull) | srcFrame | |
format: | (JCMediaDeviceVideoPixelFormat) | format | |
width: | (int) | width | |
height: | (int) | height | |
angle: | (int) | angle | |
向文件视频源逐帧添加视频数据
srcFrame | 画面二进制数据 |
format | 视频像素格式 |
width | 宽 |
height | 高 |
angle | 角度, 为 90 的倍数 |
- (bool) snapshotWithRenderId: | (NSString *__nonnull) | renderId | |
path: | (NSString *__nonnull) | path | |
截图
renderId | 要截图的视频id |
path | 要存放截图的文件路径 |
- (void) specifyCamera: | (JCMediaDeviceCamera *__nonnull) | camera |
@breif 指定要开启的摄像头,在 startCamera 之前调用
camera | 摄像头 |
- (void) specifyCameraAngle: | (int) | angle |
@breif 指定摄像头采集角度,为90的倍数
angle | 角度 |
- (bool) startAudio |
启动音频,一般正式开启通话前需要调用此接口
- (bool) startAudioInput |
打开音频输入设备
- (bool) startAudioOutput |
打开音频输出设备
- (bool) startAudioRecord: | (NSString *_Nullable) | filePath | |
fileType: | (JCAudioCaptureRecordFileType) | fileType | |
开始音频录制
filePath | 存储路径 |
fileType | 文件类型 |
- (bool) startCamera |
- (JCMediaDeviceVideoCanvas* __nullable) startCameraVideo: | (JCMediaDeviceRender) | type |
- (JCMediaDeviceVideoCanvas* __nullable) startCameraVideo: | (JCMediaDeviceRender) | type | |
view: | (UIView *__nonnull) | view | |
- (bool) startScreenShareVideoFile |
开启屏幕共享作为视频输入源
- (JCMediaDeviceVideoCanvas* __nullable) startVideo: | (NSString *__nonnull) | videoSource | |
renderType: | (JCMediaDeviceRender) | type | |
获得预览视频对象,通过此对象能获得视图用于UI显示
videoSource | 渲染标识串,比如 JCMediaChannelParticipant JCCallItem 中的 renderId |
type | 渲染模式,JCMediaDeviceRender |
- (JCMediaDeviceVideoCanvas* __nullable) startVideo: | (NSString *__nonnull) | videoSource | |
renderType: | (JCMediaDeviceRender) | type | |
view: | (UIView *__nonnull) | view | |
获得预览视频对象,通过此对象能获得视图用于UI显示
videoSource | 渲染标识串,比如 JCMediaChannelParticipant JCCallItem 中的 renderId,当videoSource 为 videoFileId 时,内部会调用 startVideoFile |
type | 渲染模式,JCMediaDeviceRender |
view | 视图view |
- (bool) startVideoCaptureRecord: | (NSString *_Nonnull) | filePath | |
captureId: | (NSString *_Nonnull) | captureId | |
fileType: | (JCVideoCaptureRecordFileType) | fileType | |
width: | (int) | width | |
height: | (int) | height | |
开始视频录制
filePath | 存储路径 |
captureId | 捕获ID |
fileType | 文件类型 |
width | 宽 |
height | 高 |
- (bool) startVideoFile |
开启视频文件作为视频输入源,文件和摄像头作为视频输入源只能存在一种,当前摄像头开启的话会关闭摄像头
- (bool) stopAudio |
停止音频,一般在通话结束时调用
- (bool) stopAudioInput |
关闭音频输入设备
- (bool) stopAudioOutput |
关闭音频输出设备
- (bool) stopAudioRecord |
停止音频录制
- (bool) stopCamera |
@breif 关闭摄像头
- (void) stopVideo: | (JCMediaDeviceVideoCanvas *__nonnull) | canvas |
停止视频
canvas | JCMediaDeviceVideoCanvas 对象,由 startVideo 获得 |
- (bool) stopVideoCaptureRecord: | (NSString *_Nonnull) | captureId |
停止视频录制
captureId | 捕获ID |
- (bool) stopVideoFile |
关闭文件视频源
- (bool) switchCamera |
@breif 切换摄像头,内部会根据当前摄像头类型来进行切换
- (bool) switchCamera: | (JCMediaDeviceCamera *__nonnull) | camera |
切换指定摄像头
camera | 摄像头 |
|
readwritenonatomicassign |
回声消除,默认开启
|
readwritenonatomicstrong |
当前音频输入设备,mac 使用
|
readnonatomicassign |
音频输入设备列表,mac 使用
|
readnonatomicassign |
是否声音被中断
|
readwritenonatomicstrong |
当前音频输出设备,mac 使用
|
readnonatomicassign |
音频输出设备列表,mac 使用
|
readwritenonatomicstrong |
音频参数
|
readnonatomicassign |
摄像头是否打开
|
readnonatomicassign |
摄像头列表
|
readnonatomicassign |
当前摄像头
|
readwritenonatomicassign |
默认摄像头
|
readwritenonatomicassign |
没有插入耳机或外接蓝牙时是否默认开启扬声器
|
readnonatomicassign |
桌面列表,mac 使用
|
readnonatomicassign |
音频输入设备是否打开
|
readnonatomicassign |
音频输出设备是否打开
|
readwritenonatomicstrong |
屏幕分享的窗口,mac 使用
|
readwritenonatomicassign |
是否使用内部音频设备逻辑
1.打开扬声器 -> 使用扬声器输出声音 2.连上蓝牙耳机 -> 使用蓝牙耳机输出声音,如果扬声器开着则关闭扬声器 3.插入耳机 -> 使用耳机输出声音,如果扬声器开着则关闭扬声器 4.蓝牙耳机和有线耳机以最后连上的作为输出 5.关闭扬声器 -> (蓝牙耳机|有线耳机) > 听筒
|
readwritenonatomicassign |
视频角度
|
readnonatomicstrong |
视频文件作为本地视频源的渲染标识
|
readnonatomicassign |
文件播放是否打开
|
readnonatomicassign |
窗口列表,mac 使用