推流接口类 更多...
Public 成员函数 | |
| void | init (Context context, AlivcLivePushConfig config) throws IllegalArgumentException, IllegalStateException |
| void | destroy () throws IllegalStateException |
| void | setLivePusherReference (AlivcLivePusher livePusher) |
| void | startPreview (SurfaceView surfaceView) throws IllegalArgumentException, IllegalStateException |
| void | startPreviewAsync (SurfaceView surfaceView) throws IllegalArgumentException, IllegalStateException |
| void | startPreview (Context context, FrameLayout frameLayout, boolean isAnchor) throws IllegalArgumentException, IllegalStateException |
| void | stopPreview () throws IllegalStateException |
| void | startPush (String url) throws IllegalArgumentException, IllegalStateException |
| void | startPushAsync (String url) throws IllegalArgumentException, IllegalStateException |
| void | restartPush () throws IllegalStateException |
| void | restartPushAsync () throws IllegalStateException |
| void | reconnectPushAsync (String url) throws IllegalStateException |
| void | stopPush () throws IllegalStateException |
| void | pause () throws IllegalStateException |
| void | resume () throws IllegalStateException |
| void | resumeAsync () throws IllegalStateException |
| void | switchCamera () throws IllegalStateException |
| void | setAutoFocus (boolean autoFocus) throws IllegalStateException |
| void | focusCameraAtAdjustedPoint (float x, float y, boolean autoFocus) throws IllegalArgumentException, IllegalStateException |
| void | setZoom (int zoom) throws IllegalArgumentException, IllegalStateException |
| int | getMaxZoom () throws IllegalStateException |
| int | getCurrentZoom () throws IllegalStateException |
| void | setMute (boolean mute) throws IllegalStateException |
| void | setFlash (boolean flash) throws IllegalStateException |
| void | setPushMirror (boolean mirror) throws IllegalStateException |
| void | setPreviewMirror (boolean mirror) throws IllegalStateException |
| void | setTargetVideoBitrate (int targetVideoBitrate) throws IllegalArgumentException, IllegalStateException |
| void | setMinVideoBitrate (int minVideoBitrate) throws IllegalArgumentException, IllegalStateException |
| void | refreshPushURLToken (String url) |
| boolean | isCameraSupportAutoFocus () |
| boolean | isCameraSupportFlash () |
| boolean | isPushing () throws IllegalStateException |
| boolean | isNetworkPushing () throws IllegalStateException |
| void | setCustomDetect (AlivcLivePushCustomDetect customVideoDetect) |
| void | setCustomFilter (AlivcLivePushCustomFilter customVideoFilter) |
| void | setCustomAudioFilter (AlivcLivePushCustomAudioFilter customAudioFilter) |
| AlivcLivePushStats | getCurrentStatus () |
| void | setLivePushErrorListener (AlivcLivePushErrorListener errorListener) |
| void | setLivePushInfoListener (AlivcLivePushInfoListener infoListener) |
| void | setLivePushNetworkListener (AlivcLivePushNetworkListener networkListener) |
| void | setLivePushBGMListener (AlivcLivePushBGMListener pushBGMListener) |
| void | setLivePushRenderContextListener (AlivcLivePusherRenderContextListener renderCtxListener) |
| AlivcLivePushStatsInfo | getLivePushStatsInfo () throws IllegalStateException |
| String | getPushUrl () |
| void | setPreviewOrientation (AlivcPreviewOrientationEnum orientation) |
| int | setAudioEffectVoiceChangeMode (AlivcLivePushAudioEffectVoiceChangeMode mode) |
| int | setAudioEffectReverbMode (AlivcLivePushAudioEffectReverbMode mode) |
| void | startBGMAsync (String path) throws IllegalStateException |
| void | stopBGMAsync () throws IllegalStateException |
| void | pauseBGM () throws IllegalStateException |
| void | resumeBGM () throws IllegalStateException |
| void | setBGMLoop (boolean isLoop) throws IllegalStateException |
| void | setBGMEarsBack (boolean isOpen) throws IllegalStateException |
| void | setBGMVolume (int volume) throws IllegalStateException, IllegalArgumentException |
| void | setCaptureVolume (int volume) throws IllegalStateException, IllegalArgumentException |
| void | setAudioDenoise (boolean on) |
| int | startIntelligentDenoise () |
| int | stopIntelligentDenoise () |
| void | setQualityMode (AlivcQualityModeEnum mode) throws IllegalStateException |
| void | setPreviewMode (AlivcPreviewDisplayMode mode) throws IllegalStateException |
| void | pauseScreenCapture () throws IllegalStateException |
| void | resumeScreenCapture () throws IllegalStateException |
| AlivcLivePushError | getLastError () |
| void | changeResolution (AlivcResolutionEnum resolution) |
| void | addWaterMark (String path, float x, float y, float width) |
| void | setWatermarkVisible (boolean visible) |
| int | startCamera (SurfaceView surfaceView) throws IllegalStateException |
| void | stopCamera () |
| void | setScreenOrientation (int orientation) |
| int | startCameraMix (float x, float y, float w, float h) |
| void | stopCameraMix () |
| void | snapshot (int count, int interval, AlivcSnapshotListener listener) |
| void | inputStreamVideoPtr (long dataPtr, int width, int height, int stride, int size, long pts, int rotation) |
| void | inputStreamVideoData (byte[] data, int width, int height, int stride, int size, long pts, int rotation) |
| void | inputStreamAudioPtr (long dataPtr, int size, int sampleRate, int channels, long pts) |
| void | inputStreamAudioData (byte[] data, int size, int sampleRate, int channels, long pts) |
| int | addDynamicsAddons (String path, float x, float y, float w, float h) |
| void | removeDynamicsAddons (int id) |
| void | setExposure (int exposure) |
| int | getCurrentExposure () |
| int | getSupportedMinExposure () |
| int | getSupportedMaxExposure () |
| void | sendMessage (String info, int repeat, int delay, boolean isKeyFrame) |
| int | setLiveMixTranscodingConfig (AlivcLiveTranscodingConfig config) |
| int | muteLocalCamera (boolean mute) |
| int | enableSpeakerphone (boolean enable) |
| boolean | isSpeakerphoneOn () |
| int | enableAudioVolumeIndication (int interval, int smooth, int reportVad) |
| String | getLiveTraceId () |
推流接口类
在文件 AlivcLivePusher.java 第 33 行定义.
| int com.alivc.live.pusher.AlivcLivePusher.addDynamicsAddons | ( | String | path, |
| float | x, | ||
| float | y, | ||
| float | w, | ||
| float | h | ||
| ) |
添加动态贴纸
| path | 贴纸路径,带config.json |
| x | 显示起始x位置(0~1.0f) |
| y | 显示起始y位置(0~1.0f) |
| w | 显示宽度(0~1.0f) |
| h | 显示高度(0~1.0f) |
在文件 AlivcLivePusher.java 第 1162 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.addWaterMark | ( | String | path, |
| float | x, | ||
| float | y, | ||
| float | width | ||
| ) |
添加水印,起点位置坐标x[0,width) y[0,height) 宽度(0,width],最多添加3个
| path | 水印图片 |
| x | 水印左上角x轴位置 相对位置 0~1 |
| y | 水印右上角y轴位置 相对位置 0~1 |
| width | 水印显示宽度 相对位置 0~1 |
在文件 AlivcLivePusher.java 第 970 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.changeResolution | ( | AlivcResolutionEnum | resolution | ) |
| void com.alivc.live.pusher.AlivcLivePusher.destroy | ( | ) | throws IllegalStateException |
| int com.alivc.live.pusher.AlivcLivePusher.enableAudioVolumeIndication | ( | int | interval, |
| int | smooth, | ||
| int | reportVad | ||
| ) |
设置音量回调频率和平滑系数
| interval | 时间间隔,单位:ms,默认值:300ms;取值范围:最小值≥10ms,建议设置为300ms~500ms;取值≤0表示不启用音量提示和说话人提示功能。 |
| smooth | 平滑系数,数值越大平滑程度越高,反之越低,实时性越好。默认值:3;取值范围:0~9,建议设置为3。 |
| reportVad | 本地语音检测开关。1:开启,通过onMicrophoneVolumeUpdate接口回调;0(默认值):关闭。 |
在文件 AlivcLivePusher.java 第 1329 行定义.
| int com.alivc.live.pusher.AlivcLivePusher.enableSpeakerphone | ( | boolean | enable | ) |
设置音频输出为听筒还是扬声器
| enable | true:扬声器模式(默认扬声器);false:听筒模式 |
在文件 AlivcLivePusher.java 第 1298 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.focusCameraAtAdjustedPoint | ( | float | x, |
| float | y, | ||
| boolean | autoFocus | ||
| ) | throws IllegalArgumentException, IllegalStateException |
对焦,对焦点的坐标x[0,屏幕宽度],y[0,屏幕宽度]
| x | 对焦的点x坐标 |
| y | 对焦的点y坐标y |
| autoFocus | 是否自动聚焦 |
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview |
在文件 AlivcLivePusher.java 第 327 行定义.
| int com.alivc.live.pusher.AlivcLivePusher.getCurrentExposure | ( | ) |
| AlivcLivePushStats com.alivc.live.pusher.AlivcLivePusher.getCurrentStatus | ( | ) |
| int com.alivc.live.pusher.AlivcLivePusher.getCurrentZoom | ( | ) | throws IllegalStateException |
获取当前缩放值
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview |
在文件 AlivcLivePusher.java 第 369 行定义.
| AlivcLivePushError com.alivc.live.pusher.AlivcLivePusher.getLastError | ( | ) |
| AlivcLivePushStatsInfo com.alivc.live.pusher.AlivcLivePusher.getLivePushStatsInfo | ( | ) | throws IllegalStateException |
| String com.alivc.live.pusher.AlivcLivePusher.getLiveTraceId | ( | ) |
| int com.alivc.live.pusher.AlivcLivePusher.getMaxZoom | ( | ) | throws IllegalStateException |
获取摄像头支持的最大缩放值
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview |
在文件 AlivcLivePusher.java 第 355 行定义.
| String com.alivc.live.pusher.AlivcLivePusher.getPushUrl | ( | ) |
| int com.alivc.live.pusher.AlivcLivePusher.getSupportedMaxExposure | ( | ) |
| int com.alivc.live.pusher.AlivcLivePusher.getSupportedMinExposure | ( | ) |
| void com.alivc.live.pusher.AlivcLivePusher.init | ( | Context | context, |
| AlivcLivePushConfig | config | ||
| ) | throws IllegalArgumentException, IllegalStateException |
初始化推流参数
| context | 上下文 |
| config | 配置 |
| IllegalArgumentException | 如果 config为空,或者config的值为无效(例如码率的值超过范围) |
| IllegalStateException | 如果状态不对,例如已经初始化,但是还没有销毁 |
在文件 AlivcLivePusher.java 第 48 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.inputStreamAudioData | ( | byte[] | data, |
| int | size, | ||
| int | sampleRate, | ||
| int | channels, | ||
| long | pts | ||
| ) |
输入自定义音频数据
| data | 音频数据 byte array |
| size | 音频数据大小 |
| sampleRate | 音频比特率 |
| channels | 音频通道数 |
| pts | 音频数据pts(US) |
在文件 AlivcLivePusher.java 第 1144 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.inputStreamAudioPtr | ( | long | dataPtr, |
| int | size, | ||
| int | sampleRate, | ||
| int | channels, | ||
| long | pts | ||
| ) |
输入自定义音频数据
| dataPtr | 音频数据native内存指针 |
| size | 音频数据大小 |
| sampleRate | 音频比特率 |
| channels | 音频通道数 |
| pts | 音频数据pts(US) |
在文件 AlivcLivePusher.java 第 1125 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.inputStreamVideoData | ( | byte[] | data, |
| int | width, | ||
| int | height, | ||
| int | stride, | ||
| int | size, | ||
| long | pts, | ||
| int | rotation | ||
| ) |
输入自定义视频流
| data | 视频图像byte array |
| width | 视频图像宽度 |
| height | 视频图像高度 |
| stride | 视频图像stride |
| size | 视频图像size |
| pts | 视频图像pts(us) |
| rotation | 视频图像旋转角度 |
在文件 AlivcLivePusher.java 第 1106 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.inputStreamVideoPtr | ( | long | dataPtr, |
| int | width, | ||
| int | height, | ||
| int | stride, | ||
| int | size, | ||
| long | pts, | ||
| int | rotation | ||
| ) |
输入自定义视频流
| dataPtr | native内存指针 |
| width | 视频图像宽度 |
| height | 视频图像高度 |
| stride | 视频图像高度 |
| size | 视频图像size |
| pts | 视频图像pts(us) |
| rotation | 视频图像旋转角度 |
在文件 AlivcLivePusher.java 第 1085 行定义.
| boolean com.alivc.live.pusher.AlivcLivePusher.isCameraSupportAutoFocus | ( | ) |
| boolean com.alivc.live.pusher.AlivcLivePusher.isCameraSupportFlash | ( | ) |
| boolean com.alivc.live.pusher.AlivcLivePusher.isNetworkPushing | ( | ) | throws IllegalStateException |
| boolean com.alivc.live.pusher.AlivcLivePusher.isPushing | ( | ) | throws IllegalStateException |
是否正在推流
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush |
在文件 AlivcLivePusher.java 第 509 行定义.
| boolean com.alivc.live.pusher.AlivcLivePusher.isSpeakerphoneOn | ( | ) |
获取当前音频输出为听筒还是扬声器
在文件 AlivcLivePusher.java 第 1312 行定义.
| int com.alivc.live.pusher.AlivcLivePusher.muteLocalCamera | ( | boolean | mute | ) |
关闭/打开摄像头
| mute | true表示不发送视频数据,false表示恢复正常 |
在文件 AlivcLivePusher.java 第 1283 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.pause | ( | ) | throws IllegalStateException |
暂停推流
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush/已经pause |
在文件 AlivcLivePusher.java 第 258 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.pauseBGM | ( | ) | throws IllegalStateException |
| void com.alivc.live.pusher.AlivcLivePusher.pauseScreenCapture | ( | ) | throws IllegalStateException |
暂停录屏推流(隐私开)
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush/已经pause |
在文件 AlivcLivePusher.java 第 914 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.reconnectPushAsync | ( | String | url | ) | throws IllegalStateException |
重新连接进行推流
| url | 推流URL |
| IllegalStateException | 例如还未初始化/未startPreview/未startPush/已经stopPush |
在文件 AlivcLivePusher.java 第 232 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.refreshPushURLToken | ( | String | url | ) |
刷新Token鉴权信息,传入一个新的推流URL,包含未过期的新token信息,房间ID/用户ID/sdkAppId需要和之前保持一样
| url | 推流Url |
在文件 AlivcLivePusher.java 第 469 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.removeDynamicsAddons | ( | int | id | ) |
| void com.alivc.live.pusher.AlivcLivePusher.restartPush | ( | ) | throws IllegalStateException |
重新开始推流
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush/已经stopPush |
在文件 AlivcLivePusher.java 第 205 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.restartPushAsync | ( | ) | throws IllegalStateException |
重新开始推流
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush/已经stopPush |
在文件 AlivcLivePusher.java 第 218 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.resume | ( | ) | throws IllegalStateException |
恢复推流
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush/未pause/已resume |
在文件 AlivcLivePusher.java 第 271 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.resumeAsync | ( | ) | throws IllegalStateException |
异步恢复推流
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush/未pause/已resume |
在文件 AlivcLivePusher.java 第 284 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.resumeBGM | ( | ) | throws IllegalStateException |
| void com.alivc.live.pusher.AlivcLivePusher.resumeScreenCapture | ( | ) | throws IllegalStateException |
恢复录屏推流(隐私关)
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush/未pause/已resume |
在文件 AlivcLivePusher.java 第 927 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.sendMessage | ( | String | info, |
| int | repeat, | ||
| int | delay, | ||
| boolean | isKeyFrame | ||
| ) |
推流端发送自定义消息
| info | 需要插入流的SEI消息体,建议是json格式 |
| repeat | 发送的帧数 |
| delay | 延时多少毫秒发送 |
| isKeyFrame | 是否只发送关键帧 |
在文件 AlivcLivePusher.java 第 1243 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.setAudioDenoise | ( | boolean | on | ) |
| int com.alivc.live.pusher.AlivcLivePusher.setAudioEffectReverbMode | ( | AlivcLivePushAudioEffectReverbMode | mode | ) |
| int com.alivc.live.pusher.AlivcLivePusher.setAudioEffectVoiceChangeMode | ( | AlivcLivePushAudioEffectVoiceChangeMode | mode | ) |
| void com.alivc.live.pusher.AlivcLivePusher.setAutoFocus | ( | boolean | autoFocus | ) | throws IllegalStateException |
设置自动对焦
| autoFocus | 自动聚焦 |
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview |
在文件 AlivcLivePusher.java 第 311 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.setBGMEarsBack | ( | boolean | isOpen | ) | throws IllegalStateException |
| void com.alivc.live.pusher.AlivcLivePusher.setBGMLoop | ( | boolean | isLoop | ) | throws IllegalStateException |
| void com.alivc.live.pusher.AlivcLivePusher.setBGMVolume | ( | int | volume | ) | throws IllegalStateException, IllegalArgumentException |
设置背景音乐音量
| volume | 背景音乐音量 范围:[0 ~ 100] 默认:50 |
| IllegalStateException | 状态错误 |
| IllegalArgumentException | 参数错误 |
在文件 AlivcLivePusher.java 第 808 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.setCaptureVolume | ( | int | volume | ) | throws IllegalStateException, IllegalArgumentException |
设置人声音量
| volume | 人声音量 范围:[0 ~ 100] 默认:50 |
| IllegalStateException | 状态错误 |
| IllegalArgumentException | 参数错误 |
在文件 AlivcLivePusher.java 第 823 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.setCustomAudioFilter | ( | AlivcLivePushCustomAudioFilter | customAudioFilter | ) |
| void com.alivc.live.pusher.AlivcLivePusher.setCustomDetect | ( | AlivcLivePushCustomDetect | customVideoDetect | ) |
| void com.alivc.live.pusher.AlivcLivePusher.setCustomFilter | ( | AlivcLivePushCustomFilter | customVideoFilter | ) |
| void com.alivc.live.pusher.AlivcLivePusher.setExposure | ( | int | exposure | ) |
| void com.alivc.live.pusher.AlivcLivePusher.setFlash | ( | boolean | flash | ) | throws IllegalStateException |
是否打开闪光灯
| flash | true:打开闪光灯 false:关闭闪光灯 |
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview |
在文件 AlivcLivePusher.java 第 397 行定义.
| int com.alivc.live.pusher.AlivcLivePusher.setLiveMixTranscodingConfig | ( | AlivcLiveTranscodingConfig | config | ) |
设置云端的混流转码参数
| config | 云端混流转码参数 |
在文件 AlivcLivePusher.java 第 1265 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.setLivePushBGMListener | ( | AlivcLivePushBGMListener | pushBGMListener | ) |
| void com.alivc.live.pusher.AlivcLivePusher.setLivePusherReference | ( | AlivcLivePusher | livePusher | ) |
| void com.alivc.live.pusher.AlivcLivePusher.setLivePushErrorListener | ( | AlivcLivePushErrorListener | errorListener | ) |
| void com.alivc.live.pusher.AlivcLivePusher.setLivePushInfoListener | ( | AlivcLivePushInfoListener | infoListener | ) |
| void com.alivc.live.pusher.AlivcLivePusher.setLivePushNetworkListener | ( | AlivcLivePushNetworkListener | networkListener | ) |
| void com.alivc.live.pusher.AlivcLivePusher.setLivePushRenderContextListener | ( | AlivcLivePusherRenderContextListener | renderCtxListener | ) |
| void com.alivc.live.pusher.AlivcLivePusher.setMinVideoBitrate | ( | int | minVideoBitrate | ) | throws IllegalArgumentException, IllegalStateException |
设置最小视频码率(Kbps)
| minVideoBitrate | 最小视频编码码率 |
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush |
在文件 AlivcLivePusher.java 第 453 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.setMute | ( | boolean | mute | ) | throws IllegalStateException |
是否静音
| mute | true:静音推流 false:正常推流 |
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush |
在文件 AlivcLivePusher.java 第 383 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.setPreviewMirror | ( | boolean | mirror | ) | throws IllegalStateException |
预览镜像开关
| mirror | true:打开预览镜像 false:关闭预览镜像 |
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview |
在文件 AlivcLivePusher.java 第 425 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.setPreviewMode | ( | AlivcPreviewDisplayMode | mode | ) | throws IllegalStateException |
| void com.alivc.live.pusher.AlivcLivePusher.setPreviewOrientation | ( | AlivcPreviewOrientationEnum | orientation | ) |
| void com.alivc.live.pusher.AlivcLivePusher.setPushMirror | ( | boolean | mirror | ) | throws IllegalStateException |
推流端是否水平镜像
| mirror | true:打开推流镜像 false:关闭推流镜像 |
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush |
在文件 AlivcLivePusher.java 第 411 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.setQualityMode | ( | AlivcQualityModeEnum | mode | ) | throws IllegalStateException |
| void com.alivc.live.pusher.AlivcLivePusher.setScreenOrientation | ( | int | orientation | ) |
| void com.alivc.live.pusher.AlivcLivePusher.setTargetVideoBitrate | ( | int | targetVideoBitrate | ) | throws IllegalArgumentException, IllegalStateException |
设置目标视频码率[100,5000](Kbps)
| targetVideoBitrate | 目标视频编码码率 |
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush |
在文件 AlivcLivePusher.java 第 439 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.setWatermarkVisible | ( | boolean | visible | ) |
| void com.alivc.live.pusher.AlivcLivePusher.setZoom | ( | int | zoom | ) | throws IllegalArgumentException, IllegalStateException |
设置缩放
| zoom | 0~getMaxZoom() |
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview |
在文件 AlivcLivePusher.java 第 341 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.snapshot | ( | int | count, |
| int | interval, | ||
| AlivcSnapshotListener | listener | ||
| ) |
视频流截图
| count | 截取图片的个数,该参数仅在普通模式下生效 |
| interval | 每张图片的间隔,该参数仅在普通模式下生效 |
| listener | 截图回调 |
在文件 AlivcLivePusher.java 第 1065 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.startBGMAsync | ( | String | path | ) | throws IllegalStateException |
| int com.alivc.live.pusher.AlivcLivePusher.startCamera | ( | SurfaceView | surfaceView | ) | throws IllegalStateException |
录屏模式下,开启摄像头预览 如果不需要预览,则surfaceView填为null
| surfaceView | surfaceView |
在文件 AlivcLivePusher.java 第 998 行定义.
| int com.alivc.live.pusher.AlivcLivePusher.startCameraMix | ( | float | x, |
| float | y, | ||
| float | w, | ||
| float | h | ||
| ) |
录屏模式下,开启摄像头混流
| x | 混流显示x初始位置(0~1.0f) |
| y | 混流显示y初始位置(0~1.0f) |
| w | 混流显示宽度(0~1.0f) |
| h | 混流显示高度(0~1.0f) |
在文件 AlivcLivePusher.java 第 1039 行定义.
| int com.alivc.live.pusher.AlivcLivePusher.startIntelligentDenoise | ( | ) |
开启音频智能降噪
在文件 AlivcLivePusher.java 第 859 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.startPreview | ( | SurfaceView | surfaceView | ) | throws IllegalArgumentException, IllegalStateException |
开始预览
| surfaceView | surfaceView |
| IllegalArgumentException | 如果surfaceView为空,或者surfaceView的surface未创建/已销毁 |
| IllegalStateException | 如果状态不对,例如还未初始化 |
在文件 AlivcLivePusher.java 第 115 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.startPreview | ( | Context | context, |
| FrameLayout | frameLayout, | ||
| boolean | isAnchor | ||
| ) | throws IllegalArgumentException, IllegalStateException |
开始预览(仅用于互动模式)
| context | android context |
| frameLayout | FrameLayout Container |
| isAnchor | 是否主播 |
| IllegalArgumentException | 参数错误 |
| IllegalStateException | 状态错误 |
在文件 AlivcLivePusher.java 第 149 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.startPreviewAsync | ( | SurfaceView | surfaceView | ) | throws IllegalArgumentException, IllegalStateException |
异步开始预览
| surfaceView | surfaceView |
| IllegalArgumentException | 如果surfaceView为空,或者surfaceView的surface未创建/已销毁 |
| IllegalStateException | 如果状态不对,例如还未初始化 |
在文件 AlivcLivePusher.java 第 131 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.startPush | ( | String | url | ) | throws IllegalArgumentException, IllegalStateException |
开始推流
| url | 推流Url |
| IllegalArgumentException | 如果url为空,或者不是有效的url格式 |
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview |
在文件 AlivcLivePusher.java 第 177 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.startPushAsync | ( | String | url | ) | throws IllegalArgumentException, IllegalStateException |
开始异步推流
| url | 推流Url |
| IllegalArgumentException | 如果url为空,或者不是有效的url格式 |
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview |
在文件 AlivcLivePusher.java 第 192 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.stopBGMAsync | ( | ) | throws IllegalStateException |
| void com.alivc.live.pusher.AlivcLivePusher.stopCamera | ( | ) |
录屏模式下,关闭摄像头预览
在文件 AlivcLivePusher.java 第 1009 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.stopCameraMix | ( | ) |
录屏模式下,停止摄像头混流
在文件 AlivcLivePusher.java 第 1050 行定义.
| int com.alivc.live.pusher.AlivcLivePusher.stopIntelligentDenoise | ( | ) |
| void com.alivc.live.pusher.AlivcLivePusher.stopPreview | ( | ) | throws IllegalStateException |
| void com.alivc.live.pusher.AlivcLivePusher.stopPush | ( | ) | throws IllegalStateException |
结束推流
| IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush/已经stopPush |
在文件 AlivcLivePusher.java 第 245 行定义.
| void com.alivc.live.pusher.AlivcLivePusher.switchCamera | ( | ) | throws IllegalStateException |