public class AlivcLivePlayerImpl extends AlivcLivePlayer
当前仅支持互动模式下的拉流调用,普通模式下的拉流暂且复用以前逻辑!!!
通过AlivcLivePlayer和AlivcLivePlayerImpl来调用,示例如下:
互动直播模式下的拉流: AlivcLivePlayer livePlayer = new AlivcLivePlayerImpl(context, AlivcLiveMode.AlivcLiveInteractiveMode);
Constructor and Description |
---|
AlivcLivePlayerImpl(android.content.Context context,
AlivcLiveMode mode) |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
释放拉流
当前接口只在互动模式下生效!!!
|
AlivcLiveMode |
getMode()
获取当前拉流模式
|
void |
pauseAudioPlaying()
暂停播放音频流
当前接口只在互动模式下生效!!!
|
void |
pauseVideoPlaying()
暂停播放视频流
当前接口只在互动模式下生效!!!
|
void |
resumeAudioPlaying()
恢复播放音频流
当前接口只在互动模式下生效!!!
|
void |
resumeVideoPlaying()
恢复播放视频流
当前接口只在互动模式下生效!!!
|
void |
setPlayInfoListener(AlivcLivePlayInfoListener infoListener)
设置拉流通知事件
当前接口只在互动模式下生效!!!
|
int |
setPlayoutVolume(int volume)
设置播放音量
当前接口只在互动模式下生效!!!
|
int |
setPlayView(android.widget.FrameLayout frameLayout)
设置播放View
当前接口只在互动模式下生效!!!
|
int |
setupWithConfig(AlivcLivePlayConfig playConfig)
初始化配置
|
int |
startPlay(java.lang.String url)
开始播放音视频流
当前接口只在互动模式下生效!!!
|
int |
stopPlay()
停止播放视频流
当前接口只在互动模式下生效!!!
|
public AlivcLivePlayerImpl(android.content.Context context, AlivcLiveMode mode)
public int setupWithConfig(AlivcLivePlayConfig playConfig)
AlivcLivePlayer
setupWithConfig
in class AlivcLivePlayer
playConfig
- 播放配置public void setPlayInfoListener(AlivcLivePlayInfoListener infoListener)
AlivcLivePlayer
当前接口只在互动模式下生效!!!
setPlayInfoListener
in class AlivcLivePlayer
infoListener
- 拉流播放监听器public int setPlayView(android.widget.FrameLayout frameLayout)
AlivcLivePlayer
当前接口只在互动模式下生效!!!
该接口用于设置互动场景下(连麦或者PK)场景下设置远端流的播放控件 在连麦场景下,主播通过setPlayView接口设置连麦观众视频的播放view,连麦观众通过setPlayView接口设置主播的视频播放view 在PK场景下,主播A和主播B PK,主播A和主播B分别调用setPlayView设置要PK的另一个主播的视频播放view
setPlayView
in class AlivcLivePlayer
frameLayout
- 布局,RTC内部创建surfaceView会被add到上面public int startPlay(java.lang.String url)
AlivcLivePlayer
当前接口只在互动模式下生效!!!
该接口用于互动场景下(连麦或者PK)场景下播放连麦观众或者PK主播的音视频流 在连麦场景下,主播通过startPlayWithURL接口播放连麦观众实时音视频流,连麦观众通过startPlayWithURL播放主播实时音视频流 在PK场景下,主播A和主播B PK,主播A和主播B分别调用startPlayWithURL来播放要PK的另一个主播的音视频流
startPlay
in class AlivcLivePlayer
url
- 主播或连麦观众的拉流(播放)地址public int stopPlay()
AlivcLivePlayer
当前接口只在互动模式下生效!!!
该接口和startPlayWithURL接口相对应
stopPlay
in class AlivcLivePlayer
public void pauseAudioPlaying()
AlivcLivePlayer
当前接口只在互动模式下生效!!!
pauseAudioPlaying
in class AlivcLivePlayer
public void resumeAudioPlaying()
AlivcLivePlayer
当前接口只在互动模式下生效!!!
resumeAudioPlaying
in class AlivcLivePlayer
public void pauseVideoPlaying()
AlivcLivePlayer
当前接口只在互动模式下生效!!!
pauseVideoPlaying
in class AlivcLivePlayer
public void resumeVideoPlaying()
AlivcLivePlayer
当前接口只在互动模式下生效!!!
resumeVideoPlaying
in class AlivcLivePlayer
public int setPlayoutVolume(int volume)
AlivcLivePlayer
当前接口只在互动模式下生效!!!
setPlayoutVolume
in class AlivcLivePlayer
volume
- 音量值public void destroy()
AlivcLivePlayer
当前接口只在互动模式下生效!!!
destroy
in class AlivcLivePlayer
public AlivcLiveMode getMode()
AlivcLivePlayer
getMode
in class AlivcLivePlayer
AlivcLiveMode