AliVCSDK 6.17.0
阿里云音视频SDK,为视频开发者提供一站式接入服务
 
Loading...
Searching...
No Matches
com.alivc.live.pusher.AlivcLivePusher Class Reference

「Main API」 Live pusher abstract class More...

Inheritance diagram for com.alivc.live.pusher.AlivcLivePusher:

Public Member Functions

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 ()
 

Detailed Description

「Main API」 Live pusher abstract class

Author
aliyun live push sdk
Date
2017/10/8
Attention
Please use 'AlivcRTC' as the log tag for autonomous troubleshooting when using interactive mode.
See also
AliLive Push SDK Doc
Interactive streaming
Integrate a Push SDK license
Live Console Guide
Note
Customers need to declare and apply for READ_PHONE_STATE permission, otherwise, the mute feature will not be effective automatically when answering calls!

Definition at line 42 of file AlivcLivePusher.java.

Member Function Documentation

◆ addDynamicsAddons()

int com.alivc.live.pusher.AlivcLivePusher.addDynamicsAddons ( String  path,
float  x,
float  y,
float  w,
float  h 
)

add dynamic addons

Parameters
pathdynamic addons path, contains 'config.json'
xx Position(0~1.0f)
yy Position(0~1.0f)
wwidth(0~1.0f)
hheight(0~1.0f)
Returns
id dynamic addons id
Warning
Please store the files in an accessible SD card directory for the application, avoiding placing them directly in the root directory of the SD card. If the function fails, please check if the path exists and if the application has permission to read the SD card path.

Definition at line 1636 of file AlivcLivePusher.java.

◆ addExternalAudioStream()

int com.alivc.live.pusher.AlivcLivePusher.addExternalAudioStream ( AlivcLivePushExternalAudioStreamConfig  externalAudioStreamConfig)

Add external audio stream

Parameters
externalAudioStreamConfigExternal audio stream configuration
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.

Definition at line 1473 of file AlivcLivePusher.java.

◆ addWaterMark() [1/2]

void com.alivc.live.pusher.AlivcLivePusher.addWaterMark ( Bitmap  bitmap,
float  x,
float  y,
float  width 
)

add water mark, start position: x[0, width) y[0, height) w(0, width]

Parameters
bitmapwater mark bitmap (type: rgba)
xthe relative position of the x-axis position at the upper left corner of the watermark is 0-1
ythe relative position of the y-axis at the upper right corner of the watermark is 0-1
widththe relative position of watermark display width 0~1
Attention
This API is only supported in the interactive mode currently, and calls have no effect.
Note
Before calling this interface, please ensure that com.alivc.live.pusher.AlivcLivePushInfoListener#onPreviewStarted(AlivcLivePusher) has been called
Max count is 3, if the count exceeds, it will use the latest.

Definition at line 1218 of file AlivcLivePusher.java.

◆ addWaterMark() [2/2]

void com.alivc.live.pusher.AlivcLivePusher.addWaterMark ( String  path,
float  x,
float  y,
float  width 
)

add water mark, start position: x[0,width) y[0,height) w(0,width], max count is 3

Parameters
pathwater mark path
xthe relative position of the x-axis position at the upper left corner of the watermark is 0-1
ythe relative position of the y-axis at the upper right corner of the watermark is 0-1
widththe relative position of watermark display width 0~1
Note
Before calling this interface, please ensure that com.alivc.live.pusher.AlivcLivePushInfoListener#onPreviewStarted(AlivcLivePusher) has been called
Warning
Please store the files in an accessible SD card directory for the application, avoiding placing them directly in the root directory of the SD card. If the function fails, please check if the path exists and if the application has permission to read the SD card path.

Definition at line 1199 of file AlivcLivePusher.java.

◆ changeResolution()

void com.alivc.live.pusher.AlivcLivePusher.changeResolution ( AlivcResolutionEnum  resolution)

change resolution dynamically

Parameters
resolutionresolution
Note
Can use the interface AlivcLivePusher#setVideoConfig(AlivcLivePushVideoConfig) instead
Setting resolution before pushing, please refer to the interface: AlivcLivePushConfig#setResolution(AlivcResolutionEnum)
Updating resolution during pushing, please refer to the interface: AlivcLivePusher#changeResolution(AlivcResolutionEnum)
After changing resolution, the SDK will automatically reset the initial bitrate, target bitrate, and min bitrate of the streaming based on the streaming resolution to the default values corresponding to that resolution
If you need to specify the target bitrate, and min bitrate, please call the interface after changing resolution: AlivcLivePusher#setTargetVideoBitrate(int)AlivcLivePusher#setMinVideoBitrate(int)
In the interactive mode, this interface corresponds to the callback: com.alivc.live.player.AlivcLivePlayInfoListener#onVideoResolutionChanged(int, int)

Definition at line 1181 of file AlivcLivePusher.java.

◆ destroy()

void com.alivc.live.pusher.AlivcLivePusher.destroy ( ) throws IllegalStateException

destroy pusher

Exceptions
IllegalStateExceptionIf the status is invalid, such as not yet initialized
Note
init, corresponding to the interface: com.alivc.live.pusher.AlivcLivePusher#init(Context, AlivcLivePushConfig)

Definition at line 97 of file AlivcLivePusher.java.

◆ enableAudioFrameObserver()

int com.alivc.live.pusher.AlivcLivePusher.enableAudioFrameObserver ( boolean  enable,
AlivcLiveAudioSource  audioSource,
AlivcLiveAudioFrameObserverConfig  config 
)

Set audio raw data callback parameters

Parameters
enableAllow audio data callback
audioSourceCallback data source type
configCallback parameter settings
Returns
true->success, false->failed
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.
Note
After calling this interface, the vad function will be enabled, and the following callback will take effect:
See also
com.alivc.live.pusher.AlivcLivePushAudioFrameListener
com.alivc.live.player.AlivcLivePlayInfoListener::onAudioFrame(AlivcLivePushAudioFrame)

Definition at line 2083 of file AlivcLivePusher.java.

◆ enableAudioVolumeIndication()

int com.alivc.live.pusher.AlivcLivePusher.enableAudioVolumeIndication ( int  interval,
int  smooth,
int  reportVad 
)

Set the volume callback frequency and smoothing coefficient

Parameters
intervalTime interval, unit: ms, default value: 300ms; Value range: The minimum value is ≥ 10ms, and it is recommended to set it to 300ms~500ms; A value of ≤ 0 indicates that the volume prompt and speaker prompt functions are not enabled.
smoothThe smoothing coefficient, the higher the numerical value, the higher the smoothness, and the lower the inverse value, the better the real-time performance. Default value: 3; Value range: 0-9, recommended to be set to 3.
reportVadLocal voice detection switch. 1: Enable and call back through the AlivcLivePushInfoListener#onMicrophoneVolumeUpdate(AlivcLivePusher, int) interface; 0 (default): Off.
Returns
0 -> success,not 0 -> failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.
Note
After calling this interface, the vad function will be enabled, and the following callback will take effect:
See also
com.alivc.live.pusher.AlivcLivePushInfoListener::onMicrophoneVolumeUpdate(com.alivc.live.pusher.AlivcLivePusher, int)
com.alivc.live.player.AlivcLivePlayInfoListener::onPlayoutVolumeUpdate(int, boolean)

Definition at line 2063 of file AlivcLivePusher.java.

◆ enableLocalCamera()

int com.alivc.live.pusher.AlivcLivePusher.enableLocalCamera ( boolean  enable)

Disable or enable local video capture

Parameters
enableTrue ->Enable video capture, false ->Turn off video capture
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.
Note
In the interactive mode, this interface corresponds to the callback: com.alivc.live.player.AlivcLivePlayInfoListener#onVideoEnabled(boolean)
Call this interface to turn off video capture, no longer occupy system camera permissions, and no longer send video data
If you only need to turn off the camera without turning off video capture, please refer to the following interface: com.alivc.live.pusher.AlivcLivePusher#muteLocalCamera(boolean)

Definition at line 1848 of file AlivcLivePusher.java.

◆ enableSEIVideoStream()

int com.alivc.live.pusher.AlivcLivePusher.enableSEIVideoStream ( boolean  enable)

Enable SEI video streaming

Parameters
enableturn on or off
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.
Note
In interactive mode, if AlivcLivePusher#enableLocalCamera(boolean) is called to turn off camera capture, the video will not be sent by default;
If the AlivcLivePusher#sendMessage(String, int, int, boolean) interface is subsequently called to send SEI information, the SDK will default to sending 16x16 all black image streams/20fps video streams to carry SEI information;
You can disable the SDK's default logic for pushing 16x16 all black images by calling the current interface; After shutdown, the pure audio scene will no longer send video streams and SEI information

Definition at line 1719 of file AlivcLivePusher.java.

◆ enableSpeakerphone()

int com.alivc.live.pusher.AlivcLivePusher.enableSpeakerphone ( boolean  enable)

Set current audio device output

Parameters
enabletrue:speakerphone(as default);false:earphone
Returns
0 -> success,<0 -> failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.

Definition at line 1899 of file AlivcLivePusher.java.

◆ focusCameraAtAdjustedPoint()

void com.alivc.live.pusher.AlivcLivePusher.focusCameraAtAdjustedPoint ( float  x,
float  y,
boolean  autoFocus 
) throws IllegalArgumentException, IllegalStateException

change camera focus at adjusted point

Parameters
xx position
yy position
autoFocusauto focus
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview

Definition at line 394 of file AlivcLivePusher.java.

◆ getAudioEffectPlayoutVolume()

int com.alivc.live.pusher.AlivcLivePusher.getAudioEffectPlayoutVolume ( int  soundId)

Get local playback volume for audio effects

Parameters
soundIdThe ID assigned by the user to the audio effect file
Returns
Local playback volume for audio effects, range: [0, 100], default value: 50
Attention
This API is only supported in the interactive mode currently, and calls have no effect.

Definition at line 2224 of file AlivcLivePusher.java.

◆ getAudioEffectPublishVolume()

int com.alivc.live.pusher.AlivcLivePusher.getAudioEffectPublishVolume ( int  soundId)

Get audio effect streaming mix volume

Parameters
soundIdThe ID assigned by the user to the audio effect file
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.

Definition at line 2193 of file AlivcLivePusher.java.

◆ getBGMCurrentPosition()

int com.alivc.live.pusher.AlivcLivePusher.getBGMCurrentPosition ( )

Get the playback progress of the BGM file

Returns
BGM file playback progress
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.
Note
Unit: milliseconds; Return>=0: BGM file playback progress; Return<0: Error code

Definition at line 944 of file AlivcLivePusher.java.

◆ getBGMDuration()

int com.alivc.live.pusher.AlivcLivePusher.getBGMDuration ( )

Get BGM file duration

Returns
BGM file duration
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.
Note
Unit: milliseconds; Return>=0: BGM file duration; Return<0: Error code

Definition at line 929 of file AlivcLivePusher.java.

◆ getCurrentEncoderManufacturer()

AlivcLiveVideoCodecManufacturer com.alivc.live.pusher.AlivcLivePusher.getCurrentEncoderManufacturer ( boolean  isCameraStream)

Obtain the currently used codec type, if streaming has not started, return an invalid type

Parameters
isCameraStreamtrue->Obtain the encoder type of the camera stream; false ->Obtain the encoder type for the shared stream
Returns
codec type
Note
The API is not supported in the basic mode currently, and calls have no effect.

Definition at line 2359 of file AlivcLivePusher.java.

◆ getCurrentExposure()

int com.alivc.live.pusher.AlivcLivePusher.getCurrentExposure ( )

Get current exposure

Returns
current exposure

Definition at line 1675 of file AlivcLivePusher.java.

◆ getCurrentStatus()

AlivcLivePushStats com.alivc.live.pusher.AlivcLivePusher.getCurrentStatus ( )

get current status

Returns
current status
Attention
This API is only supported in the basic mode currently, otherwise it will have no effect.

Definition at line 712 of file AlivcLivePusher.java.

◆ getCurrentZoom()

int com.alivc.live.pusher.AlivcLivePusher.getCurrentZoom ( ) throws IllegalStateException

Get current zoom

Returns
current zoom
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview

Definition at line 436 of file AlivcLivePusher.java.

◆ getLastError()

AlivcLivePushError com.alivc.live.pusher.AlivcLivePusher.getLastError ( )

get last error

Returns
last error

Definition at line 1162 of file AlivcLivePusher.java.

◆ getLivePushStatsInfo()

AlivcLivePushStatsInfo com.alivc.live.pusher.AlivcLivePusher.getLivePushStatsInfo ( ) throws IllegalStateException

get live push stats info

Returns
live push stats info
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized

Definition at line 811 of file AlivcLivePusher.java.

◆ getLiveTraceId()

String com.alivc.live.pusher.AlivcLivePusher.getLiveTraceId ( )

Get live trace id

Returns
trace id
Attention
This API is only supported in the basic mode currently. The call returns an empty string.

Definition at line 2373 of file AlivcLivePusher.java.

◆ getMaxZoom()

int com.alivc.live.pusher.AlivcLivePusher.getMaxZoom ( ) throws IllegalStateException

Get max zoom of camera

Returns
max zoom
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview

Definition at line 422 of file AlivcLivePusher.java.

◆ getParameter()

String com.alivc.live.pusher.AlivcLivePusher.getParameter ( String  parameter)

Get parameter

Parameters
parameterparameter
Returns
parameter
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.

Definition at line 854 of file AlivcLivePusher.java.

◆ getPushUrl()

String com.alivc.live.pusher.AlivcLivePusher.getPushUrl ( )

get push url

Returns
push url

Definition at line 824 of file AlivcLivePusher.java.

◆ getSupportedMaxExposure()

int com.alivc.live.pusher.AlivcLivePusher.getSupportedMaxExposure ( )

Get max supported exposure

Returns
max supported exposure

Definition at line 1701 of file AlivcLivePusher.java.

◆ getSupportedMinExposure()

int com.alivc.live.pusher.AlivcLivePusher.getSupportedMinExposure ( )

Get min supported exposure

Returns
min supported exposure

Definition at line 1688 of file AlivcLivePusher.java.

◆ getVideoCodecType()

AlivcEncodeType com.alivc.live.pusher.AlivcLivePusher.getVideoCodecType ( )

Get the current video encoding format

Returns
current video encoding format
See also
com.alivc.live.pusher.AlivcEncodeType

Definition at line 1149 of file AlivcLivePusher.java.

◆ getVideoConfig()

AlivcLivePushVideoConfig com.alivc.live.pusher.AlivcLivePusher.getVideoConfig ( )

Get video configuration

Returns
video configuration
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.

Definition at line 556 of file AlivcLivePusher.java.

◆ init()

void com.alivc.live.pusher.AlivcLivePusher.init ( Context  context,
AlivcLivePushConfig  config 
) throws IllegalArgumentException, IllegalStateException

Initialize pusher

Parameters
contextandroid context
configpush config
Exceptions
IllegalArgumentExceptionIf config is null or the value of config is invalid (for example, the bitrate value exceeds the range)
IllegalStateExceptionIf the status is invalid, for example, it has been initialized but has not been destroyed
Note
destroy, corresponding to the interface: com.alivc.live.pusher.AlivcLivePusher#destroy()

Definition at line 58 of file AlivcLivePusher.java.

◆ inputStreamAudioData()

void com.alivc.live.pusher.AlivcLivePusher.inputStreamAudioData ( byte[]  data,
int  size,
int  sampleRate,
int  channels,
long  pts 
)

input external audio stream data

Parameters
dataaudio data byte array
sizeaudio size
sampleRateaudio sample rate
channelsaudio channels
ptsaudio data pts(US)
Note
Before calling, it is necessary to configure AlivcLivePushConfig::setExternMainStream to enable an external custom input stream before it can take effect

Definition at line 1617 of file AlivcLivePusher.java.

◆ inputStreamAudioPtr()

void com.alivc.live.pusher.AlivcLivePusher.inputStreamAudioPtr ( long  dataPtr,
int  size,
int  sampleRate,
int  channels,
long  pts 
)

input external audio stream data (deprecated)

Parameters
dataPtraudio data ptr
sizeaudio size
sampleRateaudio sample rate
channelsaudio channels
ptsaudio data pts(US)
Note
Before calling, it is necessary to configure AlivcLivePushConfig::setExternMainStream to enable an external custom input stream before it can take effect
Attention
This API is deprecated, use AlivcLivePusher#inputStreamAudioData(byte[], int, int, int, long) instead

Definition at line 1599 of file AlivcLivePusher.java.

◆ inputStreamVideoData()

void com.alivc.live.pusher.AlivcLivePusher.inputStreamVideoData ( byte[]  data,
int  width,
int  height,
int  stride,
int  size,
long  pts,
int  rotation 
)

input external video stream data

Parameters
datavideo image byte array
widthvideo image width
heightvideo image height
stridevideo image stride
sizevideo image size
ptsvideo image pts(us)
rotationvideo image rotation
Note
Before calling, it is necessary to configure AlivcLivePushConfig::setExternMainStream to enable an external custom input stream before it can take effect

Definition at line 1579 of file AlivcLivePusher.java.

◆ inputStreamVideoPtr()

void com.alivc.live.pusher.AlivcLivePusher.inputStreamVideoPtr ( long  dataPtr,
int  width,
int  height,
int  stride,
int  size,
long  pts,
int  rotation 
)

input external video stream data (deprecated)

Parameters
dataPtrvideo image data ptr
widthvideo image width
heightvideo image height
stridevideo image stride
sizevideo image size
ptsvideo image pts(us)
rotationvideo image rotation
Note
Before calling, it is necessary to configure AlivcLivePushConfig::setExternMainStream to enable an external custom input stream before it can take effect
Attention
This API is deprecated, use AlivcLivePusher#inputStreamVideoData(byte[], int, int, int, int, long, int) instead

Definition at line 1559 of file AlivcLivePusher.java.

◆ isCameraSupportAutoFocus()

boolean com.alivc.live.pusher.AlivcLivePusher.isCameraSupportAutoFocus ( )

if camera support auto focus

Returns
camera auto focus

Definition at line 618 of file AlivcLivePusher.java.

◆ isCameraSupportFlash()

boolean com.alivc.live.pusher.AlivcLivePusher.isCameraSupportFlash ( )

if camera support flash

Returns
camera flash

Definition at line 631 of file AlivcLivePusher.java.

◆ isNetworkPushing()

boolean com.alivc.live.pusher.AlivcLivePusher.isNetworkPushing ( ) throws IllegalStateException

is network pushing

Returns
network pushing
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPush

Definition at line 659 of file AlivcLivePusher.java.

◆ isPushing()

boolean com.alivc.live.pusher.AlivcLivePusher.isPushing ( ) throws IllegalStateException

is pushing

Returns
true:pushing false:not push
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPush

Definition at line 645 of file AlivcLivePusher.java.

◆ isSpeakerphoneOn()

boolean com.alivc.live.pusher.AlivcLivePusher.isSpeakerphoneOn ( )

Get current audio device output

Returns
true->speakerphone,false->earphone
Attention
This API is only supported in the interactive mode currently, and calls have no effect.

Definition at line 1913 of file AlivcLivePusher.java.

◆ muteLocalCamera()

int com.alivc.live.pusher.AlivcLivePusher.muteLocalCamera ( boolean  mute)

mute local camera

Parameters
mutetrue->do not send video frames, false->resume to normal
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.
Note
In the interactive mode, this interface corresponds to the callback: com.alivc.live.player.AlivcLivePlayInfoListener#onVideoMuted(boolean)
If currently called the interface com.alivc.live.pusher.AlivcLivePushConfig#setPausePushImage(String) , preview is normal, and subscriber will show pause image;
If currently not called the interface com.alivc.live.pusher.AlivcLivePushConfig#setPausePushImage(String) , preview is normal, and subscriber will show black screen;
Calling this interface, the capture, encoding, and sending modules are still working, still occupying system camera permissions, and sending video black frames
If you want to no longer occupy system camera permissions, that is, turn off video capture, please refer to the interface: com.alivc.live.pusher.AlivcLivePusher#enableLocalCamera(boolean)

Definition at line 1830 of file AlivcLivePusher.java.

◆ pause()

void com.alivc.live.pusher.AlivcLivePusher.pause ( ) throws IllegalStateException

pause push

Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush/pause
Note
Before calling, it is necessary to configure AlivcLivePushConfig#setPausePushImage(String) to set pause push image path before it can take effect
This interface corresponds to the callback: com.alivc.live.pusher.AlivcLivePushInfoListener#onPushPaused(AlivcLivePusher)
resume, corresponding to the interface: com.alivc.live.pusher.AlivcLivePusher#resume()
resume, corresponding to the interface: com.alivc.live.pusher.AlivcLivePusher#resumeAsync()

Definition at line 321 of file AlivcLivePusher.java.

◆ pauseAllAudioEffects()

int com.alivc.live.pusher.AlivcLivePusher.pauseAllAudioEffects ( )

Pause all audio effects

Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.

Definition at line 2283 of file AlivcLivePusher.java.

◆ pauseAudioEffect()

int com.alivc.live.pusher.AlivcLivePusher.pauseAudioEffect ( int  soundId)

Pause audio effect

Parameters
soundIdThe ID assigned by the user to the audio effect file
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.

Definition at line 2269 of file AlivcLivePusher.java.

◆ pauseBGM()

void com.alivc.live.pusher.AlivcLivePusher.pauseBGM ( ) throws IllegalStateException

pause BGM

Exceptions
IllegalStateExceptioninvalid status

Definition at line 957 of file AlivcLivePusher.java.

◆ pauseScreenCapture()

void com.alivc.live.pusher.AlivcLivePusher.pauseScreenCapture ( ) throws IllegalStateException

pause screen capture(Open privacy settings)

Exceptions
IllegalStateExceptionIf the status is invalid, such as not Initialized/not startPreview/not startPush/pause

Definition at line 1122 of file AlivcLivePusher.java.

◆ playAudioEffect()

int com.alivc.live.pusher.AlivcLivePusher.playAudioEffect ( int  soundId,
String  filePath,
AlivcLiveAudioEffectConfig  config 
)

Start playing audio effects

Parameters
soundIdThe ID assigned by the user to the audio effect file
filePathaudio effect file path, supports local files and network urls
configaudio effect playback configuration
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.
Warning
Please store the files in an accessible SD card directory for the application, avoiding placing them directly in the root directory of the SD card. If the function fails, please check if the path exists and if the application has permission to read the SD card path.

Definition at line 2133 of file AlivcLivePusher.java.

◆ preloadAudioEffect()

int com.alivc.live.pusher.AlivcLivePusher.preloadAudioEffect ( int  soundId,
String  filePath 
)

Preload audio effect files

Parameters
soundIdThe ID assigned by the user to the audio effect file
filePathaudio effect file path, supports local files and network urls
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.
Warning
Please store the files in an accessible SD card directory for the application, avoiding placing them directly in the root directory of the SD card. If the function fails, please check if the path exists and if the application has permission to read the SD card path.

Definition at line 2100 of file AlivcLivePusher.java.

◆ pushExternalAudioStream()

int com.alivc.live.pusher.AlivcLivePusher.pushExternalAudioStream ( int  streamId,
AlivcLivePushAudioFrame  audioFrame 
)

Input external audio stream data

Parameters
streamIdexternal audio stream id
audioFrameexternal audio stream data
Returns
0->success, < 0->failed
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.
Note
To ensure voice continuity, there will be a buffer inside the SDK to cache the audio data sent in. Taking 10ms of data sent each time as an example, if it returns 0x01070101, it indicates that the internal buffer is full. It is recommended to wait for 20ms before resending the current data frame

Definition at line 1490 of file AlivcLivePusher.java.

◆ pushExternalVideoFrame()

int com.alivc.live.pusher.AlivcLivePusher.pushExternalVideoFrame ( AlivcLivePusherRawDataSample  rawDataSample,
AlivcLivePlayVideoStreamType  videoStreamType 
)

Input external video stream data

Parameters
rawDataSampleraw video stream data
videoStreamTypevideo stream type
Returns
0->success, < 0->failed
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.
Note
If the return value is 0x01070102, it means that the current buffer queue is full and needs to wait before continuing to transmit data.

Definition at line 1443 of file AlivcLivePusher.java.

◆ reconnectPushAsync()

void com.alivc.live.pusher.AlivcLivePusher.reconnectPushAsync ( String  url) throws IllegalStateException

reconnect push async

Parameters
urlpush url
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush/stopPush
Note
Determine whether the push stream is successful, corresponds to the callback: com.alivc.live.pusher.AlivcLivePushInfoListener#onFirstFramePushed(AlivcLivePusher)

Definition at line 291 of file AlivcLivePusher.java.

◆ refreshPushURLToken()

void com.alivc.live.pusher.AlivcLivePusher.refreshPushURLToken ( String  url)

Refresh the authentication information, pass in a new streaming URL with new token that has not expired, and the room ID/user ID/sdkAppId need to be the same as before

Parameters
urlpush url
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.
Note
This method is used to update the token information in the push URL of the authentication information,
mainly to prevent the authentication from expiring and causing the push to fail.
When we receive the callback AlivcLivePushNetworkListener#onPushURLAuthenticationOverdue(AlivcLivePusher), the application should update the authentication information
Otherwise, it will cause streaming disconnect.

Definition at line 605 of file AlivcLivePusher.java.

◆ removeDynamicsAddons()

void com.alivc.live.pusher.AlivcLivePusher.removeDynamicsAddons ( int  id)

remove dynamic addons

Parameters
iddynamic addons id

Definition at line 1649 of file AlivcLivePusher.java.

◆ removeExternalAudioStream()

int com.alivc.live.pusher.AlivcLivePusher.removeExternalAudioStream ( int  streamId)

Remove external audio stream

Parameters
streamIdexternal audio stream id
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.

Definition at line 1537 of file AlivcLivePusher.java.

◆ restartPush()

void com.alivc.live.pusher.AlivcLivePusher.restartPush ( ) throws IllegalStateException

restart push

Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush/stopPush
Note
This interface corresponds to the callback: com.alivc.live.pusher.AlivcLivePushInfoListener#onPushRestarted(AlivcLivePusher)
Determine whether the push stream is successful, corresponds to the callback: com.alivc.live.pusher.AlivcLivePushInfoListener#onFirstFramePushed(AlivcLivePusher)
stopPush, corresponding to the interface: com.alivc.live.pusher.AlivcLivePusher#stopPush()

Definition at line 260 of file AlivcLivePusher.java.

◆ restartPushAsync()

void com.alivc.live.pusher.AlivcLivePusher.restartPushAsync ( ) throws IllegalStateException

restart push async

Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush/stopPush
Note
This interface corresponds to the callback: com.alivc.live.pusher.AlivcLivePushInfoListener#onPushRestarted(AlivcLivePusher)
Determine whether the push stream is successful, corresponds to the callback: com.alivc.live.pusher.AlivcLivePushInfoListener#onFirstFramePushed(AlivcLivePusher)
stopPush, corresponding to the interface: com.alivc.live.pusher.AlivcLivePusher#stopPush()

Definition at line 276 of file AlivcLivePusher.java.

◆ resume()

void com.alivc.live.pusher.AlivcLivePusher.resume ( ) throws IllegalStateException

resume push

Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush/resume
Note
This interface corresponds to the callback: com.alivc.live.pusher.AlivcLivePushInfoListener#onPushResumed(AlivcLivePusher)
pause, corresponding to the interface: com.alivc.live.pusher.AlivcLivePusher#pause()

Definition at line 336 of file AlivcLivePusher.java.

◆ resumeAllAudioEffects()

int com.alivc.live.pusher.AlivcLivePusher.resumeAllAudioEffects ( )

Resume all audio effect files

Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.

Definition at line 2312 of file AlivcLivePusher.java.

◆ resumeAsync()

void com.alivc.live.pusher.AlivcLivePusher.resumeAsync ( ) throws IllegalStateException

resume push async

Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush/resume
Note
This interface corresponds to the callback: com.alivc.live.pusher.AlivcLivePushInfoListener#onPushResumed(AlivcLivePusher)
pause, corresponding to the interface: com.alivc.live.pusher.AlivcLivePusher#pause()

Definition at line 351 of file AlivcLivePusher.java.

◆ resumeAudioEffect()

int com.alivc.live.pusher.AlivcLivePusher.resumeAudioEffect ( int  soundId)

Resume specified audio effect files

Parameters
soundIdThe ID assigned by the user to the audio effect file
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.

Definition at line 2298 of file AlivcLivePusher.java.

◆ resumeBGM()

void com.alivc.live.pusher.AlivcLivePusher.resumeBGM ( ) throws IllegalStateException

resume BGM

Exceptions
IllegalStateExceptioninvalid status

Definition at line 970 of file AlivcLivePusher.java.

◆ resumeScreenCapture()

void com.alivc.live.pusher.AlivcLivePusher.resumeScreenCapture ( ) throws IllegalStateException

resume screen capture(Close privacy settings)

Exceptions
IllegalStateExceptionIf the status is invalid, such as not Initialized/not startPreview/not startPush/pause/resume

Definition at line 1135 of file AlivcLivePusher.java.

◆ sendDataChannelMessage()

int com.alivc.live.pusher.AlivcLivePusher.sendDataChannelMessage ( String  message)

The streaming end sends custom messages through data channel

Parameters
messagecustom messages
Attention
This API is only supported in the interactive mode currently, and calls have no effect.
Note
This feature needs to be enabled by calling the interface com.alivc.live.pusher.AlivcLivePushConfig#setEnableDataChannelMessage(boolean)
The receiving end receives messages through the callback com.alivc.live.player.AlivcLivePlayInfoListener#onReceiveDataChannelMessage(byte[])
In the interactive mode, if you need to send custom messages through SEI, please refer to the interface: com.alivc.live.pusher.AlivcLivePusher#sendMessage(String, int, int, boolean)com.alivc.live.pusher.AlivcLivePusher#sendMessage(String, int, int, boolean, int)

Definition at line 1784 of file AlivcLivePusher.java.

◆ sendMessage() [1/2]

void com.alivc.live.pusher.AlivcLivePusher.sendMessage ( String  info,
int  repeat,
int  delay,
boolean  isKeyFrame 
)

Send SEI

Parameters
infoThe SEI message, recommended format is json
repeatsend frames
delaysend delay
isKeyFrameis key frame
Attention
The maximum length of a SEI custom message is 4k!
Note
The default payload type is 5, if you need to specify the payload type in the interactive mode, please refer to the interface: com.alivc.live.pusher.AlivcLivePusher#sendMessage(String, int, int, boolean, int)
In the basic mode, please receive SEI custom messages through AliPlayer.setOnSeiDataListener
In the interactive mode, if the receiving end is a regular audience (CDN audience), please receive SEI custom messages through AliPlayer.setOnSeiDataListener
In the interactive mode, If the receiving end is a live streaming host or a live streaming audience, please receive SEI custom messages through com.alivc.live.player.AlivcLivePlayInfoListener#onReceiveSEIMessage(int, byte[])
In the interactive mode, if you need to send custom messages through the data channel, please refer to the interface: com.alivc.live.pusher.AlivcLivePusher#sendDataChannelMessage(String)
In interactive mode, if no video stream is sent and the current interface is called, the SDK will default to sending a 16x16 all black image stream/20fps video stream to carry SEI information. If you need to disable the SEI function in pure audio scenes, please refer to the interface: AlivcLivePusher#enableSEIVideoStream(boolean)

Definition at line 1742 of file AlivcLivePusher.java.

◆ sendMessage() [2/2]

void com.alivc.live.pusher.AlivcLivePusher.sendMessage ( String  info,
int  repeat,
int  delay,
boolean  isKeyFrame,
int  payloadType 
)

Send SEI

Parameters
infoThe SEI message, recommended format is json
repeatsend frames
delaysend delay
isKeyFrameis key frame
payloadTypeSEI payload type, range: [5, 100..254]
Attention
This API is only supported in the interactive mode currently, and calls have no effect.
The maximum length of a SEI custom message is 4k!
Currently, the H5 end does not support sending and receiving media extension information
Note
In the basic mode, please refer to the interface: com.alivc.live.pusher.AlivcLivePusher#sendMessage(String, int, int, boolean)
In the interactive mode, if the receiving end is a regular audience (CDN audience), please receive SEI custom messages through AliPlayer.setOnSeiDataListener
In the interactive mode, If the receiving end is a live streaming host or a live streaming audience, please receive SEI custom messages through com.alivc.live.player.AlivcLivePlayInfoListener#onReceiveSEIMessage(int, byte[])
In the interactive mode, if you need to send custom messages through the data channel, please refer to the interface: com.alivc.live.pusher.AlivcLivePusher#sendDataChannelMessage(String)
In interactive mode, if no video stream is sent and the current interface is called, the SDK will default to sending a 16x16 all black image stream/20fps video stream to carry SEI information. If you need to disable the SEI function in pure audio scenes, please refer to the interface: AlivcLivePusher#enableSEIVideoStream(boolean)

Definition at line 1767 of file AlivcLivePusher.java.

◆ setAllAudioEffectsPlayoutVolume()

int com.alivc.live.pusher.AlivcLivePusher.setAllAudioEffectsPlayoutVolume ( int  volume)

Set local playback volume for all audio effects

Parameters
volumeLocal playback volume for audio effects, range: [0, 100], default value: 50
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.

Definition at line 2254 of file AlivcLivePusher.java.

◆ setAllAudioEffectsPublishVolume()

int com.alivc.live.pusher.AlivcLivePusher.setAllAudioEffectsPublishVolume ( int  volume)

Set all audio effects streaming mix volume

Parameters
volumePush stream mixing volume, range: [0, 100], default value: 50
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.

Definition at line 2239 of file AlivcLivePusher.java.

◆ setAudioDenoise()

void com.alivc.live.pusher.AlivcLivePusher.setAudioDenoise ( boolean  enable)

set audio denoise

Parameters
enabletrue:open false:close
Note
To use normal denoise, please turn off intelligent denoise; Both functions are mutually exclusive
Please refer to the following interfaces for intelligent audio noise reduction:
See also
AlivcLivePusher::startIntelligentDenoise()

Definition at line 1044 of file AlivcLivePusher.java.

◆ setAudioEffectBeautifyMode()

int com.alivc.live.pusher.AlivcLivePusher.setAudioEffectBeautifyMode ( AlivcLiveAudioEffectBeautifyMode  audioEffectBeautifyMode)

Set the sound mode

Parameters
audioEffectBeautifyModesound mode
Returns
0 -> success,not 0 -> failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.
See also
com.alivc.live.annotations.AlivcLiveAudioEffectBeautifyMode

Definition at line 2008 of file AlivcLivePusher.java.

◆ setAudioEffectEqualizationParam()

int com.alivc.live.pusher.AlivcLivePusher.setAudioEffectEqualizationParam ( AlivcLiveAudioEffectEqualizationBandFrequency  audioEffectEqualizationBandFrequency,
float  gain 
)

Set equalizer parameters

Parameters
audioEffectEqualizationBandFrequencyNumber of equalizer segments[0,9] center frequency [31,62,125,250,500,1000,2000,4000,8000,16000] Hz
gainEqualizer gain db [-15,15] default 0
Returns
0 -> success,not 0 -> failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.
Note
It needs to be called after AlivcLivePusher::setAudioEffectBeautifyMode
See also
com.alivc.live.annotations.AlivcLiveAudioEffectEqualizationBandFrequency

Definition at line 2043 of file AlivcLivePusher.java.

◆ setAudioEffectPitchValue()

int com.alivc.live.pusher.AlivcLivePusher.setAudioEffectPitchValue ( double  value)

Set audio effect pitch value

Parameters
valueaudio effect pitch value
Returns
0 -> success,not 0 -> failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.
Note
audio effect pitch value, value:[0.5, 2.0], 1.0 means the pitch remains unchanged, less than 1.0 means the pitch decreases, greater than 1.0 means the pitch increases, the default is 1.0

Definition at line 1992 of file AlivcLivePusher.java.

◆ setAudioEffectPlayoutVolume()

int com.alivc.live.pusher.AlivcLivePusher.setAudioEffectPlayoutVolume ( int  soundId,
int  volume 
)

Set local playback volume for audio effects

Parameters
soundIdThe ID assigned by the user to the audio effect file
volumeLocal playback volume for audio effects, range: [0, 100], default value: 50
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.

Definition at line 2209 of file AlivcLivePusher.java.

◆ setAudioEffectPublishVolume()

int com.alivc.live.pusher.AlivcLivePusher.setAudioEffectPublishVolume ( int  soundId,
int  volume 
)

Set audio effects streaming mix volume

Parameters
soundIdThe ID assigned by the user to the audio effect file
volumePush stream mixing volume, range: [0, 100], default value: 50
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.

Definition at line 2178 of file AlivcLivePusher.java.

◆ setAudioEffectReverbMode()

int com.alivc.live.pusher.AlivcLivePusher.setAudioEffectReverbMode ( AlivcLivePushAudioEffectReverbMode  mode)

set audio effect reverb mode

Parameters
modeaudio effect reverb mode
Returns
0->success, not 0->failed
Note
The call takes effect before and during streaming
See also
com.alivc.live.pusher.AlivcLivePushAudioEffectReverbMode

Definition at line 1976 of file AlivcLivePusher.java.

◆ setAudioEffectReverbParamType()

int com.alivc.live.pusher.AlivcLivePusher.setAudioEffectReverbParamType ( AlivcLiveAudioEffectReverbParamType  audioEffectReverbParamType,
float  value 
)

Set the reverb audio effect type

Parameters
audioEffectReverbParamTypereverb audio effect type
Returns
0 -> success,not 0 -> failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.
Note
It needs to be called after AlivcLivePusher#setAudioEffectReverbMode
See also
com.alivc.live.annotations.AlivcLiveAudioEffectReverbParamType

Definition at line 2025 of file AlivcLivePusher.java.

◆ setAudioEffectVoiceChangeMode()

int com.alivc.live.pusher.AlivcLivePusher.setAudioEffectVoiceChangeMode ( AlivcLivePushAudioEffectVoiceChangeMode  mode)

set audio effect voice change mode

Parameters
modeaudio effect voice change mode
Returns
0->success, not 0->failed
Note
The call takes effect before and during streaming
See also
com.alivc.live.pusher.AlivcLivePushAudioEffectVoiceChangeMode

Definition at line 1960 of file AlivcLivePusher.java.

◆ setAudioProfile()

int com.alivc.live.pusher.AlivcLivePusher.setAudioProfile ( AlivcLiveAudioProfileQualityMode  audioProfileQualityMode)

Set audio profile

Parameters
audioProfileQualityModeaudio profile
Returns
0 -> success,not 0 -> failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.

Definition at line 1944 of file AlivcLivePusher.java.

◆ setAutoFocus()

void com.alivc.live.pusher.AlivcLivePusher.setAutoFocus ( boolean  autoFocus) throws IllegalStateException

set auto focus

Parameters
autoFocusauto focus
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview

Definition at line 378 of file AlivcLivePusher.java.

◆ setBGMEarsBack()

void com.alivc.live.pusher.AlivcLivePusher.setBGMEarsBack ( boolean  isOpen) throws IllegalStateException

set ears back

Parameters
isOpenis open
Exceptions
IllegalStateExceptioninvalid status

Definition at line 998 of file AlivcLivePusher.java.

◆ setBGMLoop()

void com.alivc.live.pusher.AlivcLivePusher.setBGMLoop ( boolean  isLoop) throws IllegalStateException

set BGM loop

Parameters
isLoopis loop
Exceptions
IllegalStateExceptioninvalid status

Definition at line 984 of file AlivcLivePusher.java.

◆ setBGMVolume()

void com.alivc.live.pusher.AlivcLivePusher.setBGMVolume ( int  volume) throws IllegalStateException, IllegalArgumentException

set BGM volume

Parameters
volumebgm volume, range:[0 ~ 100] default:50
Exceptions
IllegalStateExceptioninvalid state
IllegalArgumentExceptioninvalid argument

Definition at line 1013 of file AlivcLivePusher.java.

◆ setCaptureVolume()

void com.alivc.live.pusher.AlivcLivePusher.setCaptureVolume ( int  volume) throws IllegalStateException, IllegalArgumentException

set capture volume

Parameters
volumecapture volume, range:[0 ~ 100] default:50
Exceptions
IllegalStateExceptioninvalid state
IllegalArgumentExceptioninvalid argument

Definition at line 1028 of file AlivcLivePusher.java.

◆ setChannelProfile()

int com.alivc.live.pusher.AlivcLivePusher.setChannelProfile ( AlivcLiveChannelProfile  channelProfile)

Set Channel Mode

Parameters
channelProfileChannel Mode, default: INTERACTIVE_LIVE
Returns
0 -> success,<0 -> failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.
Note
This method is only valid when called before 'startPush'. It cannot be reset in streaming. It can be reset after 'stopPush'

Definition at line 1929 of file AlivcLivePusher.java.

◆ setCustomAudioFilter()

void com.alivc.live.pusher.AlivcLivePusher.setCustomAudioFilter ( AlivcLivePushCustomAudioFilter  customAudioFilter)

Set user-defined audio processing callbacks

Parameters
customAudioFiltercustom audio filter

Definition at line 698 of file AlivcLivePusher.java.

◆ setCustomDetect()

void com.alivc.live.pusher.AlivcLivePusher.setCustomDetect ( AlivcLivePushCustomDetect  customVideoDetect)

set user-defined custom video detect callback

Parameters
customVideoDetectcustom detect callback

Definition at line 672 of file AlivcLivePusher.java.

◆ setCustomFilter()

void com.alivc.live.pusher.AlivcLivePusher.setCustomFilter ( AlivcLivePushCustomFilter  customVideoFilter)

set user-defined custom video filter callback (Video Pre-Processing Callback)

Parameters
customVideoFiltercustom video filter

Definition at line 685 of file AlivcLivePusher.java.

◆ setExposure()

void com.alivc.live.pusher.AlivcLivePusher.setExposure ( int  exposure)

Set camera exposure

Parameters
exposurecamera exposure

Definition at line 1662 of file AlivcLivePusher.java.

◆ setExternalAudioStreamPlayoutVolume()

int com.alivc.live.pusher.AlivcLivePusher.setExternalAudioStreamPlayoutVolume ( int  streamId,
int  playoutVolume 
)

Set external audio stream playback volume

Parameters
streamIdexternal audio stream id
playoutVolumePlay volume, range of values [0, 100]
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.

Definition at line 1506 of file AlivcLivePusher.java.

◆ setExternalAudioStreamPublishVolume()

int com.alivc.live.pusher.AlivcLivePusher.setExternalAudioStreamPublishVolume ( int  streamId,
int  publishVolume 
)

Set external audio stream push volume

Parameters
streamIdexternal audio stream id
publishVolumePush flow volume, value range [0, 100]
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.

Definition at line 1522 of file AlivcLivePusher.java.

◆ setExternalVideoSource()

void com.alivc.live.pusher.AlivcLivePusher.setExternalVideoSource ( boolean  enable,
boolean  useTexture,
AlivcLivePlayVideoStreamType  videoStreamType,
AlivcPreviewDisplayMode  previewDisplayMode 
)

Enable external video input source

Parameters
enableIs it enabled
useTextureinput texture data or not
videoStreamTypevideo stream type
previewDisplayModepreview display mode
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.

Definition at line 1426 of file AlivcLivePusher.java.

◆ setFlash()

void com.alivc.live.pusher.AlivcLivePusher.setFlash ( boolean  flash) throws IllegalStateException

set flash

Parameters
flashtrue:open flash false:close flash
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview

Definition at line 485 of file AlivcLivePusher.java.

◆ setLiveMixTranscodingConfig()

int com.alivc.live.pusher.AlivcLivePusher.setLiveMixTranscodingConfig ( AlivcLiveTranscodingConfig  config)

Set live mix transcoding config for cloud stream

Parameters
configlive mix transcoding config
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.
Note
This interface corresponds to the callback: com.alivc.live.pusher.AlivcLivePushInfoListener#onSetLiveMixTranscodingConfig(AlivcLivePusher, boolean, String)
There may be more than one anchor in a live broadcast room, and each anchor has its own stream. However, for CDN viewers, they only need a live stream along the way
Therefore, we need to mix multiple anchor streams into one standard live stream, which requires mixing and transcoding
In the connected microphone scenario, it is necessary to mix the each streams of the anchor and connected microphone viewers into a standard live stream for CDN viewers to watch
In the PK scenario, it is necessary to mix the audio and video streams of multiple anchors performing the PK into a standard live stream for CDN viewers to watch
Warning
If the host is still in the room but no longer requires mixing, please be sure to pass in null to cancel mixing, because when mixing is initiated, the cloud mixing module will start working. Failure to cancel mixing in a timely manner may cause unnecessary billing losses
Do not frequently call this interface, as it may affect your business. Please ensure that the timing of API calls and callback interfaces is in line with expectations
Note
If regular audience (CDN audience) need to perceive the switch of the anchor video screen from a single anchor to a connected microphone layout, as well as the layout information of each member in the mixed stream screen, please refer to the document:
See also
Switch between layouts based on SEI
Note
If you need a server-side API to perform mixed stream operations, please refer to the OpenAPI UpdateLiveMPUTask
See also
UpdateLiveMPUTask

Definition at line 1810 of file AlivcLivePusher.java.

◆ setLivePushAudioFrameListener()

void com.alivc.live.pusher.AlivcLivePusher.setLivePushAudioFrameListener ( AlivcLivePushAudioFrameListener  pushAudioFrameListener)

set push audio sample raw data listener

Parameters
pushAudioFrameListenerAudio raw data listener
Attention
This API is only supported in the interactive mode currently, and calls have no effect.

Definition at line 784 of file AlivcLivePusher.java.

◆ setLivePushBGMListener()

void com.alivc.live.pusher.AlivcLivePusher.setLivePushBGMListener ( AlivcLivePushBGMListener  pushBGMListener)

set push BGM listener

Parameters
pushBGMListenerpush BGM listener
See also
com.alivc.live.pusher.AlivcLivePushBGMListener

Definition at line 770 of file AlivcLivePusher.java.

◆ setLivePusherReference()

void com.alivc.live.pusher.AlivcLivePusher.setLivePusherReference ( AlivcLivePusher  livePusher)

set live pusher instance (No external calls required)

Parameters
livePusherlive pusher instance

Definition at line 111 of file AlivcLivePusher.java.

◆ setLivePushErrorListener()

void com.alivc.live.pusher.AlivcLivePusher.setLivePushErrorListener ( AlivcLivePushErrorListener  errorListener)

set push error listener

Parameters
errorListenerpush error listener
Attention
Please handle abnormal or special situations according to the official website documentation:
See also
Handle errors, exceptions, and special cases
com.alivc.live.pusher.AlivcLivePushErrorListener

Definition at line 728 of file AlivcLivePusher.java.

◆ setLivePushInfoListener()

void com.alivc.live.pusher.AlivcLivePusher.setLivePushInfoListener ( AlivcLivePushInfoListener  infoListener)

set push info listener

Parameters
infoListenerpush info listener
See also
com.alivc.live.pusher.AlivcLivePushInfoListener

Definition at line 742 of file AlivcLivePusher.java.

◆ setLivePushNetworkListener()

void com.alivc.live.pusher.AlivcLivePusher.setLivePushNetworkListener ( AlivcLivePushNetworkListener  networkListener)

set push network listener

Parameters
networkListenerpush network listener
See also
com.alivc.live.pusher.AlivcLivePushNetworkListener

Definition at line 756 of file AlivcLivePusher.java.

◆ setLivePushRenderContextListener()

void com.alivc.live.pusher.AlivcLivePusher.setLivePushRenderContextListener ( AlivcLivePusherRenderContextListener  renderCtxListener)

set push render context listener

Parameters
renderCtxListenerpush render context listener

Definition at line 797 of file AlivcLivePusher.java.

◆ setMinVideoBitrate()

void com.alivc.live.pusher.AlivcLivePusher.setMinVideoBitrate ( int  minVideoBitrate) throws IllegalArgumentException, IllegalStateException

set min video bitrate(Kbps)

Parameters
minVideoBitratemin video bitrate
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush
Note
Can use the interface AlivcLivePusher#setVideoConfig(AlivcLivePushVideoConfig) instead

Definition at line 586 of file AlivcLivePusher.java.

◆ setMixedWithMic()

int com.alivc.live.pusher.AlivcLivePusher.setMixedWithMic ( boolean  mixed)

Set whether to mix audio with microphone collection

Parameters
mixedtrue ->mixing; false ->Completely replace the microphone to collect data
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.

Definition at line 1458 of file AlivcLivePusher.java.

◆ setMute() [1/2]

void com.alivc.live.pusher.AlivcLivePusher.setMute ( boolean  mute) throws IllegalStateException

Set audio mute

Parameters
mutetrue->mute audio, false->resume to normal
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush
Note
Call this interface to control whether the audio stream is muted; Even when muted, the system still occupies microphone permissions and sends muted audio data
In the interactive mode, this interface corresponds to the callback: com.alivc.live.player.AlivcLivePlayInfoListener#onAudioMuted(boolean)
If you want to no longer occupy system microphone permissions, that is, turn off audio collection, please refer to the interface: com.alivc.live.pusher.AlivcLivePusher#stopAudioCapture()

Definition at line 453 of file AlivcLivePusher.java.

◆ setMute() [2/2]

void com.alivc.live.pusher.AlivcLivePusher.setMute ( boolean  mute,
AlivcLiveMuteLocalAudioMode  muteLocalAudioMode 
)

Set audio mute

Parameters
mutetrue->mute audio, false->resume to normal
muteLocalAudioModemute local audio mode,default: AlivcLiveMuteLocalAudioMode.DEFAULT
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.
Note
Call this interface to control whether the audio stream is muted; Even when muted, the system still occupies microphone permissions and sends muted audio data
In the interactive mode, this interface corresponds to the callback: com.alivc.live.player.AlivcLivePlayInfoListener#onAudioMuted(boolean)
If you want to no longer occupy system microphone permissions, that is, turn off audio collection, please refer to the interface: com.alivc.live.pusher.AlivcLivePusher#stopAudioCapture()

Definition at line 471 of file AlivcLivePusher.java.

◆ setParameter()

int com.alivc.live.pusher.AlivcLivePusher.setParameter ( String  parameter)

Set parameter

Parameters
parameterparameter
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.

Definition at line 839 of file AlivcLivePusher.java.

◆ setPreviewMirror()

void com.alivc.live.pusher.AlivcLivePusher.setPreviewMirror ( boolean  mirror) throws IllegalStateException

set preview mirror

Parameters
mirrortrue:preview mirror false:normal
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview

Definition at line 513 of file AlivcLivePusher.java.

◆ setPreviewMode()

void com.alivc.live.pusher.AlivcLivePusher.setPreviewMode ( AlivcPreviewDisplayMode  mode) throws IllegalStateException

set preview mode

Parameters
modepreview mode
Exceptions
IllegalStateExceptioninvalid state

Definition at line 1109 of file AlivcLivePusher.java.

◆ setPreviewOrientation()

void com.alivc.live.pusher.AlivcLivePusher.setPreviewOrientation ( AlivcPreviewOrientationEnum  orientation)

set preview orientation

Parameters
orientationpreview orientation

Definition at line 867 of file AlivcLivePusher.java.

◆ setPushMirror()

void com.alivc.live.pusher.AlivcLivePusher.setPushMirror ( boolean  mirror) throws IllegalStateException

set push mirror

Parameters
mirrortrue:push mirror false:normal
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush

Definition at line 499 of file AlivcLivePusher.java.

◆ setQualityMode()

void com.alivc.live.pusher.AlivcLivePusher.setQualityMode ( AlivcQualityModeEnum  mode) throws IllegalStateException

set quality mode

Parameters
modequality mode
Exceptions
IllegalStateExceptioninvalid state

Definition at line 1095 of file AlivcLivePusher.java.

◆ setScreenOrientation()

void com.alivc.live.pusher.AlivcLivePusher.setScreenOrientation ( int  orientation)

Set the induced screen rotation angle in screen recording mode

Parameters
orientationscreen orientation

Definition at line 1270 of file AlivcLivePusher.java.

◆ setTargetVideoBitrate()

void com.alivc.live.pusher.AlivcLivePusher.setTargetVideoBitrate ( int  targetVideoBitrate) throws IllegalArgumentException, IllegalStateException

Set target video bitrate(Kbps)

Parameters
targetVideoBitratetarget video bitrate
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush
Note
Can use the interface AlivcLivePusher#setVideoConfig(AlivcLivePushVideoConfig) instead

Definition at line 571 of file AlivcLivePusher.java.

◆ setVideoConfig()

void com.alivc.live.pusher.AlivcLivePusher.setVideoConfig ( AlivcLivePushVideoConfig  videoConfig)

Set video configuration

Parameters
videoConfigvideo configuration
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.

Definition at line 543 of file AlivcLivePusher.java.

◆ setVideoMirrorMode()

int com.alivc.live.pusher.AlivcLivePusher.setVideoMirrorMode ( AlivcLiveVideoMirrorMode  mirrorMode)

set video mirror mode

Parameters
mirrorModevideo pipeline mirror mode
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.
Note
This interface is used to set preview and streaming mirroring capabilities, which can be used before and after streaming

Definition at line 529 of file AlivcLivePusher.java.

◆ setWatermarkVisible()

void com.alivc.live.pusher.AlivcLivePusher.setWatermarkVisible ( boolean  visible)

set watermark visible

Parameters
visiblevisible

Definition at line 1231 of file AlivcLivePusher.java.

◆ setZoom()

void com.alivc.live.pusher.AlivcLivePusher.setZoom ( int  zoom) throws IllegalArgumentException, IllegalStateException

set zoom

Parameters
zoom0~getMaxZoom()
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview

Definition at line 408 of file AlivcLivePusher.java.

◆ snapshot()

void com.alivc.live.pusher.AlivcLivePusher.snapshot ( int  count,
int  interval,
AlivcSnapshotListener  listener 
)

video stream snapshot

Parameters
countThe number of captured images, this parameter only takes effect in basic mode
intervalThe interval between each image, this parameter only takes effect in basic mode
listenersnapshot callback

Definition at line 1409 of file AlivcLivePusher.java.

◆ startAudioCapture()

int com.alivc.live.pusher.AlivcLivePusher.startAudioCapture ( boolean  keepAlive)

Enable audio capture

Parameters
keepAlivetrue->audio capture is still enabled after stopping streaming, false->audio capture is stopped after stopping streaming
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.
Note
Calling this interface to start audio capture and transmission, it will occupy system microphone permissions
stopAudioCapture, corresponding to the interface: com.alivc.live.pusher.AlivcLivePusher#stopAudioCapture()
If you only need to mute without turning off audio capture, please refer to the following interfaces: com.alivc.live.pusher.AlivcLivePusher#setMute(boolean)

Definition at line 1866 of file AlivcLivePusher.java.

◆ startBGMAsync() [1/2]

int com.alivc.live.pusher.AlivcLivePusher.startBGMAsync ( String  path) throws IllegalStateException

start BGM async

Parameters
pathBGM path
Returns
0->success, not 0->failed
Exceptions
IllegalStateExceptioninvalid status
Warning
Please store the files in an accessible SD card directory for the application, avoiding placing them directly in the root directory of the SD card. If the function fails, please check if the path exists and if the application has permission to read the SD card path.

Definition at line 884 of file AlivcLivePusher.java.

◆ startBGMAsync() [2/2]

int com.alivc.live.pusher.AlivcLivePusher.startBGMAsync ( String  path,
AlivcLiveBGMConfig  bgmConfig 
)

start BGM async

Parameters
pathBGM path
bgmConfigBGM config
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.
Warning
Please store the files in an accessible SD card directory for the application, avoiding placing them directly in the root directory of the SD card. If the function fails, please check if the path exists and if the application has permission to read the SD card path.

Definition at line 901 of file AlivcLivePusher.java.

◆ startCamera()

int com.alivc.live.pusher.AlivcLivePusher.startCamera ( SurfaceView  surfaceView) throws IllegalStateException

Enable camera preview in screen recording mode If preview is not required, fill in null for surfaceView

Parameters
surfaceViewsurfaceView
Returns
0->success, not 0->failed

Definition at line 1246 of file AlivcLivePusher.java.

◆ startCameraMix()

int com.alivc.live.pusher.AlivcLivePusher.startCameraMix ( float  x,
float  y,
float  w,
float  h 
)

Enable camera mixing in screen recording mode

Parameters
xMixed flow display x initial position (0~1.0f)
yMixed flow display y initial position (0~1.0f)
wMixed flow display width (0~1.0f)
hMixed flow display height (0~1.0f)
Returns
0->success, not 0->failed

Definition at line 1287 of file AlivcLivePusher.java.

◆ startIntelligentDenoise()

int com.alivc.live.pusher.AlivcLivePusher.startIntelligentDenoise ( )

open intelligent denoise

Returns
0->success, not 0->failed
Note
1.The intelligent denoise function is provided in the form of a plug-in. Before calling this interface, please ensure that intelligent noise reduction component has been integrated; Please refer to the official website documentation for plug-in acquisition methods;
2.To use intelligent denoise, please turn off normal denoise; Both functions are mutually exclusive
3.This interface can control the intelligent denoise function during a call, and can support turning on and off intelligent denoise during a call
4.The default setting is off, which may lead to increased power consumption after being turned on. Intelligent denoise is suitable for scenarios dominated by voice communication such as conferences and education, but not for scenarios with background music
Attentions
Note
If there are lib.so conflicts related to libMNN.so, please check whether other video cloud products are used in the current project, such as the Beauty SDK/Animoji SDK
The Beauty SDK/Animoji SDK contains libMNN-related lib.so, so there is no need to import another copy externally, only libpluginAliDenoise.so is reserved,
Keep a unified copy of the global libMNN.so related database;
For details, please check the official website documentation or API documentation, or you can consult your technical classmates to help solve the problem;
See also
Use the feature in Push SDK for Android

Definition at line 1067 of file AlivcLivePusher.java.

◆ startLastMileDetect()

int com.alivc.live.pusher.AlivcLivePusher.startLastMileDetect ( AlivcLiveNetworkQualityProbeConfig  networkQualityProbeConfig)

Start network quality detection

Parameters
networkQualityProbeConfigNetwork detection configuration
Returns
0 -> success,not 0 -> failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.
Note
Network quality detection needs to be called before streaming, that is, startPush. It cannot be called after streaming
Around 3 seconds, the rough result will be called back in AlivcLivePushNetworkListener#onLastMileDetectResultWithQuality(AlivcLivePusher, AlivcLiveNetworkQuality)
Around 30 seconds, more results will be called back in AlivcLivePushNetworkListener#onLastMileDetectResultWithBandWidth(AlivcLivePusher, int, AlivcLiveNetworkQualityProbeResult)

Definition at line 2330 of file AlivcLivePusher.java.

◆ startLocalDualAudioStream()

int com.alivc.live.pusher.AlivcLivePusher.startLocalDualAudioStream ( )

Start the dual audio stream push

Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.
Note
After enabling the second audio stream push, first call AlivcLivePusher#addExternalAudioStream(AlivcLivePushExternalAudioStreamConfig) to add the audio data source
Attention: AlivcLivePushExternalAudioStreamConfig#publishStream needs to pass 1
Then call AlivcLivePusher#pushExternalAudioStream(int, AlivcLivePushAudioFrame) to input audio data into the second audio channel
Stop the local dual audio stream push, corresponding interface: AlivcLivePusher#stopLocalDualAudioStream()

Definition at line 1379 of file AlivcLivePusher.java.

◆ startLocalRecord()

boolean com.alivc.live.pusher.AlivcLivePusher.startLocalRecord ( AlivcLiveLocalRecordConfig  localRecordConfig)

start local recording

Parameters
localRecordConfiglocal recording config
Returns
true->Call success,false->Call failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.
Note
This interface corresponds to the callback: AlivcLivePushInfoListener#onLocalRecordEvent(AlivcLiveRecordMediaEvent, String)
After calling this interface, the recording status will be notified asynchronously through a callback.
After calling this interface, record the audio and video content in the live broadcast to a local file.

Definition at line 1316 of file AlivcLivePusher.java.

◆ startPreview() [1/2]

void com.alivc.live.pusher.AlivcLivePusher.startPreview ( Context  context,
FrameLayout  frameLayout,
boolean  isFullScreen 
) throws IllegalArgumentException, IllegalStateException

start preview (interactive mode only)

Parameters
contextandroid context
frameLayoutFrameLayout Container; The rendering view is created internally by the SDK and added to the container
isFullScreenWhether the rendered view is full screen; If the rendering view is full screen, it needs to be placed at the lowest level for full screen display to avoid obstructing other small window rendering views
Exceptions
IllegalArgumentExceptionerror argument
IllegalStateExceptionerror state
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.
Due to the involvement of main-thread UI operations, please do not call frequently or quickly
Note
This interface corresponds to the callback: com.alivc.live.pusher.AlivcLivePushInfoListener#onPreviewStarted(AlivcLivePusher)
Determine if the preview was successful, corresponds to the callback: com.alivc.live.pusher.AlivcLivePushInfoListener#onFirstFramePreviewed(AlivcLivePusher)
stopPreview, corresponding to the interface: com.alivc.live.pusher.AlivcLivePusher#stopPreview()
If you need to update the streaming preview view,please refer to the following interface settings: com.alivc.live.pusher.AlivcLivePusher#updatePreview(Context, FrameLayout, boolean)
If you need to adjust the streaming preview display mode, please refer to the following interface settings: com.alivc.live.pusher.AlivcLivePushConfig#setPreviewDisplayMode(com.alivc.live.pusher.AlivcPreviewDisplayMode)

Definition at line 175 of file AlivcLivePusher.java.

◆ startPreview() [2/2]

void com.alivc.live.pusher.AlivcLivePusher.startPreview ( SurfaceView  surfaceView) throws IllegalArgumentException, IllegalStateException

start preview (basic mode only)

Parameters
surfaceViewsurfaceView
Exceptions
IllegalArgumentExceptionIf the surfaceView is null, or the surface of the surfaceView has not been created/destroyed
IllegalStateExceptionIf the status is invalid, such as not initialized yet
Attention
This API is only supported in the basic mode currently, otherwise it will have no effect.
Note
This interface corresponds to the callback: com.alivc.live.pusher.AlivcLivePushInfoListener#onPreviewStarted(AlivcLivePusher)
Determine if the preview was successful, corresponds to the callback: com.alivc.live.pusher.AlivcLivePushInfoListener#onFirstFramePreviewed(AlivcLivePusher)
stopPreview, corresponding to the interface: com.alivc.live.pusher.AlivcLivePusher#stopPreview()
If you need to adjust the streaming preview display mode, please refer to the following interface settings: com.alivc.live.pusher.AlivcLivePushConfig#setPreviewDisplayMode(com.alivc.live.pusher.AlivcPreviewDisplayMode)

Definition at line 131 of file AlivcLivePusher.java.

◆ startPreviewAsync()

void com.alivc.live.pusher.AlivcLivePusher.startPreviewAsync ( SurfaceView  surfaceView) throws IllegalArgumentException, IllegalStateException

start Preview async (basic mode only)

Parameters
surfaceViewsurfaceView
Exceptions
IllegalArgumentExceptionIf the surfaceView is null, or the surface of the surfaceView has not been created/destroyed
IllegalStateExceptionIf the status is invalid, such as not initialized yet
Attention
This API is only supported in the basic mode currently, otherwise it will have no effect.
Note
This interface corresponds to the callback: com.alivc.live.pusher.AlivcLivePushInfoListener#onPreviewStarted(AlivcLivePusher)
Determine if the preview was successful, corresponds to the callback: com.alivc.live.pusher.AlivcLivePushInfoListener#onFirstFramePreviewed(AlivcLivePusher)
stopPreview, corresponding to the interface: com.alivc.live.pusher.AlivcLivePusher#stopPreview()
If you need to adjust the streaming preview display mode, please refer to the following interface settings: com.alivc.live.pusher.AlivcLivePushConfig#setPreviewDisplayMode(com.alivc.live.pusher.AlivcPreviewDisplayMode)

Definition at line 151 of file AlivcLivePusher.java.

◆ startPush()

void com.alivc.live.pusher.AlivcLivePusher.startPush ( String  url) throws IllegalArgumentException, IllegalStateException

start push

Parameters
urlpush url
Exceptions
IllegalArgumentExceptionIf the url is empty or not in a valid url format
IllegalStateExceptionIf the status is invalid, such as not Initialized/not startPreview
Note
This interface corresponds to the callback: com.alivc.live.pusher.AlivcLivePushInfoListener#onPushStarted(AlivcLivePusher)
Determine whether the push stream is successful, corresponds to the callback: com.alivc.live.pusher.AlivcLivePushInfoListener#onFirstFramePushed(AlivcLivePusher)
In interactive mode, after the anchor initiates a live stream or connects to a microphone, if you need to monitor whether the stream is successfully forwarded to the CDN live platform, please refer to the document:
See also
Listen to stream ingest callbacks in co-streaming scenarios
Note
stopPush, corresponding to the interface: com.alivc.live.pusher.AlivcLivePusher#stopPush()

Definition at line 226 of file AlivcLivePusher.java.

◆ startPushAsync()

void com.alivc.live.pusher.AlivcLivePusher.startPushAsync ( String  url) throws IllegalArgumentException, IllegalStateException

start push async

Parameters
urlpush url
Exceptions
IllegalArgumentExceptionIf the url is empty or not in a valid url format
IllegalStateExceptionIf the status is invalid, such as not Initialized/not startPreview
Note
This interface corresponds to the callback: com.alivc.live.pusher.AlivcLivePushInfoListener#onPushStarted(AlivcLivePusher)
Determine whether the push stream is successful, corresponds to the callback: com.alivc.live.pusher.AlivcLivePushInfoListener#onFirstFramePushed(AlivcLivePusher)
stopPush, corresponding to the interface: com.alivc.live.pusher.AlivcLivePusher#stopPush()

Definition at line 244 of file AlivcLivePusher.java.

◆ startScreenShare()

int com.alivc.live.pusher.AlivcLivePusher.startScreenShare ( )

Start screen share

Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.
Note
In the interactive mode, this interface corresponds to the callback: com.alivc.live.pusher.AlivcLivePushInfoListener#onScreenSharePublishStateChanged(AlivcLivePublishState, AlivcLivePublishState)

Definition at line 1347 of file AlivcLivePusher.java.

◆ stopAllAudioEffects()

int com.alivc.live.pusher.AlivcLivePusher.stopAllAudioEffects ( )

Stop playing all audio effects

Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.

Definition at line 2162 of file AlivcLivePusher.java.

◆ stopAudioCapture()

int com.alivc.live.pusher.AlivcLivePusher.stopAudioCapture ( )

stop audio capture

Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.
Note
Call this interface to turn off audio collection, no longer occupy system microphone permissions, and no longer send audio data
If the system still shows microphone permission occupied after calling this interface, please check if it is caused by other functions
startAudioCapture, corresponding to the interface: com.alivc.live.pusher.AlivcLivePusher#startAudioCapture(boolean)
If you only need to mute without turning off audio capture, please refer to the following interfaces: com.alivc.live.pusher.AlivcLivePusher#setMute(boolean)

Definition at line 1884 of file AlivcLivePusher.java.

◆ stopAudioEffect()

int com.alivc.live.pusher.AlivcLivePusher.stopAudioEffect ( int  soundId)

Stop playing audio effects

Parameters
soundIdThe ID assigned by the user to the audio effect file
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.

Definition at line 2148 of file AlivcLivePusher.java.

◆ stopBGMAsync()

void com.alivc.live.pusher.AlivcLivePusher.stopBGMAsync ( ) throws IllegalStateException

stop BGM async

Exceptions
IllegalStateExceptioninvalid status

Definition at line 914 of file AlivcLivePusher.java.

◆ stopCamera()

void com.alivc.live.pusher.AlivcLivePusher.stopCamera ( )

Turn off camera preview in screen recording mode

Definition at line 1257 of file AlivcLivePusher.java.

◆ stopCameraMix()

void com.alivc.live.pusher.AlivcLivePusher.stopCameraMix ( )

Stop camera mixing in screen recording mode

Definition at line 1298 of file AlivcLivePusher.java.

◆ stopIntelligentDenoise()

int com.alivc.live.pusher.AlivcLivePusher.stopIntelligentDenoise ( )

stop intelligent denoise

Returns
0->success, not 0->false
Note
This API can control turning off the intelligent noise reduction function during a call

Definition at line 1081 of file AlivcLivePusher.java.

◆ stopLastMileDetect()

int com.alivc.live.pusher.AlivcLivePusher.stopLastMileDetect ( )

Stop network quality detection

Returns
0 -> success,not 0 -> failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.

Definition at line 2344 of file AlivcLivePusher.java.

◆ stopLocalDualAudioStream()

int com.alivc.live.pusher.AlivcLivePusher.stopLocalDualAudioStream ( )

Stop the dual audio stream push

Returns
0->success, not 0->failed
Attention
This API is only supported in the basic mode currently, otherwise it will have no effect.
Note
Start the local dual audio stream push, corresponding interface: AlivcLivePusher#startLocalDualAudioStream()

Definition at line 1394 of file AlivcLivePusher.java.

◆ stopLocalRecord()

void com.alivc.live.pusher.AlivcLivePusher.stopLocalRecord ( )

stop local recording

Attention
This API is only supported in the interactive mode currently, and calls have no effect.
Note
This interface corresponds to the callback: AlivcLivePushInfoListener#onLocalRecordEvent(AlivcLiveRecordMediaEvent, String)
After calling this interface, the recording status will be notified asynchronously through a callback.
If the recording task has not been stopped through this interface before the end of streaming, the recording task will be automatically stopped after the end of streaming.

Definition at line 1332 of file AlivcLivePusher.java.

◆ stopPreview()

void com.alivc.live.pusher.AlivcLivePusher.stopPreview ( ) throws IllegalStateException

stop preview

Exceptions
IllegalStateExceptionIf the status is invalid, such as not Initialized/not startPreview
Note
startPreview, corresponding to the interface: com.alivc.live.pusher.AlivcLivePusher#startPreview(SurfaceView)

Definition at line 206 of file AlivcLivePusher.java.

◆ stopPush()

void com.alivc.live.pusher.AlivcLivePusher.stopPush ( ) throws IllegalStateException

stop push

Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush/stopPush

Definition at line 304 of file AlivcLivePusher.java.

◆ stopScreenShare()

int com.alivc.live.pusher.AlivcLivePusher.stopScreenShare ( )

Stop screen share

Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.

Definition at line 1361 of file AlivcLivePusher.java.

◆ switchCamera()

void com.alivc.live.pusher.AlivcLivePusher.switchCamera ( ) throws IllegalStateException

switch camera

Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview

Definition at line 364 of file AlivcLivePusher.java.

◆ unloadAudioEffect()

int com.alivc.live.pusher.AlivcLivePusher.unloadAudioEffect ( int  soundId)

Unload preloaded audio effect files

Parameters
soundIdThe ID assigned by the user to the audio effect file
Returns
0->success, not 0->failed
Attention
This API is only supported in the interactive mode currently, and calls have no effect.

Definition at line 2115 of file AlivcLivePusher.java.

◆ updatePreview()

void com.alivc.live.pusher.AlivcLivePusher.updatePreview ( Context  context,
FrameLayout  frameLayout,
boolean  isFullScreen 
)

Update preview view (interactive mode only)

Parameters
contextandroid context
frameLayoutFrameLayout container; The rendering view is created internally by the SDK and added to the container
isFullScreenWhether the rendered view is full screen; If the rendering view is full screen, it needs to be placed at the lowest level for full screen display to avoid obstructing other small window rendering views
Attention
This API is only supported in the interactive mode currently, otherwise it will have no effect.
Due to the involvement of main-thread UI operations, please do not call frequently or quickly

Definition at line 192 of file AlivcLivePusher.java.