public interface VdoPlayer
The VdoPlayer instance returned in VdoPlayer.InitializationListener.onInitializationSuccess(com.vdocipher.aegis.player.VdoPlayer.PlayerHost, com.vdocipher.aegis.player.VdoPlayer, boolean) can be
used to load media and control playback.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
VdoPlayer.InitializationListener
Interface for callbacks related to initialization of a VdoPlayer.
|
static interface |
VdoPlayer.PlaybackEventListener
Interface for callbacks related to playback events.
|
static interface |
VdoPlayer.PlayerHost
Interface for classes that can provide a VdoPlayer instance to load media and control playback.
|
static class |
VdoPlayer.PlayerHostNotReadyException
Thrown when
VdoPlayer.PlayerHost.getPlayer() is called on an uninitialized PlayerHost or if the hosted
VdoPlayer has been released. |
static class |
VdoPlayer.VdoInitParams
Initialization parameters specifying a media with other options that can be loaded
to a VdoPlayer for playback.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
STATE_BUFFERING
The player needs more data to be loaded to be ready to play or resume playback.
|
static int |
STATE_ENDED
The player has finished playing all the media enqueued.
|
static int |
STATE_IDLE
No media is currently queued for playback.
|
static int |
STATE_READY
The player is able to immediately play from the current position.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPlaybackEventListener(VdoPlayer.PlaybackEventListener listener)
Register callbacks for playback events from this VdoPlayer
|
Track[] |
getAvailableTracks()
Returns the available tracks for the currently playing media.
|
long |
getBufferedTime()
Gets the time till which video is buffered
|
MediaInfo |
getCurrentMedia()
Returns a
MediaInfo object containing info corresponding to the currently playing media. |
long |
getCurrentTime()
Gets the current playback time of the video from the beginning.
|
long |
getDuration()
Gets the duration of the current video.
|
java.lang.Object |
getPlaybackProperty(java.lang.String propertyName)
Returns values of additional properties specific to current playback session.
|
float |
getPlaybackSpeed()
Returns the currently active playback speed.
|
int |
getPlaybackState()
Returns the current state of the player.
|
boolean |
getPlayWhenReady()
Whether playback will proceed when
getPlaybackState() == STATE_READY. |
Track[] |
getSelectedTracks()
Returns the selected tracks for the currently playing media.
|
boolean |
isAdaptive()
Returns if the current playback is adaptive.
|
boolean |
isSpeedControlSupported()
Returns if the current player supports changing the playback speed.
|
void |
load(VdoPlayer.VdoInitParams vdoParams)
Immediately starts loading a media for the player to play.
|
void |
release()
Release system resources used by this VdoPlayer.
|
void |
removePlaybackEventListener(VdoPlayer.PlaybackEventListener listener)
Remove a registered playback event listener from this VdoPlayer
|
void |
seekTo(long timeInMillis)
Seeks to a particular time in the video.
|
void |
setPlaybackSpeed(float speed)
Sets the playback speed.
|
void |
setPlayWhenReady(boolean playWhenReady)
Sets whether playback should proceed when
getPlaybackState() == STATE_READY. |
void |
setSelectedTracks(Track[] tracks)
Sets a fixed (non-adaptive) selection of tracks.
|
void |
stop()
Stops the currently loaded video.
|
static final int STATE_IDLE
static final int STATE_BUFFERING
static final int STATE_READY
getPlayWhenReady() returns true, and paused otherwise.static final int STATE_ENDED
int getPlaybackState()
STATE_IDLE, STATE_BUFFERING, STATE_READY, STATE_ENDED.void setPlayWhenReady(boolean playWhenReady)
getPlaybackState() == STATE_READY.
If the player is already in the ready state then this method can be used to pause and resume
playback.playWhenReady - Whether playback should proceed when ready.boolean getPlayWhenReady()
getPlaybackState() == STATE_READY.void load(VdoPlayer.VdoInitParams vdoParams)
vdoParams - parameters for the playbacklong getCurrentTime()
long getBufferedTime()
long getDuration()
boolean isSpeedControlSupported()
void setPlaybackSpeed(float speed)
VdoPlayer.PlaybackEventListener.onPlaybackSpeedChanged(float) will be called when the currently
active playback speed changes.speed - factor by which playback speed should be changedfloat getPlaybackSpeed()
void release()
void seekTo(long timeInMillis)
timeInMillis - time in millisecondsvoid addPlaybackEventListener(VdoPlayer.PlaybackEventListener listener)
listener - listener for the callbackvoid removePlaybackEventListener(VdoPlayer.PlaybackEventListener listener)
listener - the listener to removevoid stop()
Track[] getAvailableTracks()
Track[] getSelectedTracks()
void setSelectedTracks(Track[] tracks)
tracks - the tracks to selectboolean isAdaptive()
MediaInfo getCurrentMedia()
MediaInfo object containing info corresponding to the currently playing media.MediaInfo object corresponding to currently playing media, or null if no media is loadedjava.lang.Object getPlaybackProperty(java.lang.String propertyName)
Integer.propertyName - name of desired property