com.ooyala.cast.CastManager Class Reference

CastManager is singleton. More...

Inheritance diagram for com.ooyala.cast.CastManager:
com.ooyala.android.CastManagerInterface

Classes

class  CastManagerInitializationException
 

Public Member Functions

void setMiniControllerView (View miniControllerViewWeakReference)
 
void setAdditionalInitParams (Map< String, String > params)
 Provide key-value pairs that will be passed to the Receiver upon Cast Playback. More...
 
void destroy ()
 
void setCastView (View view)
 Set the view to display while casting. More...
 
View getCastView ()
 
void hideCastView ()
 Removes viewWeakReference from the OoyalaPlayer, for use after disconnecting from the receiver. More...
 
boolean isConnectedToReceiverApp ()
 
PlayerInterface getCastPlayer ()
 For interacting with the cast playback, even when there is no OoyalaPlayer. More...
 
void registerWithOoyalaPlayer (OoyalaPlayer ooyalaPlayer)
 Connect the CastManager to the OoyalaPlayer instance. More...
 
boolean isInCastMode ()
 
void enterCastMode (CastModeOptions options)
 
final void disconnectDevice ()
 Disconnects from the connected device. More...
 
void onApplicationConnected (CastSession castSession)
 Called when application is connected from remote device. More...
 
void onApplicationDisconnect (CastSession castSession)
 Called when application is disconnected from remote device. More...
 
String getDeviceName ()
 
void deregisterFromOoyalaPlayer ()
 Disconnect the currently registered OoyalaPlayer from the OOCastManager. More...
 

Static Public Member Functions

static void initialize (Context context, String NAMESPACE) throws CastManagerInitializationException
 Set up the CastManager singleton. More...
 
static CastManager getCastManager ()
 

Detailed Description

CastManager is singleton.

It provides enter point for working with cast features.

Member Function Documentation

void com.ooyala.cast.CastManager.deregisterFromOoyalaPlayer ( )

Disconnect the currently registered OoyalaPlayer from the OOCastManager.

The Android Activity making use of Ooyala Casting should call this appropriately e.g. during its own tear-down.

See also
registerWithOoyalaPlayer(com.ooyala.android.OoyalaPlayer)
void com.ooyala.cast.CastManager.destroy ( )
final void com.ooyala.cast.CastManager.disconnectDevice ( )

Disconnects from the connected device.

void com.ooyala.cast.CastManager.enterCastMode ( CastModeOptions  options)
static CastManager com.ooyala.cast.CastManager.getCastManager ( )
static
Returns
the CastManager singleton. Possibly null.
See also
initialize(android.content.Context, String)
PlayerInterface com.ooyala.cast.CastManager.getCastPlayer ( )

For interacting with the cast playback, even when there is no OoyalaPlayer.

Returns
the current CastPlayer. Possibly null.

Implements com.ooyala.android.CastManagerInterface.

View com.ooyala.cast.CastManager.getCastView ( )
Returns
the currently associated View. Possibly null.
See also
setCastView(android.view.View) the view that is displayed during Cast playback
String com.ooyala.cast.CastManager.getDeviceName ( )
void com.ooyala.cast.CastManager.hideCastView ( )

Removes viewWeakReference from the OoyalaPlayer, for use after disconnecting from the receiver.

static void com.ooyala.cast.CastManager.initialize ( Context  context,
String  NAMESPACE 
) throws CastManagerInitializationException
static

Set up the CastManager singleton.

Parameters
contextan Android context. Non-null.
NAMESPACEthe name of namespace for custom event bus
Exceptions
CastManagerInitializationExceptionif initialization fails.
boolean com.ooyala.cast.CastManager.isConnectedToReceiverApp ( )
Returns
true if the CastManager is connected to a receiver app (e.g. on a networked Chromecast box), even if casting has not actually begun.

Implements com.ooyala.android.CastManagerInterface.

boolean com.ooyala.cast.CastManager.isInCastMode ( )
void com.ooyala.cast.CastManager.onApplicationConnected ( CastSession  castSession)

Called when application is connected from remote device.

Parameters
castSessioncurrent session which is connected
void com.ooyala.cast.CastManager.onApplicationDisconnect ( CastSession  castSession)

Called when application is disconnected from remote device.

Parameters
castSessioncurrent session which is disconnected
void com.ooyala.cast.CastManager.registerWithOoyalaPlayer ( OoyalaPlayer  ooyalaPlayer)

Connect the CastManager to the OoyalaPlayer instance.

Must be called before setting the embed code of the video asset on the OoyalaPlayer instance.

Parameters
ooyalaPlayermust not be null.
See also
deregisterFromOoyalaPlayer()

Implements com.ooyala.android.CastManagerInterface.

void com.ooyala.cast.CastManager.setAdditionalInitParams ( Map< String, String >  params)

Provide key-value pairs that will be passed to the Receiver upon Cast Playback.

Anything added to this will overwrite anything set by default in the init.

Parameters
paramsthe set of key/values that will be added to the Receiver on Init
void com.ooyala.cast.CastManager.setCastView ( View  view)

Set the view to display while casting.

Parameters
viewto display in the video area while casting. Possibly null.
See also
getCastView()
void com.ooyala.cast.CastManager.setMiniControllerView ( View  miniControllerViewWeakReference)