Package com.qingcloud.vod.player
Class QCPlayer
- java.lang.Object
-
- com.qingcloud.vod.player.QCPlayer
-
public class QCPlayer extends java.lang.Object
The type Qc player. 纯视频播放器视图类 ,该类只针对视频进行解码,并渲染视频每一帧到界面上,无任何控制器界面,如需定制自己的控制器类,可基于该类进行开发。
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
QCPlayer.FloatWindowEventListener
The interface Float window event listener.static interface
QCPlayer.OnCompletionListener
The interface On completion listener.static interface
QCPlayer.OnPreparedListener
The interface On prepared listener.static interface
QCPlayer.OnPreparingListener
The interface On preparing listener.
-
Constructor Summary
Constructors Constructor Description QCPlayer(android.content.Context context)
初始化一个QCPlayer类.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canPause()
Can pause boolean.boolean
canSeekBackward()
Can seek backward boolean.boolean
canSeekForward()
Can seek forward boolean.void
changeItemUrls(int index)
Change item urls.void
enableCodec(boolean enable)
Enable codec.void
enterTinyWindow()
Enter tiny window.void
exitTinyWindow()
Exit tiny window.int
getBufferPercentage()
Gets buffer percentage.int
getCurrentPosition()
Gets current position.int
getCurrentState()
Gets current state.int
getDuration()
Gets duration.android.graphics.Bitmap
getFrameScreenShot()
Gets frame screen shot.int
getMaxVolume()
Gets max volume.android.view.View
getRenderUIView()
Gets render ui view.float
getSpeed(float speed)
Gets speed.long
getTcpSpeed()
Gets tcp speed.int
getVolume()
Gets volume.boolean
isBufferingPaused()
Is buffering paused boolean.boolean
isBufferingPlaying()
Is buffering playing boolean.boolean
isCodecEnable()
Is codec enable boolean.boolean
isCompleted()
Is completed boolean.boolean
isError()
Is error boolean.boolean
isIdle()
Is idle boolean.boolean
isPaused()
Is paused boolean.boolean
isPlaying()
Is playing boolean.boolean
isPrepared()
Is prepared boolean.boolean
isPreparing()
Is preparing boolean.void
pause()
Pause.void
play()
Play.int
playerItemPlayIndex()
Player item play index int.java.util.List<QCPlayerURL>
playerItemUrls()
Player item urls list.void
playWithItem(QCPlayerItem item)
Play with item.void
release(boolean cleartargetstate)
Release.void
releaseWithoutStop()
Release without stop.void
restart()
Restart.void
resume()
Resume.void
seekTo(long ms)
Seek to.void
setOnCompletionListener(QCPlayer.OnCompletionListener listener)
Register a callback to be invoked when the end of a media file has been reached during playback.void
setOnErrorListener(com.qingcloud.vod.player.QCPlayer.OnErrorListener listener)
Register a callback to be invoked when an error occurs during playback or setup.void
setOnFloatWindowEventListener(QCPlayer.FloatWindowEventListener l)
Register a callback to monitor FloatWindow Eventvoid
setOnInfoListener(com.qingcloud.vod.player.QCPlayer.OnInfoListener listener)
Register a callback to be invoked when an informational event occurs during playback or setup.void
setOnPreparedListener(QCPlayer.OnPreparedListener listener)
Register a callback to be invoked when the media file is loaded and ready to go.void
setOnPreparingListener(QCPlayer.OnPreparingListener listener)
Register a callback to be invoked when the media player is preparing to load media file.void
setOnVideoSizeChangedListener(com.qingcloud.vod.player.QCPlayer.OnVideoSizeChangedListener listener)
Register a callback to be invoked when video size changed event occurs during playback or setup.void
setSpeed(float speed)
Sets speed.void
setVolume(int volume)
Sets volume.void
start(long position)
Start.void
suspend()
Suspend.
-
-
-
Method Detail
-
getRenderUIView
public android.view.View getRenderUIView()
Gets render ui view.- Returns:
- the render ui view
-
getCurrentState
public int getCurrentState()
Gets current state.- Returns:
- the current state
-
setOnPreparingListener
public void setOnPreparingListener(QCPlayer.OnPreparingListener listener)
Register a callback to be invoked when the media player is preparing to load media file.- Parameters:
listener
- The callback that will be run
-
setOnPreparedListener
public void setOnPreparedListener(QCPlayer.OnPreparedListener listener)
Register a callback to be invoked when the media file is loaded and ready to go.- Parameters:
listener
- The callback that will be run
-
setOnCompletionListener
public void setOnCompletionListener(QCPlayer.OnCompletionListener listener)
Register a callback to be invoked when the end of a media file has been reached during playback.- Parameters:
listener
- The callback that will be run
-
setOnErrorListener
public void setOnErrorListener(com.qingcloud.vod.player.QCPlayer.OnErrorListener listener)
Register a callback to be invoked when an error occurs during playback or setup. If no listener is specified, or if the listener returned false, VideoView will inform the user of any errors.- Parameters:
listener
- The callback that will be run
-
setOnInfoListener
public void setOnInfoListener(com.qingcloud.vod.player.QCPlayer.OnInfoListener listener)
Register a callback to be invoked when an informational event occurs during playback or setup.- Parameters:
listener
- The callback that will be run
-
setOnVideoSizeChangedListener
public void setOnVideoSizeChangedListener(com.qingcloud.vod.player.QCPlayer.OnVideoSizeChangedListener listener)
Register a callback to be invoked when video size changed event occurs during playback or setup.- Parameters:
listener
- The callback that will be run
-
playWithItem
public void playWithItem(QCPlayerItem item)
Play with item.- Parameters:
item
- the item
-
releaseWithoutStop
public void releaseWithoutStop()
Release without stop.
-
release
public void release(boolean cleartargetstate)
Release.- Parameters:
cleartargetstate
- the cleartargetstate
-
play
public void play()
Play.
-
pause
public void pause()
Pause.
-
suspend
public void suspend()
Suspend.
-
resume
public void resume()
Resume.
-
getDuration
public int getDuration()
Gets duration.- Returns:
- the duration
-
getCurrentPosition
public int getCurrentPosition()
Gets current position.- Returns:
- the current position
-
seekTo
public void seekTo(long ms)
Seek to.- Parameters:
ms
- the ms
-
isIdle
public boolean isIdle()
Is idle boolean.- Returns:
- the boolean
-
isPreparing
public boolean isPreparing()
Is preparing boolean.- Returns:
- the boolean
-
isPrepared
public boolean isPrepared()
Is prepared boolean.- Returns:
- the boolean
-
isBufferingPlaying
public boolean isBufferingPlaying()
Is buffering playing boolean.- Returns:
- the boolean
-
isBufferingPaused
public boolean isBufferingPaused()
Is buffering paused boolean.- Returns:
- the boolean
-
isPlaying
public boolean isPlaying()
Is playing boolean.- Returns:
- the boolean
-
isPaused
public boolean isPaused()
Is paused boolean.- Returns:
- the boolean
-
isError
public boolean isError()
Is error boolean.- Returns:
- the boolean
-
isCompleted
public boolean isCompleted()
Is completed boolean.- Returns:
- the boolean
-
getBufferPercentage
public int getBufferPercentage()
Gets buffer percentage.- Returns:
- the buffer percentage
-
canPause
public boolean canPause()
Can pause boolean.- Returns:
- the boolean
-
canSeekBackward
public boolean canSeekBackward()
Can seek backward boolean.- Returns:
- the boolean
-
canSeekForward
public boolean canSeekForward()
Can seek forward boolean.- Returns:
- the boolean
-
start
public void start(long position)
Start.- Parameters:
position
- the position
-
restart
public void restart()
Restart.
-
setVolume
public void setVolume(int volume)
Sets volume.- Parameters:
volume
- the volume
-
setSpeed
public void setSpeed(float speed)
Sets speed.- Parameters:
speed
- the speed
-
getMaxVolume
public int getMaxVolume()
Gets max volume.- Returns:
- the max volume
-
getVolume
public int getVolume()
Gets volume.- Returns:
- the volume
-
getFrameScreenShot
public android.graphics.Bitmap getFrameScreenShot()
Gets frame screen shot.- Returns:
- the frame screen shot
-
getSpeed
public float getSpeed(float speed)
Gets speed.- Parameters:
speed
- the speed- Returns:
- the speed
-
getTcpSpeed
public long getTcpSpeed()
Gets tcp speed.- Returns:
- the tcp speed
-
enableCodec
public void enableCodec(boolean enable)
Enable codec.- Parameters:
enable
- the enable
-
isCodecEnable
public boolean isCodecEnable()
Is codec enable boolean.- Returns:
- the boolean
-
changeItemUrls
public void changeItemUrls(int index)
Change item urls.- Parameters:
index
- the index
-
playerItemUrls
public java.util.List<QCPlayerURL> playerItemUrls()
Player item urls list.- Returns:
- the list
-
playerItemPlayIndex
public int playerItemPlayIndex()
Player item play index int.- Returns:
- the int
-
setOnFloatWindowEventListener
public void setOnFloatWindowEventListener(QCPlayer.FloatWindowEventListener l)
Register a callback to monitor FloatWindow Event- Parameters:
l
- The callback that will be run
-
enterTinyWindow
public void enterTinyWindow()
Enter tiny window.
-
exitTinyWindow
public void exitTinyWindow()
Exit tiny window.
-
-