A wrapper around android.media.MediaPlayer http://developer.android.com/reference/android/media/MediaPlayer.html. More...

Inheritance diagram for com.ooyala.android.player.BaseStreamPlayer:
com.ooyala.android.player.StreamPlayer

Public Member Functions

void init (OoyalaPlayer parent, Set< Stream > streams)
 
void pause ()
 This is called when pause is clicked. More...
 
void play ()
 This is called when play is clicked. More...
 
void stop ()
 This is called when stop is clicked. More...
 
void reset ()
 This is called when plugin should be reset. More...
 
int currentTime ()
 
int duration ()
 
int buffer ()
 
void seekToTime (int timeInMillis)
 Move the playhead to a new location in seconds with millisecond accuracy. More...
 
boolean onError (MediaPlayer mp, int what, int extra)
 
void onPrepared (MediaPlayer mp)
 
void onBufferingUpdate (MediaPlayer mp, int percent)
 
boolean onInfo (MediaPlayer mp, int what, int extra)
 
void onCompletion (MediaPlayer mp)
 
void onVideoSizeChanged (MediaPlayer mp, int width, int height)
 
void surfaceChanged (SurfaceHolder arg0, int arg1, int arg2, int arg3)
 
void surfaceCreated (SurfaceHolder arg0)
 
void surfaceDestroyed (SurfaceHolder arg0)
 
void setParent (OoyalaPlayer parent)
 
void onSeekComplete (MediaPlayer arg0)
 
void suspend ()
 This is called when plugin should be suspended. More...
 
void suspend (boolean onlyRemoveView)
 This is called when plugin should be suspended. More...
 
void resume ()
 This is called when plugin should be resumed. More...
 
void resume (int millisToResume, State stateToResume)
 This is called when plugin should be resumed. More...
 
void destroy ()
 This is called when plugin should be destroyed. More...
 
boolean isPlaying ()
 
SeekStyle getSeekStyle ()
 
void setVolume (float volume)
 Called once when player is created, and whenever setVolume() is called from OoyalaPlayer. More...
 
PlayerType getPlayerType ()
 Get the player's type. More...
 
State getState ()
 This returns the player state. More...
 
OoyalaException getError ()
 
void setError (OoyalaException error)
 
View getView ()
 
OoyalaPlayer getParent ()
 
int getBufferPercentage ()
 
boolean isLiveClosedCaptionsAvailable ()
 Returns if the current player has found live closed caption info in the stream. More...
 
void configurationChanged (Configuration newConfig)
 This method is called when the device configuration changes while your component is running. More...
 
boolean seekable ()
 
int livePlayheadPercentage ()
 
void seekToPercentLive (float percent)
 Seek to the given percent position of scrubber for live stream playback. More...
 
void setClosedCaptionsLanguage (String language)
 Set the displayed closed captions language. More...
 
boolean isMultiAudioAvailable ()
 
void createBitmapScreenshot (final PlayerBitmapListener playerBitmapListener)
 Create the bitmap screenshot of the current video frame. More...
 

Protected Member Functions

void createMediaPlayer ()
 
void currentItemCompleted ()
 
void setState (State state)
 
void startPlayheadTimer ()
 
void stopPlayheadTimer ()
 
void notifyTimeChanged ()
 

Protected Attributes

MediaPlayer _player = null
 
SurfaceHolder _holder = null
 
String _streamUrl = ""
 
int _width = 0
 
int _height = 0
 
Timer _playheadUpdateTimer = null
 
OoyalaPlayer _parent = null
 
OoyalaException _error = null
 The Player's current error if it exists. More...
 
ControlSharingSurfaceView _view = null
 
int _buffer = 0
 
State _state = State.INIT
 

Static Protected Attributes

static final long TIMER_DELAY = 0
 
static final long TIMER_PERIOD = 250
 

Detailed Description

A wrapper around android.media.MediaPlayer http://developer.android.com/reference/android/media/MediaPlayer.html.

For a list of Android supported media formats, see: http://developer.android.com/guide/appendix/media-formats.html

Member Function Documentation

int com.ooyala.android.player.BaseStreamPlayer.buffer ( )
Returns
the buffer percentage (between 0 and 100 inclusive)

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.player.Player.configurationChanged ( Configuration  newConfig)
inherited

This method is called when the device configuration changes while your component is running.

Parameters
newConfigThe new device configuration.

Implements com.ooyala.android.plugin.LifeCycleInterface.

void com.ooyala.android.player.Player.createBitmapScreenshot ( final PlayerBitmapListener  playerBitmapListener)
inherited

Create the bitmap screenshot of the current video frame.

Parameters
playerBitmapListenerthe interface that must be implemented in order to receive bitmap screenshot from Ooyala ExoPlayer

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.player.BaseStreamPlayer.createMediaPlayer ( )
protected
void com.ooyala.android.player.BaseStreamPlayer.currentItemCompleted ( )
protected
int com.ooyala.android.player.BaseStreamPlayer.currentTime ( )
Returns
current time

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.player.BaseStreamPlayer.destroy ( )

This is called when plugin should be destroyed.

Implements com.ooyala.android.plugin.LifeCycleInterface.

int com.ooyala.android.player.BaseStreamPlayer.duration ( )
Returns
duration.

Implements com.ooyala.android.player.PlayerInterface.

int com.ooyala.android.player.Player.getBufferPercentage ( )
inherited
OoyalaException com.ooyala.android.player.Player.getError ( )
inherited
OoyalaPlayer com.ooyala.android.player.Player.getParent ( )
inherited
PlayerType com.ooyala.android.player.BaseStreamPlayer.getPlayerType ( )

Get the player's type.

Implements com.ooyala.android.player.PlayerInterface.

SeekStyle com.ooyala.android.player.BaseStreamPlayer.getSeekStyle ( )
State com.ooyala.android.player.Player.getState ( )
inherited

This returns the player state.

Returns
the state

Implements com.ooyala.android.player.PlayerInterface.

View com.ooyala.android.player.Player.getView ( )
inherited
void com.ooyala.android.player.BaseStreamPlayer.init ( OoyalaPlayer  parent,
Set< Stream streams 
)
boolean com.ooyala.android.player.Player.isLiveClosedCaptionsAvailable ( )
inherited

Returns if the current player has found live closed caption info in the stream.

Returns
true if the stream has embedded live closed captions

Implements com.ooyala.android.player.PlayerInterface.

boolean com.ooyala.android.player.Player.isMultiAudioAvailable ( )
inherited
Returns
true if the current asset has several audio tracks

Implements com.ooyala.android.player.PlayerInterface.

boolean com.ooyala.android.player.BaseStreamPlayer.isPlaying ( )
int com.ooyala.android.player.Player.livePlayheadPercentage ( )
inherited
Returns
the percentage of the cursor should be on scrubber for live stream playback

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.player.StreamPlayer.notifyTimeChanged ( )
protectedinherited
void com.ooyala.android.player.BaseStreamPlayer.onBufferingUpdate ( MediaPlayer  mp,
int  percent 
)
void com.ooyala.android.player.BaseStreamPlayer.onCompletion ( MediaPlayer  mp)
boolean com.ooyala.android.player.BaseStreamPlayer.onError ( MediaPlayer  mp,
int  what,
int  extra 
)
boolean com.ooyala.android.player.BaseStreamPlayer.onInfo ( MediaPlayer  mp,
int  what,
int  extra 
)
void com.ooyala.android.player.BaseStreamPlayer.onPrepared ( MediaPlayer  mp)
void com.ooyala.android.player.BaseStreamPlayer.onSeekComplete ( MediaPlayer  arg0)
void com.ooyala.android.player.BaseStreamPlayer.onVideoSizeChanged ( MediaPlayer  mp,
int  width,
int  height 
)
void com.ooyala.android.player.BaseStreamPlayer.pause ( )

This is called when pause is clicked.

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.player.BaseStreamPlayer.play ( )

This is called when play is clicked.

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.player.BaseStreamPlayer.reset ( )

This is called when plugin should be reset.

Implements com.ooyala.android.plugin.LifeCycleInterface.

void com.ooyala.android.player.BaseStreamPlayer.resume ( )

This is called when plugin should be resumed.

Implements com.ooyala.android.plugin.LifeCycleInterface.

void com.ooyala.android.player.BaseStreamPlayer.resume ( int  timeInMillisecond,
State  stateToResume 
)

This is called when plugin should be resumed.

Parameters
timeInMillisecondthe playhead time to set
stateToResumethe player state after resume

Implements com.ooyala.android.plugin.LifeCycleInterface.

boolean com.ooyala.android.player.Player.seekable ( )
inherited
Returns
true if the current player is seekable, false if there is no current player or it is not seekable

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.player.Player.seekToPercentLive ( float  percent)
inherited

Seek to the given percent position of scrubber for live stream playback.

Parameters
percentThe percent of scrubber the cursor ends after seek

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.player.BaseStreamPlayer.seekToTime ( int  timeInMillis)

Move the playhead to a new location in seconds with millisecond accuracy.

Parameters
timeInMillistime in milliseconds

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.player.Player.setClosedCaptionsLanguage ( String  language)
inherited

Set the displayed closed captions language.

Parameters
language2 letter country code of the language to display or nil to hide closed captions

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.player.Player.setError ( OoyalaException  error)
inherited
void com.ooyala.android.player.BaseStreamPlayer.setParent ( OoyalaPlayer  parent)
void com.ooyala.android.player.BaseStreamPlayer.setState ( State  state)
protected
void com.ooyala.android.player.BaseStreamPlayer.setVolume ( float  volume)

Called once when player is created, and whenever setVolume() is called from OoyalaPlayer.

Parameters
volume

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.player.StreamPlayer.startPlayheadTimer ( )
protectedinherited
void com.ooyala.android.player.BaseStreamPlayer.stop ( )

This is called when stop is clicked.

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.player.StreamPlayer.stopPlayheadTimer ( )
protectedinherited
void com.ooyala.android.player.BaseStreamPlayer.surfaceChanged ( SurfaceHolder  arg0,
int  arg1,
int  arg2,
int  arg3 
)
void com.ooyala.android.player.BaseStreamPlayer.surfaceCreated ( SurfaceHolder  arg0)
void com.ooyala.android.player.BaseStreamPlayer.surfaceDestroyed ( SurfaceHolder  arg0)
void com.ooyala.android.player.BaseStreamPlayer.suspend ( )

This is called when plugin should be suspended.

Implements com.ooyala.android.plugin.LifeCycleInterface.

void com.ooyala.android.player.BaseStreamPlayer.suspend ( boolean  onlyRemoveView)

This is called when plugin should be suspended.

Parameters
onlyRemoveViewTo remove video view

Implements com.ooyala.android.plugin.LifeCycleInterface.

Member Data Documentation

int com.ooyala.android.player.Player._buffer = 0
protectedinherited
OoyalaException com.ooyala.android.player.Player._error = null
protectedinherited

The Player's current error if it exists.

int com.ooyala.android.player.BaseStreamPlayer._height = 0
protected
SurfaceHolder com.ooyala.android.player.BaseStreamPlayer._holder = null
protected
OoyalaPlayer com.ooyala.android.player.Player._parent = null
protectedinherited
MediaPlayer com.ooyala.android.player.BaseStreamPlayer._player = null
protected
Timer com.ooyala.android.player.StreamPlayer._playheadUpdateTimer = null
protectedinherited
State com.ooyala.android.player.Player._state = State.INIT
protectedinherited
String com.ooyala.android.player.BaseStreamPlayer._streamUrl = ""
protected
ControlSharingSurfaceView com.ooyala.android.player.Player._view = null
protectedinherited
int com.ooyala.android.player.BaseStreamPlayer._width = 0
protected
final long com.ooyala.android.player.StreamPlayer.TIMER_DELAY = 0
staticprotectedinherited
final long com.ooyala.android.player.StreamPlayer.TIMER_PERIOD = 250
staticprotectedinherited