直播连麦播放回调
More...
#include "AlivcLivePlayer.h"
◆ onAudioMuted:muted:
静音/取消静音回调
- Parameters
-
player | 连麦播放引擎对象 |
isMute | 是否静音
|
◆ 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 |
◆ onFirstAudioFrameDecoded:
◆ onFirstAudioFrameReceived:
◆ onFirstVideoFrameDrawn:
◆ onFirstVideoFrameReceived:
◆ onNetworkQualityChanged:upNetworkQuality:downNetworkQuality:
- (void) onNetworkQualityChanged: |
|
(AlivcLivePlayer *) |
player |
upNetworkQuality: |
|
(AlivcLiveNetworkQuality) |
upQuality |
downNetworkQuality: |
|
(AlivcLiveNetworkQuality) |
downQuality |
|
|
| |
|
optional |
网络质量变化时发出的消息
- Parameters
-
player | 连麦播放引擎对象 |
upQuality | 上行网络质量 |
downQuality | 下行网络质量 |
- Note
- 当对端网络质量发生变化时触发
◆ onPlayerStatistics:statsInfo:
播放统计数据回调
- 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:
开始播放回调,表示播放音视频成功
- Parameters
-
◆ onPlayStoped:
◆ onReceiveDataChannelMessage:data:
- (void) onReceiveDataChannelMessage: |
|
(AlivcLivePlayer *) |
player |
data: |
|
(NSData *) |
data |
|
|
| |
|
optional |
DataChannel自定义消息回调
- Parameters
-
◆ onReceiveSeiMessage:payloadType:data:
- (void) onReceiveSeiMessage: |
|
(AlivcLivePlayer *) |
player |
payloadType: |
|
(int) |
payloadType |
data: |
|
(NSData *) |
data |
|
|
| |
|
optional |
SEI回调
- Parameters
-
player | 连麦播放引擎对象 |
payloadType | 类型 |
data | 数据 |
◆ onRemoteAudioSampleCallback:audioSample:
远端拉流数据回调
默认关闭,需要通过enableAudioFrameObserver : YES audioSource: AliLiveAudioSourceRemoteUser 开启
- Parameters
-
- 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
-
player | Live interaction player engine object |
reason | The 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:
远端视频数据回调
- 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:
◆ onVideoEnabled:enabled:
- (void) onVideoEnabled: |
|
(AlivcLivePlayer *) |
player |
enabled: |
|
(BOOL) |
isEnable |
|
|
| |
|
optional |
对端用户关闭相机流采集发送通知(调用了AlivcLivePusher->enableLocalCamera)
- Parameters
-
- Note
- 该接口用于对端用户关闭相机流采集时的回调
◆ onVideoMuted:muted:
对端用户打开/关闭视频通知(调用了AlivcLivePusher->muteLocalCamera)
- Parameters
-
◆ 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: