This class represents the Base Movie Player that plays Freewheel ad spots. More...

Inheritance diagram for com.ooyala.android.freewheelsdk.FWAdPlayer:
com.ooyala.android.player.PlayerInterface com.ooyala.android.plugin.LifeCycleInterface com.ooyala.android.AdsLearnMoreInterface

Public Member Functions

void init (OoyalaFreewheelManager manager, OoyalaPlayer parent, FWAdSpot ad, StateNotifier notifier, FrameLayout layout)
 Initialize everything for the FWAdPlayer. More...
 
void initAd (FWAdSpot ad)
 Initialize the ad of FWAdPlayer. More...
 
void onError ()
 Set state to handle different error situations. More...
 
void processClickThrough ()
 Use Freewheel's renderer controller to send pings and open browser. More...
 
void play ()
 Implements the PlayerInterface method. More...
 
void resume ()
 Implements the LifeCycleInterface method. More...
 
void suspend ()
 Implements the LifeCycleInterface method. More...
 
void suspend (boolean onlyRemoveView)
 This is called when plugin should be suspended. More...
 
void destroy ()
 Implements the LifeCycleInterface method. More...
 
void configurationChanged (Configuration newConfig)
 This method is called when the device configuration changes while your component is running. More...
 
void reset ()
 Implements the LifeCycleInterface method. More...
 
void resume (int timeInMilliSecond, State stateToResume)
 Implements the LifeCycleInterface method. More...
 
void pause ()
 Implements the PlayerInterface method. More...
 
void stop ()
 Implements the PlayerInterface method. More...
 
int currentTime ()
 Implements the the PlayerInterface method. More...
 
int duration ()
 Implements the PlayerInterface method. More...
 
int buffer ()
 Implements the PlayerInterface method. More...
 
boolean seekable ()
 Implements the PlayerInterface method. More...
 
void seekToTime (int timeInMillis)
 Implements the PlayerInterface method. More...
 
State getState ()
 Implements the PlayerInterface method. More...
 
void setVolume (float volume)
 Implements the PlayerInteface setVolume method. More...
 
PlayerType getPlayerType ()
 Get the player's type. More...
 
boolean isMultiAudioAvailable ()
 
void createBitmapScreenshot (PlayerBitmapListener playerBitmapListener)
 
StateNotifier getNotifier ()
 Fetch the StateNotifier of current FWAdPlayer. More...
 
int livePlayheadPercentage ()
 
void seekToPercentLive (float percent)
 Implements the PlayerInterface method. More...
 
boolean isLiveClosedCaptionsAvailable ()
 
void setClosedCaptionsLanguage (String language)
 Set the displayed closed captions language. More...
 
OoyalaException getError ()
 
void createBitmapScreenshot (final PlayerBitmapListener playerBitmapListener)
 Create the bitmap screenshot of the current video frame. More...
 

Protected Member Functions

void setState (State state)
 
void startPlayheadTimer ()
 
void stopPlayheadTimer ()
 

Protected Attributes

Timer _playheadUpdateTimer = null
 

Static Protected Attributes

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

Detailed Description

This class represents the Base Movie Player that plays Freewheel ad spots.

Member Function Documentation

int com.ooyala.android.freewheelsdk.FWAdPlayer.buffer ( )

Implements the PlayerInterface method.

Returns
the buffer percentage (between 0 and 100 inclusive)

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.freewheelsdk.FWAdPlayer.configurationChanged ( Configuration  newConfig)

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.PlayerInterface.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

Implemented in com.ooyala.android.player.exoplayer.ExoStreamPlayer, com.ooyala.android.player.MoviePlayer, and com.ooyala.android.player.Player.

void com.ooyala.android.freewheelsdk.FWAdPlayer.createBitmapScreenshot ( PlayerBitmapListener  playerBitmapListener)
int com.ooyala.android.freewheelsdk.FWAdPlayer.currentTime ( )

Implements the the PlayerInterface method.

Returns
current time

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.freewheelsdk.FWAdPlayer.destroy ( )

Implements the LifeCycleInterface method.

Implements com.ooyala.android.plugin.LifeCycleInterface.

int com.ooyala.android.freewheelsdk.FWAdPlayer.duration ( )

Implements the PlayerInterface method.

Returns
duration

Implements com.ooyala.android.player.PlayerInterface.

OoyalaException com.ooyala.android.freewheelsdk.FWAdPlayer.getError ( )
StateNotifier com.ooyala.android.freewheelsdk.FWAdPlayer.getNotifier ( )

Fetch the StateNotifier of current FWAdPlayer.

Returns
StateNotifier
PlayerType com.ooyala.android.freewheelsdk.FWAdPlayer.getPlayerType ( )

Get the player's type.

Implements com.ooyala.android.player.PlayerInterface.

State com.ooyala.android.freewheelsdk.FWAdPlayer.getState ( )

Implements the PlayerInterface method.

Returns
the state

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.freewheelsdk.FWAdPlayer.init ( OoyalaFreewheelManager  manager,
OoyalaPlayer  parent,
FWAdSpot  ad,
StateNotifier  notifier,
FrameLayout  layout 
)

Initialize everything for the FWAdPlayer.

Parameters
managerthe OoyalaFreewheelManager
parentthe OoyalaPlayer layout
adthe ad to be loaded
notifierthe notifier to be loaded
void com.ooyala.android.freewheelsdk.FWAdPlayer.initAd ( FWAdSpot  ad)

Initialize the ad of FWAdPlayer.

Parameters
adthe ad to be loaded
boolean com.ooyala.android.freewheelsdk.FWAdPlayer.isLiveClosedCaptionsAvailable ( )
Returns
true if the player can support live closed captions

Implements com.ooyala.android.player.PlayerInterface.

boolean com.ooyala.android.freewheelsdk.FWAdPlayer.isMultiAudioAvailable ( )
Returns
true if the current asset has several audio tracks

Implements com.ooyala.android.player.PlayerInterface.

int com.ooyala.android.freewheelsdk.FWAdPlayer.livePlayheadPercentage ( )
Returns
the percentage of the cursor should be on scrubber for live stream playback

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.freewheelsdk.FWAdPlayer.onError ( )

Set state to handle different error situations.

void com.ooyala.android.freewheelsdk.FWAdPlayer.pause ( )

Implements the PlayerInterface method.

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.freewheelsdk.FWAdPlayer.play ( )

Implements the PlayerInterface method.

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.freewheelsdk.FWAdPlayer.processClickThrough ( )

Use Freewheel's renderer controller to send pings and open browser.

Implements com.ooyala.android.AdsLearnMoreInterface.

void com.ooyala.android.freewheelsdk.FWAdPlayer.reset ( )

Implements the LifeCycleInterface method.

Implements com.ooyala.android.plugin.LifeCycleInterface.

void com.ooyala.android.freewheelsdk.FWAdPlayer.resume ( )

Implements the LifeCycleInterface method.

Implements com.ooyala.android.plugin.LifeCycleInterface.

void com.ooyala.android.freewheelsdk.FWAdPlayer.resume ( int  timeInMilliSecond,
State  stateToResume 
)

Implements the LifeCycleInterface method.

Parameters
timeInMilliSecondthe playhead time to set
stateToResumethe player state after resume

Implements com.ooyala.android.plugin.LifeCycleInterface.

boolean com.ooyala.android.freewheelsdk.FWAdPlayer.seekable ( )

Implements the PlayerInterface method.

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.freewheelsdk.FWAdPlayer.seekToPercentLive ( float  percent)

Implements the PlayerInterface method.

Parameters
percentThe percent of scrubber the cursor ends after seek

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.freewheelsdk.FWAdPlayer.seekToTime ( int  timeInMillis)

Implements the PlayerInterface method.

Parameters
timeInMillistime in milliseconds

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.freewheelsdk.FWAdPlayer.setClosedCaptionsLanguage ( String  language)

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.freewheelsdk.FWAdPlayer.setState ( State  state)
protected
void com.ooyala.android.freewheelsdk.FWAdPlayer.setVolume ( float  volume)

Implements the PlayerInteface setVolume method.

Right now this is just a stub method, as it does nothing.

Parameters
volumevalue to change the volume to.

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.freewheelsdk.FWAdPlayer.startPlayheadTimer ( )
protected
void com.ooyala.android.freewheelsdk.FWAdPlayer.stop ( )

Implements the PlayerInterface method.

Implements com.ooyala.android.player.PlayerInterface.

void com.ooyala.android.freewheelsdk.FWAdPlayer.stopPlayheadTimer ( )
protected
void com.ooyala.android.freewheelsdk.FWAdPlayer.suspend ( )

Implements the LifeCycleInterface method.

Implements com.ooyala.android.plugin.LifeCycleInterface.

void com.ooyala.android.freewheelsdk.FWAdPlayer.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

Timer com.ooyala.android.freewheelsdk.FWAdPlayer._playheadUpdateTimer = null
protected
final long com.ooyala.android.freewheelsdk.FWAdPlayer.TIMER_DELAY = 0
staticprotected
final long com.ooyala.android.freewheelsdk.FWAdPlayer.TIMER_PERIOD = 250
staticprotected