「主要API」推流接口类 更多...
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 isFullScreen) throws IllegalArgumentException, IllegalStateException |
void | updatePreview (Context context, FrameLayout frameLayout, boolean isFullScreen) |
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 | setMute (boolean mute, AlivcLiveMuteLocalAudioMode muteLocalAudioMode) |
void | setFlash (boolean flash) throws IllegalStateException |
void | setPushMirror (boolean mirror) throws IllegalStateException |
void | setPreviewMirror (boolean mirror) throws IllegalStateException |
int | setVideoMirrorMode (AlivcLiveVideoMirrorMode mirrorMode) |
void | setVideoConfig (AlivcLivePushVideoConfig videoConfig) |
AlivcLivePushVideoConfig | getVideoConfig () |
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 | setLivePushAudioFrameListener (AlivcLivePushAudioFrameListener pushAudioFrameListener) |
void | setLivePushRenderContextListener (AlivcLivePusherRenderContextListener renderCtxListener) |
AlivcLivePushStatsInfo | getLivePushStatsInfo () throws IllegalStateException |
String | getPushUrl () |
int | setParameter (String parameter) |
String | getParameter (String parameter) |
void | setPreviewOrientation (AlivcPreviewOrientationEnum orientation) |
int | startBGMAsync (String path) throws IllegalStateException |
int | startBGMAsync (String path, AlivcLiveBGMConfig bgmConfig) |
void | stopBGMAsync () throws IllegalStateException |
int | getBGMDuration () |
int | getBGMCurrentPosition () |
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 enable) |
int | startIntelligentDenoise () |
int | stopIntelligentDenoise () |
void | setQualityMode (AlivcQualityModeEnum mode) throws IllegalStateException |
void | setPreviewMode (AlivcPreviewDisplayMode mode) throws IllegalStateException |
void | pauseScreenCapture () throws IllegalStateException |
void | resumeScreenCapture () throws IllegalStateException |
AlivcEncodeType | getVideoCodecType () |
AlivcLivePushError | getLastError () |
void | changeResolution (AlivcResolutionEnum resolution) |
void | addWaterMark (String path, float x, float y, float width) |
void | addWaterMark (Bitmap bitmap, 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 () |
boolean | startLocalRecord (AlivcLiveLocalRecordConfig localRecordConfig) |
void | stopLocalRecord () |
int | startScreenShare () |
int | stopScreenShare () |
int | startLocalDualAudioStream () |
int | stopLocalDualAudioStream () |
void | snapshot (int count, int interval, AlivcSnapshotListener listener) |
void | setExternalVideoSource (boolean enable, boolean useTexture, AlivcLivePlayVideoStreamType videoStreamType, AlivcPreviewDisplayMode previewDisplayMode) |
int | pushExternalVideoFrame (AlivcLivePusherRawDataSample rawDataSample, AlivcLivePlayVideoStreamType videoStreamType) |
int | setMixedWithMic (boolean mixed) |
int | addExternalAudioStream (AlivcLivePushExternalAudioStreamConfig externalAudioStreamConfig) |
int | pushExternalAudioStream (int streamId, AlivcLivePushAudioFrame audioFrame) |
int | setExternalAudioStreamPlayoutVolume (int streamId, int playoutVolume) |
int | setExternalAudioStreamPublishVolume (int streamId, int publishVolume) |
int | removeExternalAudioStream (int streamId) |
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 () |
int | enableSEIVideoStream (boolean enable) |
void | sendMessage (String info, int repeat, int delay, boolean isKeyFrame) |
void | sendMessage (String info, int repeat, int delay, boolean isKeyFrame, int payloadType) |
int | sendDataChannelMessage (String message) |
int | setLiveMixTranscodingConfig (AlivcLiveTranscodingConfig config) |
int | muteLocalCamera (boolean mute) |
int | enableLocalCamera (boolean enable) |
int | startAudioCapture (boolean keepAlive) |
int | stopAudioCapture () |
int | enableSpeakerphone (boolean enable) |
boolean | isSpeakerphoneOn () |
int | setChannelProfile (AlivcLiveChannelProfile channelProfile) |
int | setAudioProfile (AlivcLiveAudioProfileQualityMode audioProfileQualityMode) |
int | setAudioEffectVoiceChangeMode (AlivcLivePushAudioEffectVoiceChangeMode mode) |
int | setAudioEffectReverbMode (AlivcLivePushAudioEffectReverbMode mode) |
int | setAudioEffectPitchValue (double value) |
int | setAudioEffectBeautifyMode (AlivcLiveAudioEffectBeautifyMode audioEffectBeautifyMode) |
int | setAudioEffectReverbParamType (AlivcLiveAudioEffectReverbParamType audioEffectReverbParamType, float value) |
int | setAudioEffectEqualizationParam (AlivcLiveAudioEffectEqualizationBandFrequency audioEffectEqualizationBandFrequency, float gain) |
int | enableAudioVolumeIndication (int interval, int smooth, int reportVad) |
int | enableAudioFrameObserver (boolean enable, AlivcLiveAudioSource audioSource, AlivcLiveAudioFrameObserverConfig config) |
int | preloadAudioEffect (int soundId, String filePath) |
int | unloadAudioEffect (int soundId) |
int | playAudioEffect (int soundId, String filePath, AlivcLiveAudioEffectConfig config) |
int | stopAudioEffect (int soundId) |
int | stopAllAudioEffects () |
int | setAudioEffectPublishVolume (int soundId, int volume) |
int | getAudioEffectPublishVolume (int soundId) |
int | setAudioEffectPlayoutVolume (int soundId, int volume) |
int | getAudioEffectPlayoutVolume (int soundId) |
int | setAllAudioEffectsPublishVolume (int volume) |
int | setAllAudioEffectsPlayoutVolume (int volume) |
int | pauseAudioEffect (int soundId) |
int | pauseAllAudioEffects () |
int | resumeAudioEffect (int soundId) |
int | resumeAllAudioEffects () |
int | startLastMileDetect (AlivcLiveNetworkQualityProbeConfig networkQualityProbeConfig) |
int | stopLastMileDetect () |
AlivcLiveVideoCodecManufacturer | getCurrentEncoderManufacturer (boolean isCameraStream) |
String | getLiveTraceId () |
「主要API」推流接口类
AlivcRTC
作为日志tag,进行自主排障。 在文件 AlivcLivePusher.java 第 48 行定义.
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 第 1639 行定义.
int com.alivc.live.pusher.AlivcLivePusher.addExternalAudioStream | ( | AlivcLivePushExternalAudioStreamConfig | externalAudioStreamConfig | ) |
新增外部音频流
externalAudioStreamConfig | 外部音频流配置 |
在文件 AlivcLivePusher.java 第 1476 行定义.
void com.alivc.live.pusher.AlivcLivePusher.addWaterMark | ( | Bitmap | bitmap, |
float | x, | ||
float | y, | ||
float | width | ||
) |
添加水印,起点位置坐标x[0,width) y[0, height) 宽度(0, width]
bitmap | 水印bitmap(格式:rgba) |
x | 水印左上角x轴位置 相对位置 0~1 |
y | 水印右上角y轴位置 相对位置 0~1 |
width | 水印显示宽度 相对位置 0~1 |
com.alivc.live.pusher.AlivcLivePushInfoListener#onPreviewStarted(AlivcLivePusher)
已回调 在文件 AlivcLivePusher.java 第 1221 行定义.
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 第 1202 行定义.
void com.alivc.live.pusher.AlivcLivePusher.changeResolution | ( | AlivcResolutionEnum | resolution | ) |
动态调整分辨率
resolution | 分辨率 |
AlivcLivePusher#setVideoConfig(AlivcLivePushVideoConfig)
替代 AlivcLivePushConfig#setResolution(AlivcResolutionEnum)
AlivcLivePusher#changeResolution(AlivcResolutionEnum)
AlivcLivePusher#setTargetVideoBitrate(int)
,AlivcLivePusher#setMinVideoBitrate(int)
com.alivc.live.player.AlivcLivePlayInfoListener#onVideoResolutionChanged(int, int)
在文件 AlivcLivePusher.java 第 1184 行定义.
void com.alivc.live.pusher.AlivcLivePusher.destroy | ( | ) | throws IllegalStateException |
int com.alivc.live.pusher.AlivcLivePusher.enableAudioFrameObserver | ( | boolean | enable, |
AlivcLiveAudioSource | audioSource, | ||
AlivcLiveAudioFrameObserverConfig | config | ||
) |
设置音频裸数据回调参数
enable | 是否允许音频数据回调 |
audioSource | 回调数据源类型 |
config | 回调参数设置 |
在文件 AlivcLivePusher.java 第 2086 行定义.
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:开启,通过 AlivcLivePushInfoListener#onMicrophoneVolumeUpdate(AlivcLivePusher, int) 接口回调;0(默认值):关闭。 |
在文件 AlivcLivePusher.java 第 2066 行定义.
int com.alivc.live.pusher.AlivcLivePusher.enableLocalCamera | ( | boolean | enable | ) |
禁用或启用本地视频采集
enable | true->启用本地视频采集,false->关闭本地视频采集 |
com.alivc.live.player.AlivcLivePlayInfoListener#onVideoEnabled(boolean)
com.alivc.live.pusher.AlivcLivePusher#muteLocalCamera(boolean)
在文件 AlivcLivePusher.java 第 1851 行定义.
int com.alivc.live.pusher.AlivcLivePusher.enableSEIVideoStream | ( | boolean | enable | ) |
开启SEI视频流
enable | 指定是否启用 |
AlivcLivePusher#enableLocalCamera(boolean)
关闭摄像头采集,默认不会发送视频; AlivcLivePusher#sendMessage(String, int, int, boolean)
接口发送SEI信息,SDK内部默认会发送16x16全黑图片流/20fps的视频流来承载SEI信息; 在文件 AlivcLivePusher.java 第 1722 行定义.
int com.alivc.live.pusher.AlivcLivePusher.enableSpeakerphone | ( | boolean | enable | ) |
设置音频输出为听筒还是扬声器
enable | true:扬声器模式(默认扬声器);false:听筒模式 |
在文件 AlivcLivePusher.java 第 1902 行定义.
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 第 400 行定义.
int com.alivc.live.pusher.AlivcLivePusher.getAudioEffectPlayoutVolume | ( | int | soundId | ) |
获取音效本地播放音量
soundId | 用户给该音效文件分配的ID |
在文件 AlivcLivePusher.java 第 2227 行定义.
int com.alivc.live.pusher.AlivcLivePusher.getAudioEffectPublishVolume | ( | int | soundId | ) |
获取音效推流混音音量
soundId | 用户给该音效文件分配的ID |
在文件 AlivcLivePusher.java 第 2196 行定义.
int com.alivc.live.pusher.AlivcLivePusher.getBGMCurrentPosition | ( | ) |
获取伴奏文件播放进度
在文件 AlivcLivePusher.java 第 947 行定义.
int com.alivc.live.pusher.AlivcLivePusher.getBGMDuration | ( | ) |
获取伴奏文件时长
在文件 AlivcLivePusher.java 第 932 行定义.
AlivcLiveVideoCodecManufacturer com.alivc.live.pusher.AlivcLivePusher.getCurrentEncoderManufacturer | ( | boolean | isCameraStream | ) |
获取当前使用的编解码器类型,如未开始推流,返回无效类型
isCameraStream | true->获取摄像头流的编码器类型;false->获取共享流的编码器类型 |
在文件 AlivcLivePusher.java 第 2362 行定义.
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 第 442 行定义.
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 第 428 行定义.
String com.alivc.live.pusher.AlivcLivePusher.getParameter | ( | String | parameter | ) |
String com.alivc.live.pusher.AlivcLivePusher.getPushUrl | ( | ) |
int com.alivc.live.pusher.AlivcLivePusher.getSupportedMaxExposure | ( | ) |
int com.alivc.live.pusher.AlivcLivePusher.getSupportedMinExposure | ( | ) |
AlivcEncodeType com.alivc.live.pusher.AlivcLivePusher.getVideoCodecType | ( | ) |
AlivcLivePushVideoConfig com.alivc.live.pusher.AlivcLivePusher.getVideoConfig | ( | ) |
void com.alivc.live.pusher.AlivcLivePusher.init | ( | Context | context, |
AlivcLivePushConfig | config | ||
) | throws IllegalArgumentException, IllegalStateException |
初始化推流引擎
context | android context |
config | 推流配置 |
IllegalArgumentException | 如果配置为空,或者配置值无效(例如码率的值超过范围) |
IllegalStateException | 如果状态不对,例如已经初始化,但是还没有销毁 |
com.alivc.live.pusher.AlivcLivePusher#destroy()
在文件 AlivcLivePusher.java 第 64 行定义.
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) |
AlivcLivePushConfig#setExternMainStream(boolean, AlivcImageFormat, AlivcSoundFormat)
开启外置自定义输入流才会起作用 在文件 AlivcLivePusher.java 第 1620 行定义.
void com.alivc.live.pusher.AlivcLivePusher.inputStreamAudioPtr | ( | long | dataPtr, |
int | size, | ||
int | sampleRate, | ||
int | channels, | ||
long | pts | ||
) |
输入自定义音频数据 (deprecated)
dataPtr | 音频数据native内存指针 |
size | 音频数据大小 |
sampleRate | 音频比特率 |
channels | 音频通道数 |
pts | 音频数据pts(US) |
在文件 AlivcLivePusher.java 第 1602 行定义.
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 | 视频图像旋转角度 |
AlivcLivePushConfig#setExternMainStream(boolean, AlivcImageFormat, AlivcSoundFormat)
开启外置自定义输入流才会起作用 在文件 AlivcLivePusher.java 第 1582 行定义.
void com.alivc.live.pusher.AlivcLivePusher.inputStreamVideoPtr | ( | long | dataPtr, |
int | width, | ||
int | height, | ||
int | stride, | ||
int | size, | ||
long | pts, | ||
int | rotation | ||
) |
输入自定义视频流 (deprecated)
dataPtr | native内存指针 |
width | 视频图像宽度 |
height | 视频图像高度 |
stride | 视频图像高度 |
size | 视频图像size |
pts | 视频图像pts(us) |
rotation | 视频图像旋转角度 |
AlivcLivePushConfig#setExternMainStream(boolean, AlivcImageFormat, AlivcSoundFormat)
开启外置自定义输入流才会起作用 在文件 AlivcLivePusher.java 第 1562 行定义.
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 第 648 行定义.
boolean com.alivc.live.pusher.AlivcLivePusher.isSpeakerphoneOn | ( | ) |
获取当前音频输出为听筒还是扬声器
在文件 AlivcLivePusher.java 第 1916 行定义.
int com.alivc.live.pusher.AlivcLivePusher.muteLocalCamera | ( | boolean | mute | ) |
关闭/打开摄像头
mute | true->不发送视频数据,false->恢复正常 |
com.alivc.live.player.AlivcLivePlayInfoListener#onVideoMuted(boolean)
com.alivc.live.pusher.AlivcLivePushConfig#setPausePushImage(String)
,采集预览正常,对端显示静态图片; com.alivc.live.pusher.AlivcLivePushConfig#setPausePushImage(String)
,采集预览正常,对端会黑屏; com.alivc.live.pusher.AlivcLivePusher#enableLocalCamera(boolean)
在文件 AlivcLivePusher.java 第 1833 行定义.
void com.alivc.live.pusher.AlivcLivePusher.pause | ( | ) | throws IllegalStateException |
暂停推流
IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush/已经pause |
AlivcLivePushConfig#setPausePushImage(String)
设置推流暂停图片地址才会起作用 com.alivc.live.pusher.AlivcLivePushInfoListener#onPushPaused(AlivcLivePusher)
com.alivc.live.pusher.AlivcLivePusher#resume()
com.alivc.live.pusher.AlivcLivePusher#resumeAsync()
在文件 AlivcLivePusher.java 第 327 行定义.
int com.alivc.live.pusher.AlivcLivePusher.pauseAllAudioEffects | ( | ) |
int com.alivc.live.pusher.AlivcLivePusher.pauseAudioEffect | ( | int | soundId | ) |
暂停音效
soundId | 用户给该音效文件分配的ID |
在文件 AlivcLivePusher.java 第 2272 行定义.
void com.alivc.live.pusher.AlivcLivePusher.pauseBGM | ( | ) | throws IllegalStateException |
void com.alivc.live.pusher.AlivcLivePusher.pauseScreenCapture | ( | ) | throws IllegalStateException |
暂停录屏推流(隐私开)
IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush/已经pause |
在文件 AlivcLivePusher.java 第 1125 行定义.
int com.alivc.live.pusher.AlivcLivePusher.playAudioEffect | ( | int | soundId, |
String | filePath, | ||
AlivcLiveAudioEffectConfig | config | ||
) |
开始播放音效
soundId | 用户给该音效文件分配的ID |
filePath | 文件路径,支持本地文件和网络url |
config | 伴奏播放配置 |
在文件 AlivcLivePusher.java 第 2136 行定义.
int com.alivc.live.pusher.AlivcLivePusher.preloadAudioEffect | ( | int | soundId, |
String | filePath | ||
) |
预加载音效文件
soundId | 用户给该音效文件分配的ID |
filePath | 音效文件路径,支持本地文件和网络url |
在文件 AlivcLivePusher.java 第 2103 行定义.
int com.alivc.live.pusher.AlivcLivePusher.pushExternalAudioStream | ( | int | streamId, |
AlivcLivePushAudioFrame | audioFrame | ||
) |
输入外部音频流数据
streamId | 外部音频流Id |
audioFrame | 外部音频裸数据 |
在文件 AlivcLivePusher.java 第 1493 行定义.
int com.alivc.live.pusher.AlivcLivePusher.pushExternalVideoFrame | ( | AlivcLivePusherRawDataSample | rawDataSample, |
AlivcLivePlayVideoStreamType | videoStreamType | ||
) |
输入外部视频流数据
rawDataSample | 视频裸数据 |
videoStreamType | 媒体流类型 |
在文件 AlivcLivePusher.java 第 1446 行定义.
void com.alivc.live.pusher.AlivcLivePusher.reconnectPushAsync | ( | String | url | ) | throws IllegalStateException |
重新连接进行推流
url | 推流URL |
IllegalStateException | 例如还未初始化/未startPreview/未startPush/已经stopPush |
在文件 AlivcLivePusher.java 第 297 行定义.
void com.alivc.live.pusher.AlivcLivePusher.refreshPushURLToken | ( | String | url | ) |
刷新Token鉴权信息,传入一个新的推流URL,包含未过期的新token信息,房间ID/用户ID/sdkAppId需要和之前保持一样
url | 推流Url |
AlivcLivePushNetworkListener#onPushURLAuthenticationOverdue(AlivcLivePusher)
回调时,外部应当更新鉴权信息,否则会导致断流 在文件 AlivcLivePusher.java 第 608 行定义.
void com.alivc.live.pusher.AlivcLivePusher.removeDynamicsAddons | ( | int | id | ) |
int com.alivc.live.pusher.AlivcLivePusher.removeExternalAudioStream | ( | int | streamId | ) |
删除外部音频流
streamId | 外部音频流Id |
在文件 AlivcLivePusher.java 第 1540 行定义.
void com.alivc.live.pusher.AlivcLivePusher.restartPush | ( | ) | throws IllegalStateException |
重新开始推流
IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush/已经stopPush |
com.alivc.live.pusher.AlivcLivePushInfoListener#onPushRestarted(AlivcLivePusher)
com.alivc.live.pusher.AlivcLivePushInfoListener#onFirstFramePushed(AlivcLivePusher)
com.alivc.live.pusher.AlivcLivePusher#stopPush()
在文件 AlivcLivePusher.java 第 266 行定义.
void com.alivc.live.pusher.AlivcLivePusher.restartPushAsync | ( | ) | throws IllegalStateException |
重新开始推流
IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush/已经stopPush |
com.alivc.live.pusher.AlivcLivePushInfoListener#onPushRestarted(AlivcLivePusher)
com.alivc.live.pusher.AlivcLivePushInfoListener#onFirstFramePushed(AlivcLivePusher)
com.alivc.live.pusher.AlivcLivePusher#stopPush()
在文件 AlivcLivePusher.java 第 282 行定义.
void com.alivc.live.pusher.AlivcLivePusher.resume | ( | ) | throws IllegalStateException |
恢复推流
IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush/未pause/已resume |
com.alivc.live.pusher.AlivcLivePushInfoListener#onPushResumed(AlivcLivePusher)
com.alivc.live.pusher.AlivcLivePusher#pause()
在文件 AlivcLivePusher.java 第 342 行定义.
int com.alivc.live.pusher.AlivcLivePusher.resumeAllAudioEffects | ( | ) |
void com.alivc.live.pusher.AlivcLivePusher.resumeAsync | ( | ) | throws IllegalStateException |
异步恢复推流
IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush/未pause/已resume |
com.alivc.live.pusher.AlivcLivePushInfoListener#onPushResumed(AlivcLivePusher)
com.alivc.live.pusher.AlivcLivePusher#pause()
在文件 AlivcLivePusher.java 第 357 行定义.
int com.alivc.live.pusher.AlivcLivePusher.resumeAudioEffect | ( | int | soundId | ) |
恢复指定音效文件
soundId | 用户给该音效文件分配的ID |
在文件 AlivcLivePusher.java 第 2301 行定义.
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 第 1138 行定义.
int com.alivc.live.pusher.AlivcLivePusher.sendDataChannelMessage | ( | String | message | ) |
推流端通过数据通道发送自定义消息
message | 自定义消息 |
com.alivc.live.pusher.AlivcLivePushConfig#setEnableDataChannelMessage(boolean)
接口开启功能 com.alivc.live.player.AlivcLivePlayInfoListener#onReceiveDataChannelMessage(byte[])
回调接收消息 com.alivc.live.pusher.AlivcLivePusher#sendMessage(String, int, int, boolean)
或 com.alivc.live.pusher.AlivcLivePusher#sendMessage(String, int, int, boolean, int)
在文件 AlivcLivePusher.java 第 1787 行定义.
void com.alivc.live.pusher.AlivcLivePusher.sendMessage | ( | String | info, |
int | repeat, | ||
int | delay, | ||
boolean | isKeyFrame | ||
) |
推流端发送自定义消息(发送SEI)
info | 需要插入流的SEI消息体,建议是json格式 |
repeat | 发送的帧数 |
delay | 延时多少毫秒发送 |
isKeyFrame | 是否只发送关键帧 |
com.alivc.live.pusher.AlivcLivePusher#sendMessage(String, int, int, boolean, int)
com.alivc.live.player.AlivcLivePlayInfoListener#onReceiveSEIMessage(int, byte[])
接收 SEI 自定义消息 com.alivc.live.pusher.AlivcLivePusher#sendDataChannelMessage(String)
AlivcLivePusher#enableSEIVideoStream(boolean)
在文件 AlivcLivePusher.java 第 1745 行定义.
void com.alivc.live.pusher.AlivcLivePusher.sendMessage | ( | String | info, |
int | repeat, | ||
int | delay, | ||
boolean | isKeyFrame, | ||
int | payloadType | ||
) |
推流端发送自定义消息(发送SEI)
info | 需要插入流的SEI消息体,建议是json格式 |
repeat | 发送的帧数 |
delay | 延时多少毫秒发送 |
isKeyFrame | 是否只发送关键帧 |
payloadType | SEI payload type,范围值:[5, 100..254] |
com.alivc.live.pusher.AlivcLivePusher#sendMessage(String, int, int, boolean)
com.alivc.live.player.AlivcLivePlayInfoListener#onReceiveSEIMessage(int, byte[])
接收 SEI 自定义消息 com.alivc.live.pusher.AlivcLivePusher#sendDataChannelMessage(String)
AlivcLivePusher#enableSEIVideoStream(boolean)
在文件 AlivcLivePusher.java 第 1770 行定义.
int com.alivc.live.pusher.AlivcLivePusher.setAllAudioEffectsPlayoutVolume | ( | int | volume | ) |
设置所有音效本地播音量
volume | 音效本地播放音量,范围:[0, 100],默认值:50 |
在文件 AlivcLivePusher.java 第 2257 行定义.
int com.alivc.live.pusher.AlivcLivePusher.setAllAudioEffectsPublishVolume | ( | int | volume | ) |
设置所有音效推流混音音量
volume | 推流混音音量,范围是:[0, 100],默认值:50 |
在文件 AlivcLivePusher.java 第 2242 行定义.
void com.alivc.live.pusher.AlivcLivePusher.setAudioDenoise | ( | boolean | enable | ) |
设置音频降噪
enable | true:开启 false:关闭 |
在文件 AlivcLivePusher.java 第 1047 行定义.
int com.alivc.live.pusher.AlivcLivePusher.setAudioEffectBeautifyMode | ( | AlivcLiveAudioEffectBeautifyMode | audioEffectBeautifyMode | ) |
设置美声音效模式
audioEffectBeautifyMode | 美声模式 |
在文件 AlivcLivePusher.java 第 2011 行定义.
int com.alivc.live.pusher.AlivcLivePusher.setAudioEffectEqualizationParam | ( | AlivcLiveAudioEffectEqualizationBandFrequency | audioEffectEqualizationBandFrequency, |
float | gain | ||
) |
设置均衡器参数
audioEffectEqualizationBandFrequency | 均衡器段数 [0,9],中心频率 [31,62,125,250,500,1000,2000,4000,8000,16000] Hz |
gain | 均衡器增益db [-15,15],默认 0 |
在文件 AlivcLivePusher.java 第 2046 行定义.
int com.alivc.live.pusher.AlivcLivePusher.setAudioEffectPitchValue | ( | double | value | ) |
设置变调参数
value | 变调参数 |
在文件 AlivcLivePusher.java 第 1995 行定义.
int com.alivc.live.pusher.AlivcLivePusher.setAudioEffectPlayoutVolume | ( | int | soundId, |
int | volume | ||
) |
设置音效本地播放音量
soundId | 用户给该音效文件分配的ID |
volume | 音效本地播放音量,范围:[0, 100],默认值:50 |
在文件 AlivcLivePusher.java 第 2212 行定义.
int com.alivc.live.pusher.AlivcLivePusher.setAudioEffectPublishVolume | ( | int | soundId, |
int | volume | ||
) |
设置音效推流混音音量
soundId | 用户给该音效文件分配的ID |
volume | 推流混音音量,范围是:[0, 100],默认值:50 |
在文件 AlivcLivePusher.java 第 2181 行定义.
int com.alivc.live.pusher.AlivcLivePusher.setAudioEffectReverbMode | ( | AlivcLivePushAudioEffectReverbMode | mode | ) |
int com.alivc.live.pusher.AlivcLivePusher.setAudioEffectReverbParamType | ( | AlivcLiveAudioEffectReverbParamType | audioEffectReverbParamType, |
float | value | ||
) |
设置混响音效类型
audioEffectReverbParamType | 混响音效类型 |
AlivcLivePusher#setAudioEffectReverbMode
后调用 在文件 AlivcLivePusher.java 第 2028 行定义.
int com.alivc.live.pusher.AlivcLivePusher.setAudioEffectVoiceChangeMode | ( | AlivcLivePushAudioEffectVoiceChangeMode | mode | ) |
int com.alivc.live.pusher.AlivcLivePusher.setAudioProfile | ( | AlivcLiveAudioProfileQualityMode | audioProfileQualityMode | ) |
设置音频profile
audioProfileQualityMode | 音频profile |
在文件 AlivcLivePusher.java 第 1947 行定义.
void com.alivc.live.pusher.AlivcLivePusher.setAutoFocus | ( | boolean | autoFocus | ) | throws IllegalStateException |
设置自动对焦
autoFocus | 自动聚焦 |
IllegalStateException | 如果状态不对,例如还未初始化/未startPreview |
在文件 AlivcLivePusher.java 第 384 行定义.
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 第 1016 行定义.
void com.alivc.live.pusher.AlivcLivePusher.setCaptureVolume | ( | int | volume | ) | throws IllegalStateException, IllegalArgumentException |
设置人声音量
volume | 人声音量 范围:[0 ~ 100] 默认:50 |
IllegalStateException | 状态错误 |
IllegalArgumentException | 参数错误 |
在文件 AlivcLivePusher.java 第 1031 行定义.
int com.alivc.live.pusher.AlivcLivePusher.setChannelProfile | ( | AlivcLiveChannelProfile | channelProfile | ) |
设置频道模式
channelProfile | 频道模式类型,默认INTERACTIVE_LIVE |
startPush
前调用有效,推流中不可以重新设置,stopPush
后可以重新设置 在文件 AlivcLivePusher.java 第 1932 行定义.
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 | ) |
int com.alivc.live.pusher.AlivcLivePusher.setExternalAudioStreamPlayoutVolume | ( | int | streamId, |
int | playoutVolume | ||
) |
设置外部音频流播放音量
streamId | 外部音频流Id |
playoutVolume | 播放音量,取值范围[0, 100] |
在文件 AlivcLivePusher.java 第 1509 行定义.
int com.alivc.live.pusher.AlivcLivePusher.setExternalAudioStreamPublishVolume | ( | int | streamId, |
int | publishVolume | ||
) |
设置外部音频流推流音量
streamId | 外部音频流Id |
publishVolume | 推流音量,取值范围[0, 100] |
在文件 AlivcLivePusher.java 第 1525 行定义.
void com.alivc.live.pusher.AlivcLivePusher.setExternalVideoSource | ( | boolean | enable, |
boolean | useTexture, | ||
AlivcLivePlayVideoStreamType | videoStreamType, | ||
AlivcPreviewDisplayMode | previewDisplayMode | ||
) |
启用外部视频输入源
enable | 是否开启 |
useTexture | 是否输入纹理数据 |
videoStreamType | 媒体流类型 |
previewDisplayMode | 推流预览显示模式 |
在文件 AlivcLivePusher.java 第 1429 行定义.
void com.alivc.live.pusher.AlivcLivePusher.setFlash | ( | boolean | flash | ) | throws IllegalStateException |
是否打开闪光灯
flash | true:打开闪光灯 false:关闭闪光灯 |
IllegalStateException | 如果状态不对,例如还未初始化/未startPreview |
在文件 AlivcLivePusher.java 第 491 行定义.
int com.alivc.live.pusher.AlivcLivePusher.setLiveMixTranscodingConfig | ( | AlivcLiveTranscodingConfig | config | ) |
设置云端的混流转码参数
config | 云端混流转码参数 |
com.alivc.live.pusher.AlivcLivePushInfoListener#onSetLiveMixTranscodingConfig(AlivcLivePusher, boolean, String)
在文件 AlivcLivePusher.java 第 1813 行定义.
void com.alivc.live.pusher.AlivcLivePusher.setLivePushAudioFrameListener | ( | AlivcLivePushAudioFrameListener | pushAudioFrameListener | ) |
设置音频裸数据回调
pushAudioSampleListener | 音频裸数据回调 |
在文件 AlivcLivePusher.java 第 787 行定义.
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 第 592 行定义.
int com.alivc.live.pusher.AlivcLivePusher.setMixedWithMic | ( | boolean | mixed | ) |
设置是否与麦克风采集音频混合
mixed | true->混音;false->完全替换麦克风采集数据 |
在文件 AlivcLivePusher.java 第 1461 行定义.
void com.alivc.live.pusher.AlivcLivePusher.setMute | ( | boolean | mute | ) | throws IllegalStateException |
是否开启静音
mute | true->静音推流,false->恢复音频 |
IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush |
com.alivc.live.player.AlivcLivePlayInfoListener#onAudioMuted(boolean)
com.alivc.live.pusher.AlivcLivePusher#stopAudioCapture()
在文件 AlivcLivePusher.java 第 459 行定义.
void com.alivc.live.pusher.AlivcLivePusher.setMute | ( | boolean | mute, |
AlivcLiveMuteLocalAudioMode | muteLocalAudioMode | ||
) |
是否开启静音
mute | true->静音推流,false->恢复音频 |
muteLocalAudioMode | 本地静音模式,默认 AlivcLiveMuteLocalAudioMode.DEFAULT |
com.alivc.live.player.AlivcLivePlayInfoListener#onAudioMuted(boolean)
com.alivc.live.pusher.AlivcLivePusher#stopAudioCapture()
在文件 AlivcLivePusher.java 第 477 行定义.
int com.alivc.live.pusher.AlivcLivePusher.setParameter | ( | String | parameter | ) |
设置自定义参数
parameter | 自定义参数 |
在文件 AlivcLivePusher.java 第 842 行定义.
void com.alivc.live.pusher.AlivcLivePusher.setPreviewMirror | ( | boolean | mirror | ) | throws IllegalStateException |
预览镜像开关
mirror | true:打开预览镜像 false:关闭预览镜像 |
IllegalStateException | 如果状态不对,例如还未初始化/未startPreview |
在文件 AlivcLivePusher.java 第 519 行定义.
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 第 505 行定义.
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 第 577 行定义.
void com.alivc.live.pusher.AlivcLivePusher.setVideoConfig | ( | AlivcLivePushVideoConfig | videoConfig | ) |
int com.alivc.live.pusher.AlivcLivePusher.setVideoMirrorMode | ( | AlivcLiveVideoMirrorMode | mirrorMode | ) |
设置预览和推流镜像能力
mirrorMode | 镜像模式 |
在文件 AlivcLivePusher.java 第 535 行定义.
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 第 414 行定义.
void com.alivc.live.pusher.AlivcLivePusher.snapshot | ( | int | count, |
int | interval, | ||
AlivcSnapshotListener | listener | ||
) |
视频流截图
count | 截取图片的个数,该参数仅在基础模式下生效 |
interval | 每张图片的间隔,该参数仅在基础模式下生效 |
listener | 截图回调 |
在文件 AlivcLivePusher.java 第 1412 行定义.
int com.alivc.live.pusher.AlivcLivePusher.startAudioCapture | ( | boolean | keepAlive | ) |
开启音频采集
keepAlive | true->停止推流后采集依然开启,false->停止推流后采集关闭 |
com.alivc.live.pusher.AlivcLivePusher#stopAudioCapture()
com.alivc.live.pusher.AlivcLivePusher#setMute(boolean)
在文件 AlivcLivePusher.java 第 1869 行定义.
int com.alivc.live.pusher.AlivcLivePusher.startBGMAsync | ( | String | path | ) | throws IllegalStateException |
播放背景音乐
path | 背景音乐路径 |
IllegalStateException | 状态错误 |
在文件 AlivcLivePusher.java 第 887 行定义.
int com.alivc.live.pusher.AlivcLivePusher.startBGMAsync | ( | String | path, |
AlivcLiveBGMConfig | bgmConfig | ||
) |
播放背景音乐
path | 背景音乐路径 |
bgmConfig | 设置BGM背景音乐的配置 |
在文件 AlivcLivePusher.java 第 904 行定义.
int com.alivc.live.pusher.AlivcLivePusher.startCamera | ( | SurfaceView | surfaceView | ) | throws IllegalStateException |
录屏模式下,开启摄像头预览 如果不需要预览,则surfaceView填为null
surfaceView | surfaceView |
在文件 AlivcLivePusher.java 第 1249 行定义.
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 第 1290 行定义.
int com.alivc.live.pusher.AlivcLivePusher.startIntelligentDenoise | ( | ) |
开启音频智能降噪
在文件 AlivcLivePusher.java 第 1070 行定义.
int com.alivc.live.pusher.AlivcLivePusher.startLastMileDetect | ( | AlivcLiveNetworkQualityProbeConfig | networkQualityProbeConfig | ) |
开始网络质量探测
networkQualityProbeConfig | 网络探测配置 |
AlivcLivePushNetworkListener#onLastMileDetectResultWithQuality(AlivcLivePusher, AlivcLiveNetworkQuality)
中回调 AlivcLivePushNetworkListener#onLastMileDetectResultWithBandWidth(AlivcLivePusher, int, AlivcLiveNetworkQualityProbeResult)
中回调 在文件 AlivcLivePusher.java 第 2333 行定义.
int com.alivc.live.pusher.AlivcLivePusher.startLocalDualAudioStream | ( | ) |
开启第二路音频流推送
AlivcLivePusher#addExternalAudioStream(AlivcLivePushExternalAudioStreamConfig)
添加音频数据源; AlivcLivePushExternalAudioStreamConfig#publishStream
需要传1 AlivcLivePusher#pushExternalAudioStream(int, AlivcLivePushAudioFrame)
向第二路音频通道输入音频数据 AlivcLivePusher#stopLocalDualAudioStream()
在文件 AlivcLivePusher.java 第 1382 行定义.
boolean com.alivc.live.pusher.AlivcLivePusher.startLocalRecord | ( | AlivcLiveLocalRecordConfig | localRecordConfig | ) |
开启本地音视频流录制
localRecordConfig | 本地录制配置 |
AlivcLivePushInfoListener#onLocalRecordEvent(AlivcLiveRecordMediaEvent, String)
在文件 AlivcLivePusher.java 第 1319 行定义.
void com.alivc.live.pusher.AlivcLivePusher.startPreview | ( | Context | context, |
FrameLayout | frameLayout, | ||
boolean | isFullScreen | ||
) | throws IllegalArgumentException, IllegalStateException |
开始预览(仅用于互动模式)
context | android context |
frameLayout | FrameLayout容器;渲染视图由SDK内部创建,并addView到容器中 |
isFullScreen | 渲染视图是否全屏;如果渲染视图全屏,该视图需要放在最下层级进行全屏展示,避免遮挡其它小窗渲染视图 |
IllegalArgumentException | 参数错误 |
IllegalStateException | 状态错误 |
com.alivc.live.pusher.AlivcLivePushInfoListener#onPreviewStarted(AlivcLivePusher)
com.alivc.live.pusher.AlivcLivePushInfoListener#onFirstFramePreviewed(AlivcLivePusher)
com.alivc.live.pusher.AlivcLivePusher#stopPreview()
com.alivc.live.pusher.AlivcLivePusher#updatePreview(Context, FrameLayout, boolean)
com.alivc.live.pusher.AlivcLivePushConfig#setPreviewDisplayMode(com.alivc.live.pusher.AlivcPreviewDisplayMode)
在文件 AlivcLivePusher.java 第 181 行定义.
void com.alivc.live.pusher.AlivcLivePusher.startPreview | ( | SurfaceView | surfaceView | ) | throws IllegalArgumentException, IllegalStateException |
开始预览(仅用于基础模式)
surfaceView | surfaceView |
IllegalArgumentException | 如果surfaceView为空,或者surfaceView的surface未创建/已销毁 |
IllegalStateException | 如果状态不对,例如还未初始化 |
com.alivc.live.pusher.AlivcLivePushInfoListener#onPreviewStarted(AlivcLivePusher)
com.alivc.live.pusher.AlivcLivePushInfoListener#onFirstFramePreviewed(AlivcLivePusher)
com.alivc.live.pusher.AlivcLivePusher#stopPreview()
com.alivc.live.pusher.AlivcLivePushConfig#setPreviewDisplayMode(com.alivc.live.pusher.AlivcPreviewDisplayMode)
在文件 AlivcLivePusher.java 第 137 行定义.
void com.alivc.live.pusher.AlivcLivePusher.startPreviewAsync | ( | SurfaceView | surfaceView | ) | throws IllegalArgumentException, IllegalStateException |
异步开始预览(仅用于基础模式)
surfaceView | surfaceView |
IllegalArgumentException | 如果surfaceView为空,或者surfaceView的surface未创建/已销毁 |
IllegalStateException | 如果状态不对,例如还未初始化 |
com.alivc.live.pusher.AlivcLivePushInfoListener#onPreviewStarted(AlivcLivePusher)
com.alivc.live.pusher.AlivcLivePushInfoListener#onFirstFramePreviewed(AlivcLivePusher)
com.alivc.live.pusher.AlivcLivePusher#stopPreview()
com.alivc.live.pusher.AlivcLivePushConfig#setPreviewDisplayMode(com.alivc.live.pusher.AlivcPreviewDisplayMode)
在文件 AlivcLivePusher.java 第 157 行定义.
void com.alivc.live.pusher.AlivcLivePusher.startPush | ( | String | url | ) | throws IllegalArgumentException, IllegalStateException |
开始推流
url | 推流Url |
IllegalArgumentException | 如果url为空,或者不是有效的url格式 |
IllegalStateException | 如果状态不对,例如还未初始化/未startPreview |
com.alivc.live.pusher.AlivcLivePushInfoListener#onPushStarted(AlivcLivePusher)
com.alivc.live.pusher.AlivcLivePushInfoListener#onFirstFramePushed(AlivcLivePusher)
com.alivc.live.pusher.AlivcLivePusher#stopPush()
在文件 AlivcLivePusher.java 第 232 行定义.
void com.alivc.live.pusher.AlivcLivePusher.startPushAsync | ( | String | url | ) | throws IllegalArgumentException, IllegalStateException |
开始异步推流
url | 推流Url |
IllegalArgumentException | 如果url为空,或者不是有效的url格式 |
IllegalStateException | 如果状态不对,例如还未初始化/未startPreview |
com.alivc.live.pusher.AlivcLivePushInfoListener#onPushStarted(AlivcLivePusher)
com.alivc.live.pusher.AlivcLivePushInfoListener#onFirstFramePushed(AlivcLivePusher)
com.alivc.live.pusher.AlivcLivePusher#stopPush()
在文件 AlivcLivePusher.java 第 250 行定义.
int com.alivc.live.pusher.AlivcLivePusher.startScreenShare | ( | ) |
启动屏幕分享
com.alivc.live.pusher.AlivcLivePushInfoListener#onScreenSharePublishStateChanged(AlivcLivePublishState, AlivcLivePublishState)
在文件 AlivcLivePusher.java 第 1350 行定义.
int com.alivc.live.pusher.AlivcLivePusher.stopAllAudioEffects | ( | ) |
int com.alivc.live.pusher.AlivcLivePusher.stopAudioCapture | ( | ) |
关闭音频采集
com.alivc.live.pusher.AlivcLivePusher#startAudioCapture(boolean)
com.alivc.live.pusher.AlivcLivePusher#setMute(boolean)
在文件 AlivcLivePusher.java 第 1887 行定义.
int com.alivc.live.pusher.AlivcLivePusher.stopAudioEffect | ( | int | soundId | ) |
停止播放音效
soundId | 用户给该音效文件分配的ID |
在文件 AlivcLivePusher.java 第 2151 行定义.
void com.alivc.live.pusher.AlivcLivePusher.stopBGMAsync | ( | ) | throws IllegalStateException |
void com.alivc.live.pusher.AlivcLivePusher.stopCamera | ( | ) |
录屏模式下,关闭摄像头预览
在文件 AlivcLivePusher.java 第 1260 行定义.
void com.alivc.live.pusher.AlivcLivePusher.stopCameraMix | ( | ) |
录屏模式下,停止摄像头混流
在文件 AlivcLivePusher.java 第 1301 行定义.
int com.alivc.live.pusher.AlivcLivePusher.stopIntelligentDenoise | ( | ) |
int com.alivc.live.pusher.AlivcLivePusher.stopLastMileDetect | ( | ) |
int com.alivc.live.pusher.AlivcLivePusher.stopLocalDualAudioStream | ( | ) |
停止第二路音频流推送
AlivcLivePusher#startLocalDualAudioStream()
在文件 AlivcLivePusher.java 第 1397 行定义.
void com.alivc.live.pusher.AlivcLivePusher.stopLocalRecord | ( | ) |
停止本地音视频流录制
AlivcLivePushInfoListener#onLocalRecordEvent(AlivcLiveRecordMediaEvent, String)
在文件 AlivcLivePusher.java 第 1335 行定义.
void com.alivc.live.pusher.AlivcLivePusher.stopPreview | ( | ) | throws IllegalStateException |
void com.alivc.live.pusher.AlivcLivePusher.stopPush | ( | ) | throws IllegalStateException |
结束推流
IllegalStateException | 如果状态不对,例如还未初始化/未startPreview/未startPush/已经stopPush |
在文件 AlivcLivePusher.java 第 310 行定义.
int com.alivc.live.pusher.AlivcLivePusher.stopScreenShare | ( | ) |
void com.alivc.live.pusher.AlivcLivePusher.switchCamera | ( | ) | throws IllegalStateException |
int com.alivc.live.pusher.AlivcLivePusher.unloadAudioEffect | ( | int | soundId | ) |
删除预加载的音效文件
soundId | 用户给该音效文件分配的ID |
在文件 AlivcLivePusher.java 第 2118 行定义.
void com.alivc.live.pusher.AlivcLivePusher.updatePreview | ( | Context | context, |
FrameLayout | frameLayout, | ||
boolean | isFullScreen | ||
) |
更新预览视图(仅用于互动模式)
context | android context |
frameLayout | FrameLayout容器;渲染视图由SDK内部创建,并addView到容器中 |
isFullScreen | 渲染视图是否全屏;如果渲染视图全屏,该视图需要放在最下层级进行全屏展示,避免遮挡其它小窗渲染视图 |
在文件 AlivcLivePusher.java 第 198 行定义.