All Products
Search
Document Center

ApsaraVideo Live:Methods

Last Updated:Aug 14, 2024

This topic describes the methods provided by Push SDK for Windows.

API reference

Note

Push SDK for Windows supports basic features and co-streaming features.

For details about the API reference, see API reference for Push SDK for Windows V6.10.0 or view the API documentation in the SDK package.

Basic classes

Class

Description

AlivcLiveBase

The base class for stream ingest.

AlivcLivePusher

The class for stream ingest features.

AlivcLivePushConfig

The class used to initialize the stream ingest configurations.

AlivcLivePushErrorListener

The class for the error listener for stream ingest.

AlivcLivePushNetworkListener

The class for the network listener for stream ingest.

AlivcLivePushInfoListener

The class for the notification listener for stream ingest.

AlivcLiveBaseListener

The class for stream ingest callbacks.

AlivcLivePlayer

The abstract class for stream pulling.

AlivcLivePlayConfig

The class used to initialize the stream pulling configurations.

AlivcLivePlayInfoListener

The class for stream pulling callbacks.

AlivcLiveBase - provides basic methods related to stream ingest

Method

Description

GetSDKVersion

Queries the version number of the SDK.

isSupportLiveMode

Queries the stream ingest modes supported by the SDK.

setConsoleEnabled

Specifies whether to enable log printing in the console.

setListener

Specifies whether to enable callback notifications to asynchronously receive the license registration results.

SetLogDirPath

Specifies the path in which log files are stored and the size of log shards. Make sure that the path exists and data can be written to the path.

SetLogLevel

Specifies the log level.

Important

Note

If you enable the feature for all logs, the performance of the application may deteriorate.

AlivcLivePusher - provides methods related to stream ingest features

Method

Description

init

Initializes stream ingest parameters.

destroy

Destroys the stream ingest engine.

startPreview

Starts preview. In interactive mode, call the startPreview method in which you specify the FrameLayout parameter.

startPreviewAysnc

Asynchronously starts preview.

stopPreview

Stops preview.

startPush

Starts stream ingest.

startPushAysnc

Asynchronously starts stream ingest.

stopPush

Stops stream ingest.

setMute

Specifies whether to mute the audio during stream ingest.

setTargetVideoBitrate

Specifies the target video bitrate. Valid values: [100,5000]. Unit: Kbit/s.

setMinVideoBitrate

Specifies the minimum video bitrate. Valid values: [100,5000]. Unit: Kbit/s.

setLivePushErrorListener

Sets the listener for errors related to stream ingest.

setLivePushInfoListener

Sets the listener for notifications about stream ingest.

setLivePushNetworkListener

Sets the listener for notifications about the network.

startCamera

Enables the camera preview during screen recording. If the preview is not required, set the surfaceview parameter to null.

stopCamera

Disables the camera preview during screen recording.

setLiveMixTranscodingConfig

Sets the parameters for cloud-based stream mixing (transcoding).

AlivcLivePlayer - provdes methods related to stream pulling

Note

This class is available only for stream pulling in interactive mode.

Method

Description

setupWithConfig

Initializes stream pulling parameters.

setPlayView

Sets the playback preview.

setPlayInfoListener

Sets the listener for notifications about stream pulling.

setRemoteAudioVolume

Sets the playback volume.

startPlay

Starts the playback of the audio and video streams.

stopPlay

Stops the playback of the audio and video streams.

destroy

Destroys the stream pulling engine.

getMode

Queries the current stream pulling mode.

Classes for listeners

AlivcLivePushErrorListener

Callback

Description

onSDKError

The callback for SDK errors.

onSystemError

The callback for system errors.

AlivcLivePushNetworkListener

Callback

Description

onConnectFail

Indicates that the connection fails.

onConnectionLost

Indicates that the connection is interrupted.

onNetworkPoor

Indicates that the network condition is poor.

onNetworkRecovery

Indicates that the network recovers.

onPacketsLost

The callback for packet loss during stream ingest.

onPushURLAuthenticationOverdue

Indicates that authentication expires.

onReconnectFail

Indicates that the reconnection fails.

onReconnectStart

Indicates that the reconnection starts.

onReconnectSucceed

Indicates that the reconnection is successful.

onSendDataTimeout

Indicates that the data transmission times out.

onSendMessage

Indicates that supplemental enhancement information (SEI) is sent.

AlivcLivePushInfoListener

Callback

Description

onFirstFramePreviewed

Indicates that the first frame is rendered.

onPreviewStarted

Indicates that the preview starts.

onPreviewStopped

Indicates that the preview ends.

onPushPaused

Indicates that the stream ingest is paused.

onPushStarted

Indicates that the stream ingest starts.

onLocalVideoStats

The callback for statistics on the local video. This callback is returned every 2 seconds.

onLocalAudioStats

The callback for statistics on the local audio. This callback is returned every 2 seconds.

onPushStopped

Indicates that the stream ingest ends.

onSetLiveMixTranscodingConfig

The callback for configuration of the cloud-based stream mixing (transcoding) parameters.

AlivcLivePlayInfoListener

Callback

Description

onError

The callback for errors.

onFirstVideoFrameDrawn

The callback for playback of the video.

onPlayStarted

The callback for playback start.

onPlayStopped

The callback for playback stop.