AliVCSDK 6.17.0
阿里云音视频SDK,为视频开发者提供一站式接入服务
 
载入中...
搜索中...
未找到
com.alivc.live.player.AlivcLivePlayInfoListener类 参考abstract

拉流播放通知回调 更多...

类 com.alivc.live.player.AlivcLivePlayInfoListener 继承关系图:

Public 成员函数

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)
 

详细描述

拉流播放通知回调

作者
baorunchen
注意
非互动模式暂不支持该API
日期
2022/8/10
调用示例
mAlivcLivePlayer.setPlayInfoListener(new AlivcLivePlayInfoListener () {});
参见
com.alivc.live.player.AlivcLivePlayer::setPlayInfoListener(AlivcLivePlayInfoListener)

在文件 AlivcLivePlayInfoListener.java25 行定义.

成员函数说明

◆ onAudioFrame()

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

远端拉流音频帧数据回调

参数
audioFrame音频帧数据
返回
true->成功,false->失败
注解
默认关闭,需要通过调用com.alivc.live.pusher.AlivcLivePusher#enableAudioFrameObserver(boolean, AlivcLiveAudioSource, AlivcLiveAudioFrameObserverConfig)开启功能
enableAudioFrameObserver接口传参:(true, AlivcLiveAudioSource.REMOTE_USER, AlivcLiveAudioFrameObserverConfig)
该接口不支持设置采样率、声道数
该接口支持读写模式
注意
请不要在此回调函数中做任何耗时操作,否则可能导致声音异常

在文件 AlivcLivePlayInfoListener.java222 行定义.

◆ onAudioMuted()

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

对端用户静音/取消静音回调

参数
mute是否静音
注解
该回调对应接口:com.alivc.live.pusher.AlivcLivePusher#setMute(boolean)

在文件 AlivcLivePlayInfoListener.java147 行定义.

◆ onAudioSubscribeStateChanged()

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

音频流订阅状态回调

参数
oldState旧的音频流订阅状态
newState新的音频流订阅状态

在文件 AlivcLivePlayInfoListener.java187 行定义.

◆ onError()

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

错误回调

参数
code错误码
msg错误信息

◆ onFirstAudioFrameDecoded()

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

音频首帧解码回调

在文件 AlivcLivePlayInfoListener.java64 行定义.

◆ onFirstAudioFrameReceived()

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

音频首帧接收回调

在文件 AlivcLivePlayInfoListener.java58 行定义.

◆ onFirstVideoFrameDrawn()

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

视频首帧渲染回调

在文件 AlivcLivePlayInfoListener.java76 行定义.

◆ onFirstVideoFrameReceived()

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

视频首帧接收回调

在文件 AlivcLivePlayInfoListener.java70 行定义.

◆ onNetworkQualityChanged()

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

拉流网络状态变化回调

参数
upQuality上行网络质量
downQuality下行网络质量
注解
当对端网络质量发生变化时触发

在文件 AlivcLivePlayInfoListener.java137 行定义.

◆ onPlayerStatistics()

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

拉流统计数据回调

参数
statsInfo统计数据

在文件 AlivcLivePlayInfoListener.java114 行定义.

◆ onPlayoutVolumeUpdate()

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

音频音量

参数
volume混音后的总音量,取值范围:[0, 255]。
isSpeaking是否正在说话
注解
此回调依赖vad功能,需要调用以下接口才会生效:com.alivc.live.pusher.AlivcLivePusher#enableAudioVolumeIndication(int, int, int)

在文件 AlivcLivePlayInfoListener.java97 行定义.

◆ onPlayStarted()

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

开始播放回调

注解
此回调表示播放音视频成功
该回调对应接口:com.alivc.live.player.AlivcLivePlayer#startPlay(String)

◆ onPlayStopped()

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

结束播放回调

注解
此回调表示音视频播放已结束
该回调对应接口:com.alivc.live.player.AlivcLivePlayer#stopPlay()

◆ onReceiveDataChannelMessage()

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

Data Channel 消息接收回调

参数
data消息数据
注解
该回调对应接口:com.alivc.live.pusher.AlivcLivePusher#sendDataChannelMessage(String)

在文件 AlivcLivePlayInfoListener.java177 行定义.

◆ onReceiveSEIMessage()

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

收到媒体扩展信息回调

参数
payloadpayload类型
data媒体扩展信息
注解
该回调对应接口:com.alivc.live.pusher.AlivcLivePusher#sendMessage(String, int, int, boolean)
该回调对应接口:com.alivc.live.pusher.AlivcLivePusher#sendMessage(String, int, int, boolean, int)

在文件 AlivcLivePlayInfoListener.java87 行定义.

◆ onRemoteUserLeave()

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

远端用户离开回调

参数
reason用户离线的原因

在文件 AlivcLivePlayInfoListener.java126 行定义.

◆ onScreenShareSubscribeStateChanged()

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

屏幕共享流订阅状态回调

参数
oldState旧的屏幕共享流订阅状态
newState新的屏幕共享流订阅状态

在文件 AlivcLivePlayInfoListener.java207 行定义.

◆ onVideoEnabled()

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

对端用户打开/关闭视频采集通知

参数
enable是否关闭视频采集
注解
该回调对应接口:com.alivc.live.pusher.AlivcLivePusher#enableLocalCamera(boolean)

在文件 AlivcLivePlayInfoListener.java167 行定义.

◆ onVideoFrame()

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

远端拉流视频帧数据回调

参数
videoFrame视频帧数据
返回
true->成功,false->失败
注解
此回调需要调用 com.alivc.live.pusher.AlivcLivePushConfig#setEnableRemoteVideoFrameCallback(boolean) 接口才会生效

在文件 AlivcLivePlayInfoListener.java234 行定义.

◆ onVideoMuted()

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

对端用户mute/unmute视频通知

参数
mute是否mute视频
注解
该回调对应接口:com.alivc.live.pusher.AlivcLivePusher#muteLocalCamera(boolean)

在文件 AlivcLivePlayInfoListener.java157 行定义.

◆ onVideoResolutionChanged()

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

播放器分辨率变化通知

参数
width视频宽度
height视频高度

在文件 AlivcLivePlayInfoListener.java106 行定义.

◆ onVideoSubscribeStateChanged()

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

视频流订阅状态回调

参数
oldState旧的视频流订阅状态
newState新的视频流订阅状态

在文件 AlivcLivePlayInfoListener.java197 行定义.