AlivcLivePusher_Interactive v6.17.0
Aliyun Live Pusher Interactive SDK API Reference Manual for iOS Platforms
Loading...
Searching...
No Matches
<AliLivePlayerDelegate> Protocol Reference

直播连麦播放回调 More...

#include "AlivcLivePlayer.h"

Inheritance diagram for <AliLivePlayerDelegate>:

Instance Methods

(void) - onAudioMuted:muted:
 静音/取消静音回调
 
(void) - onAudioSubscribeStateChanged:oldState:newState:
 音频流订阅情况变更回调
 
(void) - onError:code:message:
 播放错误回调
 
(void) - onFirstAudioFrameDecoded:
 已解码远端音频首帧回调
 
(void) - onFirstAudioFrameReceived:
 音频首包接收回调
 
(void) - onFirstVideoFrameDrawn:
 视频首帧渲染回调
 
(void) - onFirstVideoFrameReceived:
 视频首包接收回调
 
(void) - onNetworkQualityChanged:upNetworkQuality:downNetworkQuality:
 网络质量变化时发出的消息
 
(void) - onPlayerStatistics:statsInfo:
 播放统计数据回调
 
(void) - onPlayoutVolumeUpdate:volume:speechState:
 播放音量和是否正在说话的反馈回调
 
(void) - onPlayStarted:
 开始播放回调,表示播放音视频成功
 
(void) - onPlayStoped:
 结束播放回调
 
(void) - onReceiveDataChannelMessage:data:
 DataChannel自定义消息回调
 
(void) - onReceiveSeiMessage:payloadType:data:
 SEI回调
 
(void) - onRemoteAudioSampleCallback:audioSample:
 远端拉流数据回调
 
(void) - onRemoteUserLeave:leaveReason:
 远端用户离开
 
(BOOL) - onRemoteVideoSample:videoSample:
 远端视频数据回调
 
(void) - onScreenShareSubscribeStateChanged:oldState:newState:
 屏幕分享流订阅情况变更回调
 
(void) - onSnapshot:image:
 截图回调
 
(void) - onVideoEnabled:enabled:
 对端用户关闭相机流采集发送通知(调用了AlivcLivePusher->enableLocalCamera)
 
(void) - onVideoMuted:muted:
 对端用户打开/关闭视频通知(调用了AlivcLivePusher->muteLocalCamera)
 
(void) - onVideoResolutionChanged:width:height:
 播放器分辨率变化通知
 
(void) - onVideoSubscribeStateChanged:oldState:newState:
 相机流订阅情况变更回调
 

Detailed Description

直播连麦播放回调

Method Documentation

◆ onAudioMuted:muted:

- (void) onAudioMuted: (AlivcLivePlayer *)  player
muted: (BOOL)  isMute 
optional

静音/取消静音回调

Parameters
player连麦播放引擎对象
isMute是否静音
  • YES: 静音
  • NO: 取消静音

◆ onAudioSubscribeStateChanged:oldState:newState:

- (void) onAudioSubscribeStateChanged: (AlivcLivePlayer *)  player
oldState: (AliLiveSubscribeState)  oldState
newState: (AliLiveSubscribeState)  newState 
optional

音频流订阅情况变更回调

Parameters
player连麦播放引擎对象
oldState之前的订阅状态,详见 AliLiveSubscribeState
newState当前的订阅状态,详见 AliLiveSubscribeState

◆ onError:code:message:

- (void) onError: (AlivcLivePlayer *)  player
code: (AlivcLivePlayerError)  code
message: (NSString *)  msg 
optional

播放错误回调

Parameters
player连麦播放引擎对象
code错误码 AlivcLivePlayerError
msg错误信息

◆ onFirstAudioFrameDecoded:

- (void) onFirstAudioFrameDecoded: (AlivcLivePlayer *)  player
optional

已解码远端音频首帧回调

Parameters
player连麦播放引擎对象

◆ onFirstAudioFrameReceived:

- (void) onFirstAudioFrameReceived: (AlivcLivePlayer *)  player
optional

音频首包接收回调

Parameters
player连麦播放引擎对象

◆ onFirstVideoFrameDrawn:

- (void) onFirstVideoFrameDrawn: (AlivcLivePlayer *)  player
optional

视频首帧渲染回调

Parameters
player连麦播放引擎对象

◆ onFirstVideoFrameReceived:

- (void) onFirstVideoFrameReceived: (AlivcLivePlayer *)  player
optional

视频首包接收回调

Parameters
player连麦播放引擎对象

◆ onNetworkQualityChanged:upNetworkQuality:downNetworkQuality:

- (void) onNetworkQualityChanged: (AlivcLivePlayer *)  player
upNetworkQuality: (AlivcLiveNetworkQuality)  upQuality
downNetworkQuality: (AlivcLiveNetworkQuality)  downQuality 
optional

网络质量变化时发出的消息

Parameters
player连麦播放引擎对象
upQuality上行网络质量
downQuality下行网络质量
Note
当对端网络质量发生变化时触发

◆ onPlayerStatistics:statsInfo:

- (void) onPlayerStatistics: (AlivcLivePlayer *)  player
statsInfo: (AlivcLivePlayerStatsInfo *)  statistics 
optional

播放统计数据回调

Parameters
player连麦播放引擎对象
statistics统计数据
Note
statistics中的videoBitrate是总的视频接收码率

◆ onPlayoutVolumeUpdate:volume:speechState:

- (void) onPlayoutVolumeUpdate: (AlivcLivePlayer *)  player
volume: (int)  volume
speechState: (BOOL)  isSpeaking 
optional

播放音量和是否正在说话的反馈回调

Parameters
player连麦播放引擎对象
volume音量大小
isSpeaking是否正在说话

◆ onPlayStarted:

- (void) onPlayStarted: (AlivcLivePlayer *)  player
optional

开始播放回调,表示播放音视频成功

Parameters
player连麦播放引擎对象

◆ onPlayStoped:

- (void) onPlayStoped: (AlivcLivePlayer *)  player
optional

结束播放回调

Parameters
player连麦播放引擎对象

◆ onReceiveDataChannelMessage:data:

- (void) onReceiveDataChannelMessage: (AlivcLivePlayer *)  player
data: (NSData *)  data 
optional

DataChannel自定义消息回调

Parameters
player连麦播放引擎对象
data数据

◆ onReceiveSeiMessage:payloadType:data:

- (void) onReceiveSeiMessage: (AlivcLivePlayer *)  player
payloadType: (int)  payloadType
data: (NSData *)  data 
optional

SEI回调

Parameters
player连麦播放引擎对象
payloadType类型
data数据

◆ onRemoteAudioSampleCallback:audioSample:

- (void) onRemoteAudioSampleCallback: (AlivcLivePlayer *)  player
audioSample: (AlivcLivePusherAudioDataSample *)  audioSample 
optional

远端拉流数据回调

默认关闭,需要通过enableAudioFrameObserver : YES audioSource: AliLiveAudioSourceRemoteUser 开启

  • 该接口支持设置采样率、声道数
  • 该接口支持读写模式
Parameters
pusher推流引擎对象
audioSample音频数据sample, AlivcLivePusherAudioDataSample
Note
请不要在此回调函数中做任何耗时操作,否则可能导致声音异常

◆ onRemoteUserLeave:leaveReason:

- (void) onRemoteUserLeave: (AlivcLivePlayer *)  player
leaveReason: (AliLiveUserOfflineReason)  reason 
optional

远端用户离开

Parameters
player连麦播放引擎对象
reason用户离线的原因,详见AliLiveUserOfflineReason
Note
当前SDK内部在收到远端用户离开消息后,会自动调用AlivcLivePlayer->stopPlay来结束播放,但是在某些特殊场景,不希望SDK内部自动调用结束播放,可以 在AlivcLivePlayConfig中设置autoStoppedPlayWhenUserLeaved为false,SDK内部收到远端用户离开消息后不再自动调用结束播放,需要业务层自行调用stopPlay。

Remote user leaves

Parameters
playerLive interaction player engine object
reasonThe reason why the user is offline, see AliLiveUserOfflineReason for details
Note
After receiving the message that the remote user has left, the current SDK will automatically call AlivcLivePlayer->stopPlay to end playback. However, in some special scenarios, if you do not want the SDK to automatically call to end playback, you can set autoStoppedPlayWhenUserLeaved to false in AlivcLivePlayConfig, SDK After receiving the remote user leave message internally, it will no longer automatically call to end playback. The business layer needs to call stopPlay by itself.

◆ onRemoteVideoSample:videoSample:

- (BOOL) onRemoteVideoSample: (AlivcLivePlayer *)  player
videoSample: (AlivcLiveVideoDataSample *_Nonnull)  videoSample 
optional

远端视频数据回调

Parameters
player连麦播放引擎对象
videoSample视频裸数据
Returns
  • YES: 需要写回SDK
  • NO: 不需要写回SDK
Note
默认不回调,需要通过AlivcLivePushConfig.enableRemoteVideoFrameObserver开启,开启后,可回调远端视频裸数据

◆ onScreenShareSubscribeStateChanged:oldState:newState:

- (void) onScreenShareSubscribeStateChanged: (AlivcLivePlayer *)  player
oldState: (AliLiveSubscribeState)  oldState
newState: (AliLiveSubscribeState)  newState 
optional

屏幕分享流订阅情况变更回调

Parameters
player连麦播放引擎对象
oldState之前的订阅状态,详见 AliLiveSubscribeState
newState当前的订阅状态,详见 AliLiveSubscribeState

◆ onSnapshot:image:

- (void) onSnapshot: (AlivcLivePlayer *)  player
image: (UIImage *)  image 
optional

截图回调

Parameters
player连麦播放引擎对象
image截图

◆ onVideoEnabled:enabled:

- (void) onVideoEnabled: (AlivcLivePlayer *)  player
enabled: (BOOL)  isEnable 
optional

对端用户关闭相机流采集发送通知(调用了AlivcLivePusher->enableLocalCamera)

Parameters
player连麦播放引擎对象
isEnable
  • YES: 打开相机流采集
  • NO: 关闭相机流采集
Note
该接口用于对端用户关闭相机流采集时的回调

◆ onVideoMuted:muted:

- (void) onVideoMuted: (AlivcLivePlayer *)  player
muted: (BOOL)  isMute 
optional

对端用户打开/关闭视频通知(调用了AlivcLivePusher->muteLocalCamera)

Parameters
player连麦播放引擎对象
isMute
  • YES: 关闭视频
  • NO: 打开视频

◆ onVideoResolutionChanged:width:height:

- (void) onVideoResolutionChanged: (AlivcLivePlayer *)  player
width: (int)  width
height: (int)  height 
optional

播放器分辨率变化通知

Parameters
player连麦播放引擎对象
width视频宽。
height视频高。

◆ onVideoSubscribeStateChanged:oldState:newState:

- (void) onVideoSubscribeStateChanged: (AlivcLivePlayer *)  player
oldState: (AliLiveSubscribeState)  oldState
newState: (AliLiveSubscribeState)  newState 
optional

相机流订阅情况变更回调

Parameters
player连麦播放引擎对象
oldState之前的订阅状态,详见 AliLiveSubscribeState
newState当前的订阅状态,详见 AliLiveSubscribeState

The documentation for this protocol was generated from the following file: