AlivcLivePusher_Interactive  v4.4.7
Aliyun Live Pusher Interactive SDK API Reference Manual for iOS Platforms
AlivcLivePusher Class Reference

推流类 More...

Inheritance diagram for AlivcLivePusher:

Instance Methods

(int) - addDynamicWaterMarkImageDataWithPath:x:y:w:h:
 添加动态贴纸,最多支持添加5个贴纸 waterMarkDirPath:贴纸图片sequence目录 x,y:显示屏幕位置(0~1.0f) w,h:显示屏幕长宽(0~1.0f) 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下添加动态贴纸,AlivcLivePushInteractiveMode模式下暂时不支持添加动态贴纸 More...
 
(int) - addMixAudio:format:audioSample:
 添加音频混流设置 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下添加音频混流,AlivcLivePushInteractiveMode模式下暂时不支持添加音频混流 More...
 
(int) - addMixVideo:width:height:rotation:displayX:displayY:displayW:displayH:adjustHeight:
 添加视频混流设置 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下添加视频混流设置,AlivcLivePushInteractiveMode模式下暂时不支持添加视频混流设置 More...
 
(int) - addWatermarkWithPath:watermarkCoordX:watermarkCoordY:watermarkWidth:
 添加水印 最多支持3个水印 More...
 
(void) - changeMixVideoPosition:displayX:displayY:displayW:displayH:
 改变视频混流位置 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下改变视频混流位置,AlivcLivePushInteractiveMode模式下暂时不支持改变视频混流位置 More...
 
(void) - destory
 销毁推流 More...
 
(int) - focusCameraAtAdjustedPoint:autoFocus:
 对焦 More...
 
(float) - getCurrentExposure
 获取当前曝光度 More...
 
(float) - getCurrentZoom
 获取当前变焦值 More...
 
(AlivcLivePushStatsInfo *) - getLivePushStatusInfo
 获取推流数据统计 More...
 
(AlivcLivePushStatus) - getLiveStatus
 获取当前推流状态 More...
 
(float) - getMaxZoom
 获取支持的最大变焦值 More...
 
(NSString *) - getPushURL
 获取当前推流URL More...
 
(float) - getSupportedMaxExposure
 获取支持最大曝光度 More...
 
(float) - getSupportedMinExposure
 获取支持最小曝光度 More...
 
(instancetype) - initWithConfig:
 init More...
 
(bool) - inputMixAudioData:data:size:pts:
 输入音频混流数据 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下输入音频混流数据,AlivcLivePushInteractiveMode模式下暂时不支持输入音频混流数据 More...
 
(void) - inputMixVideoData:data:width:height:stride:size:pts:rotation:
 输入视频混流数据 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下输入视频混流数据,AlivcLivePushInteractiveMode模式下暂时不支持输入视频混流数据 More...
 
(BOOL) - isPushing
 获取是否正在推流 More...
 
(int) - pause
 暂停摄像头推流,如果pushCongfig 中设置了pauseImg图片,将推设置的静态图片 More...
 
(int) - pauseBGM
 暂停播放背景音乐 More...
 
(int) - reconnectPushAsync
 重连 异步接口 More...
 
(int) - reconnectPushAsync:
 重连 异步接口 More...
 
(void) - removeDynamicWaterMark:
 删除动态贴纸 vid:贴纸id,add时返回的 More...
 
(void) - removeMixAudio:
 移除音频混流 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下移除音频混流,AlivcLivePushInteractiveMode模式下暂时不支持移除音频混流 More...
 
(void) - removeMixVideo:
 移除视频混流 More...
 
(int) - restartPush
 重新推流 同步接口 More...
 
(int) - restartPushAsync
 重新推流 异步接口 More...
 
(int) - resume
 恢复摄像头推流 同步接口 More...
 
(int) - resumeAsync
 恢复推流 异步接口 More...
 
(int) - resumeBGM
 恢复播放背景音乐 More...
 
(void) - sendAudioSampleBuffer:withType:
 发送自定义的audio SampleBuffer 只限于replaykit录屏直播使用 More...
 
(int) - sendMessage:repeatCount:delayTime:KeyFrameOnly:
 设置Message More...
 
(void) - sendPCMData:size:sampleRate:channel:pts:
 发送自定义音频数据 More...
 
(void) - sendVideoData:width:height:size:pts:rotation:
 发送自定义视频数据 More...
 
(void) - sendVideoSampleBuffer:
 发送自定义video SampleBuffer More...
 
(int) - setAudioDenoise:
 设置降噪开关 More...
 
(void) - setAudioSampleDelegate:
 设置音频裸数据回调 More...
 
(int) - setAutoFocus:
 设置自动对焦 More...
 
(void) - setBGMDelegate:
 设置背景音乐监听回调 More...
 
(int) - setBGMEarsBack:
 设置背景音乐耳返开关 More...
 
(int) - setBGMLoop:
 设置背景音乐是否循环播放 More...
 
(int) - setBGMVolume:
 设置背景音乐混音 音乐音量 More...
 
(int) - setCaptureVolume:
 设置背景音乐混音 人声音量 More...
 
(void) - setCustomDetectorDelegate:
 设置用户自定义人脸识别回调 More...
 
(void) - setCustomFilterDelegate:
 设置用户自定义滤镜回调 More...
 
(void) - setErrorDelegate:
 设置推流错误监听回调 More...
 
(int) - setExposure:
 设置曝光度 More...
 
(int) - setFlash:
 闪光灯开关 More...
 
(void) - setInfoDelegate:
 设置推流状态监听回调 More...
 
(int) - setLiveMixTranscodingConfig:
 设置云端的混流(转码)参数 一个直播间中可能有不止一位主播,而且每个主播都有自己的画面和声音,但对于 CDN 观众来说,他们只需要一路直播流 所以您需要将多路音视频流混成一路标准的直播流,这就需要混流转码 在连麦场景下,需要将主播和连麦观众音视频流混成一路标准的直播流,供CDN观众观看 在PK场景下,需要将进行PK的多个主播的音视频流混成一路标准的直播流,供CDN观众观看 More...
 
(int) - setLogLevel:
 设置Log级别 More...
 
(int) - setLogPath:maxPartFileSizeInKB:
 设置Log路径 More...
 
(int) - setMinVideoBitrate:
 设置最小码率 More...
 
(void) - setMixVideoMirror:isMirror:
 改变视频混流镜像 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下改变视频混流镜像,AlivcLivePushInteractiveMode模式下暂时不支持改变视频混流镜像 More...
 
(void) - setMute:
 静音推流 More...
 
(void) - setNetworkDelegate:
 设置推流网络监听回调 More...
 
(void) - setpreviewDisplayMode:
 设置预览显示模式 More...
 
(void) - setPreviewMirror:
 预览镜像开关 More...
 
(void) - setPushMirror:
 推流镜像开关 More...
 
(int) - setQualityMode:
 设置推流模式 More...
 
(void) - setResolution:
 设置推流分辨率,只在预览模式下生效,推流中不能设置 More...
 
(void) - setSnapshotDelegate:
 设置截图回调 More...
 
(int) - setTargetVideoBitrate:
 设置目标码率 More...
 
(void) - setWatermarkVisible:
 设置水印显示和隐藏 More...
 
(int) - setZoom:
 缩放 More...
 
(void) - snapshot:interval:
 截图,livePushMode = AlivcLivePushBasicMode 基础模式下可以指定count和interval, AlivcLivePushInteractiveMode模式下暂时不支持指定count和interval,传递任何值都不做解析,每次只截图一张画面 count:张数 interval:每张间隔(ms) More...
 
(int) - startBGMWithMusicPathAsync:
 播放背景音乐 More...
 
(int) - startPreview:
 开始预览 同步接口 More...
 
(int) - startPreviewAsync:
 开始预览 异步接口 More...
 
(int) - startPushWithURL:
 开始推流 同步接口 More...
 
(int) - startPushWithURLAsync:
 开始推流 异步接口 More...
 
(int) - startScreenCapture:
 开始屏幕分享(该接口支持 iOS 11.0 及以上的 iPhone 和 iPad)。 More...
 
(int) - stopBGMAsync
 停止播放背景音乐 More...
 
(int) - stopPreview
 停止预览 More...
 
(int) - stopPush
 停止推流 More...
 
(int) - switchCamera
 旋转摄像头 More...
 

Class Methods

("Use AlivcLiveBase->getSDKVersion instead.") + __deprecated_msg
 获取SDK版本号 More...
 
(void) + hideDebugView
 隐藏调试悬浮窗 More...
 
(void) + showDebugView
 显示调试悬浮窗 注意 :Debug悬浮窗会占用一定的系统资源,只可用于APP研发的Debug阶段,Release版本请勿调用此接口 More...
 

Detailed Description

推流类

Method Documentation

◆ __deprecated_msg

+ ("Use AlivcLiveBase->getSDKVersion instead.") __deprecated_msg

获取SDK版本号

Returns
版本号

◆ addDynamicWaterMarkImageDataWithPath:x:y:w:h:

- (int) addDynamicWaterMarkImageDataWithPath: (NSString *)  waterMarkDirPath
x: (float)  x
y: (float)  y
w: (float)  w
h: (float)  h 

添加动态贴纸,最多支持添加5个贴纸 waterMarkDirPath:贴纸图片sequence目录 x,y:显示屏幕位置(0~1.0f) w,h:显示屏幕长宽(0~1.0f) 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下添加动态贴纸,AlivcLivePushInteractiveMode模式下暂时不支持添加动态贴纸

Returns
返回动态贴纸的id号,删除贴纸传此id

◆ addMixAudio:format:audioSample:

- (int) addMixAudio: (int)  channels
format: (int)  format
audioSample: (int)  audioSample 

添加音频混流设置 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下添加音频混流,AlivcLivePushInteractiveMode模式下暂时不支持添加音频混流

◆ addMixVideo:width:height:rotation:displayX:displayY:displayW:displayH:adjustHeight:

- (int) addMixVideo: (int)  format
width: (int)  width
height: (int)  height
rotation: (int)  rotation
displayX: (float)  displayX
displayY: (float)  displayY
displayW: (float)  displayW
displayH: (float)  displayH
adjustHeight: (bool)  adjustHeight 

添加视频混流设置 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下添加视频混流设置,AlivcLivePushInteractiveMode模式下暂时不支持添加视频混流设置

◆ addWatermarkWithPath:watermarkCoordX:watermarkCoordY:watermarkWidth:

- (int) addWatermarkWithPath: (NSString *)  path
watermarkCoordX: (CGFloat)  coordX
watermarkCoordY: (CGFloat)  coordY
watermarkWidth: (CGFloat)  width 

添加水印 最多支持3个水印

Parameters
path水印路径
coordX水印左上顶点x的相对坐标 [0,1]
coordY水印左上顶点y的相对坐标 [0,1]
width水印的相对宽度 (水印会根据水印图片实际大小和水印宽度等比缩放) (0,1]
Returns
0:success 非0:failure 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下添加水印,AlivcLivePushInteractiveMode模式下暂时不支持添加水印

◆ changeMixVideoPosition:displayX:displayY:displayW:displayH:

- (void) changeMixVideoPosition: (int)  handler
displayX: (float)  displayX
displayY: (float)  displayY
displayW: (float)  displayW
displayH: (float)  displayH 

改变视频混流位置 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下改变视频混流位置,AlivcLivePushInteractiveMode模式下暂时不支持改变视频混流位置

◆ destory

- (void) destory

销毁推流

◆ focusCameraAtAdjustedPoint:autoFocus:

- (int) focusCameraAtAdjustedPoint: (CGPoint)  point
autoFocus: (bool)  autoFocus 

对焦

Parameters
point对焦的点
autoFocus是否自动对焦
Returns
0:success 非0:failure

◆ getCurrentExposure

- (float) getCurrentExposure

获取当前曝光度

Returns
曝光度

◆ getCurrentZoom

- (float) getCurrentZoom

获取当前变焦值

Returns
当前变焦值

◆ getLivePushStatusInfo

- (AlivcLivePushStatsInfo *) getLivePushStatusInfo

获取推流数据统计

Returns
推流数据

◆ getLiveStatus

- (AlivcLivePushStatus) getLiveStatus

获取当前推流状态

Returns
推流状态

◆ getMaxZoom

- (float) getMaxZoom

获取支持的最大变焦值

Returns
最大变焦值

◆ getPushURL

- (NSString *) getPushURL

获取当前推流URL

Returns
推流URL

◆ getSupportedMaxExposure

- (float) getSupportedMaxExposure

获取支持最大曝光度

Returns
最大曝光度

◆ getSupportedMinExposure

- (float) getSupportedMinExposure

获取支持最小曝光度

Returns
最小曝光度

◆ hideDebugView

+ (void) hideDebugView

隐藏调试悬浮窗

◆ initWithConfig:

- (instancetype) initWithConfig: (AlivcLivePushConfig *)  config

init

Parameters
config推流配置
Returns
self:success nil:failure

◆ inputMixAudioData:data:size:pts:

- (bool) inputMixAudioData: (int)  handler
data: (long)  dataptr
size: (int)  size
pts: (long)  pts 

输入音频混流数据 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下输入音频混流数据,AlivcLivePushInteractiveMode模式下暂时不支持输入音频混流数据

◆ inputMixVideoData:data:width:height:stride:size:pts:rotation:

- (void) inputMixVideoData: (int)  handler
data: (long)  dataptr
width: (int)  width
height: (int)  height
stride: (int)  stride
size: (int)  size
pts: (long)  pts
rotation: (int)  rotation 

输入视频混流数据 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下输入视频混流数据,AlivcLivePushInteractiveMode模式下暂时不支持输入视频混流数据

◆ isPushing

- (BOOL) isPushing

获取是否正在推流

Returns
YES:正在推流 NO:未推流

◆ pause

- (int) pause

暂停摄像头推流,如果pushCongfig 中设置了pauseImg图片,将推设置的静态图片

Returns
0:success 非0:failure

◆ pauseBGM

- (int) pauseBGM

暂停播放背景音乐

Returns
0:success 非0:failure

◆ reconnectPushAsync

- (int) reconnectPushAsync

重连 异步接口

Returns
0:success 非0:failure

◆ reconnectPushAsync:

- (int) reconnectPushAsync: (NSString *)  pushURL

重连 异步接口

Returns
0:success 非0:failure

◆ removeDynamicWaterMark:

- (void) removeDynamicWaterMark: (int)  vid

删除动态贴纸 vid:贴纸id,add时返回的

◆ removeMixAudio:

- (void) removeMixAudio: (int)  handler

移除音频混流 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下移除音频混流,AlivcLivePushInteractiveMode模式下暂时不支持移除音频混流

◆ removeMixVideo:

- (void) removeMixVideo: (int)  handler

移除视频混流

◆ restartPush

- (int) restartPush

重新推流 同步接口

Returns
0:success 非0:failure

◆ restartPushAsync

- (int) restartPushAsync

重新推流 异步接口

Returns
0:success 非0:failure

◆ resume

- (int) resume

恢复摄像头推流 同步接口

Returns
0:success 非0:failure

◆ resumeAsync

- (int) resumeAsync

恢复推流 异步接口

Returns
0:success 非0:failure

◆ resumeBGM

- (int) resumeBGM

恢复播放背景音乐

Returns
0:success 非0:failure

◆ sendAudioSampleBuffer:withType:

- (void) sendAudioSampleBuffer: (CMSampleBufferRef)  sampleBuffer
withType: (RPSampleBufferType)  sampleBufferType 

发送自定义的audio SampleBuffer 只限于replaykit录屏直播使用

Parameters
sampleBufferaudio sample buffer
sampleBufferTypeaudio sample buffer type 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下发送自定义的audio SampleBuffer,AlivcLivePushInteractiveMode模式下暂时不支持发送自定义的audio SampleBuffer

◆ sendMessage:repeatCount:delayTime:KeyFrameOnly:

- (int) sendMessage: (NSString *)  msg
repeatCount: (int)  count
delayTime: (int)  time
KeyFrameOnly: (bool)  isKeyFrame 

设置Message

Parameters
msg用户推流消息
count重复次数
time延时时间,单位毫秒
isKeyFrame是否只发关键帧
Returns
0:success 非0:failure 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下设置Message,AlivcLivePushInteractiveMode模式下暂时不支持设置Message

◆ sendPCMData:size:sampleRate:channel:pts:

- (void) sendPCMData: (char *)  data
size: (int)  size
sampleRate: (int)  sampleRate
channel: (int)  channel
pts: (uint64_t)  pts 

发送自定义音频数据

Parameters
data音频数据
size数据大小
sampleRate采样率
channel声道数
pts时间戳(单位微秒) 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下发送自定义音频数据,AlivcLivePushInteractiveMode模式下暂时不支持发送自定义音频数据

◆ sendVideoData:width:height:size:pts:rotation:

- (void) sendVideoData: (char *)  data
width: (int)  width
height: (int)  height
size: (int)  size
pts: (uint64_t)  pts
rotation: (int)  rotation 

发送自定义视频数据

Parameters
data视频数据
width视频宽度
height视频高度
size数据大小
pts时间戳(单位微秒)
rotation旋转 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下发送自定义视频数据,AlivcLivePushInteractiveMode模式下暂时不支持发送自定义视频数据

◆ sendVideoSampleBuffer:

- (void) sendVideoSampleBuffer: (CMSampleBufferRef)  sampleBuffer

发送自定义video SampleBuffer

Parameters
sampleBuffervideo sample buffer 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下发送自定义video SampleBuffer,AlivcLivePushInteractiveMode模式下暂时不支持发送自定义video SampleBuffer

◆ setAudioDenoise:

- (int) setAudioDenoise: (bool)  isOpen

设置降噪开关

Parameters
isOpen是否打开降噪 true:开启 false:关闭 默认:true
Returns
0:success 非0:failure

◆ setAudioSampleDelegate:

- (void) setAudioSampleDelegate: (id< AlivcLivePusherAudioSampleDelegate >)  delegate

设置音频裸数据回调

Parameters
delegateAlivcLivePusherAudioSampleDelegate

◆ setAutoFocus:

- (int) setAutoFocus: (bool)  autoFocus

设置自动对焦

Parameters
autoFocustrue:自动对焦 false:手动对焦
Returns
0:success 非0:failure

◆ setBGMDelegate:

- (void) setBGMDelegate: (id< AlivcLivePusherBGMDelegate >)  delegate

设置背景音乐监听回调

Parameters
delegateAlivcLivePusherBGMDelegate

◆ setBGMEarsBack:

- (int) setBGMEarsBack: (bool)  isOpen

设置背景音乐耳返开关

Parameters
isOpen是否打开耳返 true:开启耳返 false:关闭耳返
Returns
0:success 非0:failure

◆ setBGMLoop:

- (int) setBGMLoop: (bool)  isLoop

设置背景音乐是否循环播放

Parameters
isLoop是否循环 true:循环 false:不循环
Returns
0:success 非0:failure

◆ setBGMVolume:

- (int) setBGMVolume: (int)  volume

设置背景音乐混音 音乐音量

Parameters
volume音乐音量大小 范围:[0 ~ 100] 默认:50
Returns
0:success 非0:failure

◆ setCaptureVolume:

- (int) setCaptureVolume: (int)  volume

设置背景音乐混音 人声音量

Parameters
volume人声音量大小 范围:[0 ~ 100] 默认:50
Returns
0:success 非0:failure

◆ setCustomDetectorDelegate:

- (void) setCustomDetectorDelegate: (id< AlivcLivePusherCustomDetectorDelegate >)  delegate

设置用户自定义人脸识别回调

Parameters
delegateAlivcLivePusherCustomDetectorDelegate

◆ setCustomFilterDelegate:

- (void) setCustomFilterDelegate: (id< AlivcLivePusherCustomFilterDelegate >)  delegate

设置用户自定义滤镜回调

Parameters
delegateAlivcLivePusherCustomFilterDelegate

◆ setErrorDelegate:

- (void) setErrorDelegate: (id< AlivcLivePusherErrorDelegate >)  delegate

设置推流错误监听回调

Parameters
delegateAlivcLivePusherErrorDelegate

◆ setExposure:

- (int) setExposure: (float)  exposure

设置曝光度

Parameters
exposure曝光度
Returns
0:success 非0:failure

◆ setFlash:

- (int) setFlash: (bool)  flash

闪光灯开关

Parameters
flashtrue:打开闪光灯 false:关闭闪光灯
Returns
0:success 非0:failure

◆ setInfoDelegate:

- (void) setInfoDelegate: (id< AlivcLivePusherInfoDelegate >)  delegate

设置推流状态监听回调

Parameters
delegateAlivcLivePusherInfoDelegate

◆ setLiveMixTranscodingConfig:

- (int) setLiveMixTranscodingConfig: (AlivcLiveTranscodingConfig *)  config

设置云端的混流(转码)参数 一个直播间中可能有不止一位主播,而且每个主播都有自己的画面和声音,但对于 CDN 观众来说,他们只需要一路直播流 所以您需要将多路音视频流混成一路标准的直播流,这就需要混流转码 在连麦场景下,需要将主播和连麦观众音视频流混成一路标准的直播流,供CDN观众观看 在PK场景下,需要将进行PK的多个主播的音视频流混成一路标准的直播流,供CDN观众观看

Parameters
config参考AlivcLiveDef.h中关于AlivcLiveTranscodingConfig的介绍,如果传入nil,则取消云端混流转码
Note
若主播还在房间中但不再需要混流,请务必传入 nil 进行取消,因为当发起混流后,云端混流模块就会开始工作, 不及时取消混流可能会引起不必要的计费损失

◆ setLogLevel:

- (int) setLogLevel: ("Use AlivcLiveBase->setLogLevel instead.")  __deprecated_msg

设置Log级别

Parameters
levelLog级别 default:AlivcLivePushLogLevelError
Returns
0:success 非0:failure

◆ setLogPath:maxPartFileSizeInKB:

- (int) setLogPath: (NSString *)  logPath
maxPartFileSizeInKB: ("Use AlivcLiveBase->setLogPath:maxPartFileSizeInKB instead.")  __deprecated_msg 

设置Log路径

Parameters
logPathLog路径
maxPartFileSizeInKB每个分片最大大小。最终日志总体积是 5*最大分片大小
Returns
0:success 非0:failure

◆ setMinVideoBitrate:

- (int) setMinVideoBitrate: (int)  minBitrate

设置最小码率

Parameters
minBitrate最小码率 [100 5000](Kbps)
Returns
0:success 非0:failure

◆ setMixVideoMirror:isMirror:

- (void) setMixVideoMirror: (int)  handler
isMirror: (BOOL)  isMirror 

改变视频混流镜像 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下改变视频混流镜像,AlivcLivePushInteractiveMode模式下暂时不支持改变视频混流镜像

◆ setMute:

- (void) setMute: (bool)  mute

静音推流

Parameters
mutetrue:静音推流 false:正常推流

◆ setNetworkDelegate:

- (void) setNetworkDelegate: (id< AlivcLivePusherNetworkDelegate >)  delegate

设置推流网络监听回调

Parameters
delegateAlivcLivePusherNetworkDelegate

◆ setpreviewDisplayMode:

- (void) setpreviewDisplayMode: (AlivcPusherPreviewDisplayMode)  displayMode

设置预览显示模式

Parameters
displayMode预览显示模式

◆ setPreviewMirror:

- (void) setPreviewMirror: (bool)  mirror

预览镜像开关

Parameters
mirrortrue:打开预览镜像 false:关闭预览镜像

◆ setPushMirror:

- (void) setPushMirror: (bool)  mirror

推流镜像开关

Parameters
mirrortrue:打开推流镜像 false:关闭推流镜像

◆ setQualityMode:

- (int) setQualityMode: (AlivcLivePushQualityMode)  qualityMode

设置推流模式

Parameters
qualityMode推流模式 : 选择 ResolutionFirst 模式时,SDK内部会优先保障推流视频的清晰度; 选择 FluencyFirst 模式时,SDK内部会优先保障推流视频的流畅度,此接口只支持这两种模式。设置后码率设置失效。
Returns
0:success 非0:failure

◆ setResolution:

- (void) setResolution: (AlivcLivePushResolution)  resolution

设置推流分辨率,只在预览模式下生效,推流中不能设置

Parameters
resolution推流分辨率

◆ setSnapshotDelegate:

- (void) setSnapshotDelegate: (id< AlivcLivePusherSnapshotDelegate >)  delegate

设置截图回调

◆ setTargetVideoBitrate:

- (int) setTargetVideoBitrate: (int)  targetBitrate

设置目标码率

Parameters
targetBitrate目标码率 [100 5000](Kbps)
Returns
0:success 非0:failure

◆ setWatermarkVisible:

- (void) setWatermarkVisible: (bool)  visable

设置水印显示和隐藏

Parameters
visabletrue:显示水印,false:隐藏水印

◆ setZoom:

- (int) setZoom: (float)  zoom

缩放

Parameters
zoom缩放值[0:MaxZoom]
Returns
0:success 非0:failure

◆ showDebugView

+ (void) showDebugView

显示调试悬浮窗 注意 :Debug悬浮窗会占用一定的系统资源,只可用于APP研发的Debug阶段,Release版本请勿调用此接口

◆ snapshot:interval:

- (void) snapshot: (int)  count
interval: (int)  interval 

截图,livePushMode = AlivcLivePushBasicMode 基础模式下可以指定count和interval, AlivcLivePushInteractiveMode模式下暂时不支持指定count和interval,传递任何值都不做解析,每次只截图一张画面 count:张数 interval:每张间隔(ms)

◆ startBGMWithMusicPathAsync:

- (int) startBGMWithMusicPathAsync: (NSString *)  path

播放背景音乐

Parameters
path背景音乐路径
Returns
0:success 非0:failure

◆ startPreview:

- (int) startPreview: (UIView *)  previewView

开始预览 同步接口

Parameters
previewView预览view
Returns
0:success 非0:failure

◆ startPreviewAsync:

- (int) startPreviewAsync: (UIView *)  preview

开始预览 异步接口

Parameters
preview预览view
Returns
0:success 非0:failure

◆ startPushWithURL:

- (int) startPushWithURL: (NSString *)  pushURL

开始推流 同步接口

Parameters
pushURL推流URL
Returns
0:success 非0:failure

◆ startPushWithURLAsync:

- (int) startPushWithURLAsync: (NSString *)  pushURL

开始推流 异步接口

Parameters
pushURL推流URL
Returns
0:success 非0:failure

◆ startScreenCapture:

- (int) startScreenCapture: (NSString *)  appGroup

开始屏幕分享(该接口支持 iOS 11.0 及以上的 iPhone 和 iPad)。

Note
该接口开始 iOS 系统的屏幕分享,可以实现录屏推流功能 该接口配合AlivcLibReplayKitExt.framework使用,在Extension进程中添加AlivcLibReplayKitExt.framework库完成屏幕采集和发送 在Host APP中接收音视频数据,完成推流。
Parameters
appGroupApp group ID 主 App 与 Extension 共享的 Application Group Identifier,当前接口仅支持主 App 与 Extension 属于同一个App Group的情况,如果不存在App Group, 不可调用该接口。 注:当前SDK暂时只支持在livePushMode = AlivcLivePushBasicMode 模式下开始屏幕分享(录屏推流),AlivcLivePushInteractiveMode模式下暂时不支持开始屏幕分享(录屏推流)

◆ stopBGMAsync

- (int) stopBGMAsync

停止播放背景音乐

Returns
0:success 非0:failure

◆ stopPreview

- (int) stopPreview

停止预览

Returns
0:success 非0:failure

◆ stopPush

- (int) stopPush

停止推流

Returns
0:success 非0:failure

◆ switchCamera

- (int) switchCamera

旋转摄像头

Returns
0:success 非0:failure

The documentation for this class was generated from the following file: