AliVCSDK  6.0.0
阿里云音视频SDK,为视频开发者提供一站式接入服务
com.alivc.live.player.AlivcLivePlayer Class Referenceabstract

Live play abstract class. More...

Inheritance diagram for com.alivc.live.player.AlivcLivePlayer:
com.alivc.live.player.AlivcLivePlayerImpl

Public Member Functions

 AlivcLivePlayer (Context context, AlivcLiveMode mode)
 
abstract int setupWithConfig (AlivcLivePlayConfig playConfig)
 
abstract void setPlayInfoListener (AlivcLivePlayInfoListener infoListener)
 
abstract int setPlayView (FrameLayout frameLayout)
 
abstract int startPlay (String url)
 
abstract int stopPlay ()
 
abstract void pauseAudioPlaying ()
 
abstract void resumeAudioPlaying ()
 
abstract void pauseVideoPlaying ()
 
abstract void resumeVideoPlaying ()
 
abstract int setPlayoutVolume (int volume)
 
abstract void destroy ()
 
abstract AlivcLiveMode getMode ()
 

Detailed Description

Live play abstract class.

Author
baorunchen
Date
2022/8/14
Note
Now can only support interactive mode
Call Rule
When used in the interactive mode, you need to push first; when streaming push callback 'onFirstFramePushed', then use playing.
Call Example
AlivcLivePlayer livePlayer = new AlivcLivePlayerImpl(context, AlivcLiveMode.AlivcLiveInteractiveMode);
See also
com.alivc.live.player.AlivcLivePlayerImpl
com.alivc.live.annotations.AlivcLiveMode
AliLive Push SDK Doc
AliLive Push SDK Interactive Doc
AliLive Push SDK License Doc

Definition at line 27 of file AlivcLivePlayer.java.

Constructor & Destructor Documentation

com.alivc.live.player.AlivcLivePlayer.AlivcLivePlayer ( Context  context,
AlivcLiveMode  mode 
)

instance construct

Parameters
contextandroid context
modelive mode

Definition at line 37 of file AlivcLivePlayer.java.

Member Function Documentation

abstract void com.alivc.live.player.AlivcLivePlayer.destroy ( )
abstract

destroy player

abstract AlivcLiveMode com.alivc.live.player.AlivcLivePlayer.getMode ( )
abstract

Get the mode of live player

Returns
live player mode
See also
com.alivc.live.annotations.AlivcLiveMode
abstract void com.alivc.live.player.AlivcLivePlayer.pauseAudioPlaying ( )
abstract

pause audio playing

Note
This interface corresponds to the 'resumeAudioPlaying' interface
abstract void com.alivc.live.player.AlivcLivePlayer.pauseVideoPlaying ( )
abstract

pause video playing

Note
This interface corresponds to the 'resumeVideoPlaying' interface
abstract void com.alivc.live.player.AlivcLivePlayer.resumeAudioPlaying ( )
abstract

resume audio playing

Note
This interface corresponds to the 'pauseAudioPlaying' interface
abstract void com.alivc.live.player.AlivcLivePlayer.resumeVideoPlaying ( )
abstract

resume video playing

Note
This interface corresponds to the 'pauseVideoPlaying' interface
abstract void com.alivc.live.player.AlivcLivePlayer.setPlayInfoListener ( AlivcLivePlayInfoListener  infoListener)
abstract

set play info listener

Parameters
infoListenerplay info listener
See also
com.alivc.live.player.AlivcLivePlayInfoListener
abstract int com.alivc.live.player.AlivcLivePlayer.setPlayoutVolume ( int  volume)
abstract

set play volume

Parameters
volumeplay volume
Returns
0->success; others->failed
abstract int com.alivc.live.player.AlivcLivePlayer.setPlayView ( FrameLayout  frameLayout)
abstract

set play view

Parameters
frameLayoutframeLayout
Returns
0->success; others->failed
Note
In the interactive mode, the SurfaceView is created internally, and add it to the frameLayout.
This interface is used to set playback controls for remote streams in interactive scenarios (connected microphone or PK)
In the connected microphone scenario, the anchor sets the play view of the connected remote audience through this interface, and the connected remote audience sets the play view of the anchor through this interface too.
In the PK scenario, the anchor A sets the play view of the anchor B through this interface, and the anchor B sets the play view of the anchor A through this interface too.
abstract int com.alivc.live.player.AlivcLivePlayer.setupWithConfig ( AlivcLivePlayConfig  playConfig)
abstract

setup with play config

Parameters
playConfigplay config
Returns
0->success; others->failed
See also
com.alivc.live.player.AlivcLivePlayConfig
abstract int com.alivc.live.player.AlivcLivePlayer.startPlay ( String  url)
abstract

start play remote stream

Parameters
urlanchor or connected audience pull url
Returns
0->success; others->failed
Note
This interface is used to play remote streams in interactive scenarios (connected microphone or PK)
In the connected microphone scenario, the anchor plays remote stream of the connected remote audience through this interface, and the connected remote audience plays remote stream of the anchor through this interface too.
In the PK scenario, the anchor A plays remote stream of the anchor B through this interface, and the anchor B plays remote stream of the anchor A through this interface too.
abstract int com.alivc.live.player.AlivcLivePlayer.stopPlay ( )
abstract

stop play remote stream

Returns
0->success; others->failed
Note
This interface corresponds to the 'startPlayWithURL' interface