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

Live play info listener. More...

Inheritance diagram for com.alivc.live.player.AlivcLivePlayInfoListener:

Public Member Functions

abstract void onPlayStarted ()
 
abstract void onPlayStopped ()
 
abstract void onError (AlivcLivePlayError code, String msg)
 
void onFirstAudioFrameReceived ()
 
void onFirstAudioFrameDecoded ()
 
void onFirstVideoFrameReceived ()
 
void onFirstVideoFrameDrawn ()
 
void onReceiveSEIMessage (int payload, byte[] data)
 
void onPlayoutVolumeUpdate (int volume, boolean isSpeaking)
 
void onVideoResolutionChanged (int width, int height)
 
void onPlayerStatistics (AlivcLivePlayerStatsInfo statsInfo)
 
void onRemoteUserLeave (AlivcLiveUserOfflineReason reason)
 
void onNetworkQualityChanged (AlivcLiveNetworkQuality upQuality, AlivcLiveNetworkQuality downQuality)
 
void onAudioMuted (boolean mute)
 
void onVideoMuted (boolean mute)
 
void onVideoEnabled (boolean enable)
 
void onReceiveDataChannelMessage (byte[] data)
 
void onAudioSubscribeStateChanged (AlivcLiveSubscribeState oldState, AlivcLiveSubscribeState newState)
 
void onVideoSubscribeStateChanged (AlivcLiveSubscribeState oldState, AlivcLiveSubscribeState newState)
 
void onScreenShareSubscribeStateChanged (AlivcLiveSubscribeState oldState, AlivcLiveSubscribeState newState)
 
boolean onAudioFrame (AlivcLivePushAudioFrame audioFrame)
 
boolean onVideoFrame (AlivcLivePushVideoFrame videoFrame)
 

Detailed Description

Live play info listener.

Author
baorunchen
Attention
This API is only supported in the interactive mode currently
Date
2022/8/10
Call Example
mAlivcLivePlayer.setPlayInfoListener(new AlivcLivePlayInfoListener () {});
See also
com.alivc.live.player.AlivcLivePlayer::setPlayInfoListener(AlivcLivePlayInfoListener)

Definition at line 25 of file AlivcLivePlayInfoListener.java.

Member Function Documentation

◆ onAudioFrame()

boolean com.alivc.live.player.AlivcLivePlayInfoListener.onAudioFrame ( AlivcLivePushAudioFrame  audioFrame)

Remote audio frame data callback

Parameters
audioFrameAudio frame data
Returns
true->success, false->failed
Note
It is disabled by default, and needs to be enabled by calling com.alivc.live.pusher.AlivcLivePusher#enableAudioFrameObserver(boolean, AlivcLiveAudioSource, AlivcLiveAudioFrameObserverConfig)
enableAudioFrameObserver interface parameters: (true, AlivcLiveAudioSource.REMOTE_USER, AlivcLiveAudioFrameObserverConfig)
This interface does not support setting the sampling rate and number of channels
This interface supports read/write mode
Attention
Please do not perform any time-consuming operations in this callback function, otherwise it may cause abnormal sound

Definition at line 222 of file AlivcLivePlayInfoListener.java.

◆ onAudioMuted()

void com.alivc.live.player.AlivcLivePlayInfoListener.onAudioMuted ( boolean  mute)

audio mute/unmute callback for remote user

Parameters
mutemute audio or not
Note
This callback corresponds to the interface: com.alivc.live.pusher.AlivcLivePusher#setMute(boolean)

Definition at line 147 of file AlivcLivePlayInfoListener.java.

◆ onAudioSubscribeStateChanged()

void com.alivc.live.player.AlivcLivePlayInfoListener.onAudioSubscribeStateChanged ( AlivcLiveSubscribeState  oldState,
AlivcLiveSubscribeState  newState 
)

Audio stream subscription state callback

Parameters
oldStateOld audio stream subscription state
newStateNew audio stream subscription state

Definition at line 187 of file AlivcLivePlayInfoListener.java.

◆ onError()

abstract void com.alivc.live.player.AlivcLivePlayInfoListener.onError ( AlivcLivePlayError  code,
String  msg 
)
abstract

play error callback

Parameters
codeerror code
msgerror msg

◆ onFirstAudioFrameDecoded()

void com.alivc.live.player.AlivcLivePlayInfoListener.onFirstAudioFrameDecoded ( )

first audio frame decoded

Definition at line 64 of file AlivcLivePlayInfoListener.java.

◆ onFirstAudioFrameReceived()

void com.alivc.live.player.AlivcLivePlayInfoListener.onFirstAudioFrameReceived ( )

first audio frame received

Definition at line 58 of file AlivcLivePlayInfoListener.java.

◆ onFirstVideoFrameDrawn()

void com.alivc.live.player.AlivcLivePlayInfoListener.onFirstVideoFrameDrawn ( )

first video frame drawn

Definition at line 76 of file AlivcLivePlayInfoListener.java.

◆ onFirstVideoFrameReceived()

void com.alivc.live.player.AlivcLivePlayInfoListener.onFirstVideoFrameReceived ( )

first video frame received

Definition at line 70 of file AlivcLivePlayInfoListener.java.

◆ onNetworkQualityChanged()

void com.alivc.live.player.AlivcLivePlayInfoListener.onNetworkQualityChanged ( AlivcLiveNetworkQuality  upQuality,
AlivcLiveNetworkQuality  downQuality 
)

network quality changed callback

Parameters
upQualityup network quality
downQualitydown network quality
Note
Triggered when peer network quality changes.

Definition at line 137 of file AlivcLivePlayInfoListener.java.

◆ onPlayerStatistics()

void com.alivc.live.player.AlivcLivePlayInfoListener.onPlayerStatistics ( AlivcLivePlayerStatsInfo  statsInfo)

play statistics callback

Parameters
statsInfoplay statistics

Definition at line 114 of file AlivcLivePlayInfoListener.java.

◆ onPlayoutVolumeUpdate()

void com.alivc.live.player.AlivcLivePlayInfoListener.onPlayoutVolumeUpdate ( int  volume,
boolean  isSpeaking 
)

the callback of playout volume

Parameters
volumethe total volume after mixing, with a value range of [0, 255].
isSpeakingthe status of speaking
Note
This callback relies on the Vad function and requires calling the following interface to take effect: com.alivc.live.pusher.AlivcLivePusher#enableAudioVolumeIndication(int, int, int)

Definition at line 97 of file AlivcLivePlayInfoListener.java.

◆ onPlayStarted()

abstract void com.alivc.live.player.AlivcLivePlayInfoListener.onPlayStarted ( )
abstract

play started callback

Note
This callback indicates successful playback of audio and video
This callback corresponds to the interface: com.alivc.live.player.AlivcLivePlayer#startPlay(String)

◆ onPlayStopped()

abstract void com.alivc.live.player.AlivcLivePlayInfoListener.onPlayStopped ( )
abstract

play stopped

Note
This callback indicates that the audio and video playback has ended
This callback corresponds to the interface: com.alivc.live.player.AlivcLivePlayer#stopPlay()

◆ onReceiveDataChannelMessage()

void com.alivc.live.player.AlivcLivePlayInfoListener.onReceiveDataChannelMessage ( byte[]  data)

Data Channel message callback

Parameters
datamessage data
Note
This callback corresponds to the interface: com.alivc.live.pusher.AlivcLivePusher#sendDataChannelMessage(String)

Definition at line 177 of file AlivcLivePlayInfoListener.java.

◆ onReceiveSEIMessage()

void com.alivc.live.player.AlivcLivePlayInfoListener.onReceiveSEIMessage ( int  payload,
byte[]  data 
)

received media extension information(SEI) callback

Parameters
payloadpayload type
datamedia extension information(SEI)
Note
This callback corresponds to the interface: com.alivc.live.pusher.AlivcLivePusher#sendMessage(String, int, int, boolean)
This callback corresponds to the interface: com.alivc.live.pusher.AlivcLivePusher#sendMessage(String, int, int, boolean, int)

Definition at line 87 of file AlivcLivePlayInfoListener.java.

◆ onRemoteUserLeave()

void com.alivc.live.player.AlivcLivePlayInfoListener.onRemoteUserLeave ( AlivcLiveUserOfflineReason  reason)

Remote user offline callback

Parameters
reasonThe reason why the user is offline

Definition at line 126 of file AlivcLivePlayInfoListener.java.

◆ onScreenShareSubscribeStateChanged()

void com.alivc.live.player.AlivcLivePlayInfoListener.onScreenShareSubscribeStateChanged ( AlivcLiveSubscribeState  oldState,
AlivcLiveSubscribeState  newState 
)

Screen share stream subscription state callback

Parameters
oldStateOld screen share stream subscription state
newStateNew screen share stream subscription state

Definition at line 207 of file AlivcLivePlayInfoListener.java.

◆ onVideoEnabled()

void com.alivc.live.player.AlivcLivePlayInfoListener.onVideoEnabled ( boolean  enable)

Turn on/off video capture notifications for remote user

Parameters
enableturn off video capture or not
Note
This callback corresponds to the interface: com.alivc.live.pusher.AlivcLivePusher#enableLocalCamera(boolean)

Definition at line 167 of file AlivcLivePlayInfoListener.java.

◆ onVideoFrame()

boolean com.alivc.live.player.AlivcLivePlayInfoListener.onVideoFrame ( AlivcLivePushVideoFrame  videoFrame)

Remote video frame data callback

Parameters
videoFramevideo data sample
Returns
true->success, false->failed
Note
This callback requires calling the com.alivc.live.pusher.AlivcLivePushConfig#setEnableRemoteVideoFrameCallback(boolean) interface to take effect

Definition at line 234 of file AlivcLivePlayInfoListener.java.

◆ onVideoMuted()

void com.alivc.live.player.AlivcLivePlayInfoListener.onVideoMuted ( boolean  mute)

video mute/unmute callback for remote user

Parameters
mutemute video or not
Note
This callback corresponds to the interface: com.alivc.live.pusher.AlivcLivePusher#muteLocalCamera(boolean)

Definition at line 157 of file AlivcLivePlayInfoListener.java.

◆ onVideoResolutionChanged()

void com.alivc.live.player.AlivcLivePlayInfoListener.onVideoResolutionChanged ( int  width,
int  height 
)

video resolution changed callback

Parameters
widthvideo width
heightvideo height

Definition at line 106 of file AlivcLivePlayInfoListener.java.

◆ onVideoSubscribeStateChanged()

void com.alivc.live.player.AlivcLivePlayInfoListener.onVideoSubscribeStateChanged ( AlivcLiveSubscribeState  oldState,
AlivcLiveSubscribeState  newState 
)

Video stream subscription state callback

Parameters
oldStateOld video stream subscription state
newStateNew video stream subscription state

Definition at line 197 of file AlivcLivePlayInfoListener.java.