com.brightcove.cast.controller

## Class BrightcoveCastMediaManager

- java.lang.Object
- - com.brightcove.player.event.AbstractComponent
  - - com.brightcove.cast.controller.BrightcoveCastMediaManager

- All Implemented Interfaces:
    Component

      @Emits(events={"setMediaInfo","addMediaInfo","setMediaControllerConfig","removeVideoStill","setVideoStill","setSource","pause","stop","play","restoreDefaultMediaController"})
       @ListensFor(events={"completed","didSeekTo","didSetVideo","progress","setSource","play","controlBarCreated","castSessionStarted","castSessionEnded","activityStarted"})
      public class BrightcoveCastMediaManager
      extends AbstractComponent

- - ### Field Summary

    - ### Fields inherited from class com.brightcove.player.event.AbstractComponent

      `eventEmitter, listenerTokens`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BrightcoveCastMediaManager(android.content.Context context, EventEmitter eventEmitter)`
    `BrightcoveCastMediaManager(android.content.Context context, EventEmitter eventEmitter, MediaControllerConfig mediaControllerConfig)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addMediaInfo()`
    `protected void` | `addMediaInfo(com.google.android.gms.cast.MediaInfo mediaInfo)`
    `protected org.json.JSONObject` | `createCastCustomData(CustomData customData, Video video)`
    `void` | `enableCustomData(boolean enableCustomData)` If enabled, custom data is added to the MediaInfo object when sending information to the Cast receiver app.
    `CustomData` | `getCustomData()`
    `boolean` | `isAutoCastIfPlaying()` If enabled, the video playing locally will be automatically loaded to your Chromecast app receiver as soon as you get connected.
    `boolean` | `isCustomDataEnabled()` Whether custom data is enabled or not.
    `boolean` | `isSessionAvailable()`
    `protected void` | `loadMediaInfo()`
    `protected void` | `loadMediaInfo(com.google.android.gms.cast.MediaInfo mediaInfo)`
    `protected void` | `loadMediaInfo(com.google.android.gms.cast.MediaInfo mediaInfo, long positionMs)`
    `protected void` | `onConnectionAvailable(Event event)`
    `protected void` | `onConnectionUnavailable(Event event)`
    `protected void` | `resetToLocalController()`
    `void` | `setAutoCastIfPlaying(boolean autoCastIfPlaying)` If enabled, the video playing locally will be automatically loaded to your Chromecast app receiver as soon as you get connected.
    `void` | `setCustomData(CustomData customData)` The Brightcove `CustomData` to be used when sending custom data to the Cast receiver app.
    `void` | `setQueueingSupported(boolean isQueueingSupported)` Whether queueing is supported in the cast receiver app.
    `protected void` | `setupBrightcoveControlBar(BrightcoveControlBar controlBar)`
    `protected void` | `setupRemoteController()`
    `void` | `updateBrightcoveMediaController(boolean isRemote)`

    - ### Methods inherited from class com.brightcove.player.event.AbstractComponent

      `addListener, addOnceListener, getEventEmitter, removeListener, removeListeners`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BrightcoveCastMediaManager

          public BrightcoveCastMediaManager(android.content.Context context,
                                            EventEmitter eventEmitter)

    - #### BrightcoveCastMediaManager

          public BrightcoveCastMediaManager(android.content.Context context,
                                            EventEmitter eventEmitter,
                                            MediaControllerConfig mediaControllerConfig)

  - ### Method Detail

    - #### isSessionAvailable

          public boolean isSessionAvailable()

    - #### updateBrightcoveMediaController

          public void updateBrightcoveMediaController(boolean isRemote)

    - #### isAutoCastIfPlaying

          public boolean isAutoCastIfPlaying()

      If enabled, the video playing locally will be automatically loaded to your Chromecast app receiver as soon as you get connected.
      Returns:
        true to enable auto cast if playing.

    - #### setAutoCastIfPlaying

          public void setAutoCastIfPlaying(boolean autoCastIfPlaying)

      If enabled, the video playing locally will be automatically loaded to your Chromecast app receiver as soon as you get connected.
      Parameters:
        `autoCastIfPlaying` - true to enable auto cast if playing.

    - #### setCustomData

          public void setCustomData(@Nullable
                                    CustomData customData)

      The Brightcove `CustomData` to be used when sending custom data to the Cast receiver app.

    - #### getCustomData

          @Nullable
          public CustomData getCustomData()

    - #### enableCustomData

          public void enableCustomData(boolean enableCustomData)

      If enabled, custom data is added to the MediaInfo object when sending information to the Cast receiver app. Otherwise, custom data is not added.
      Parameters:
        `enableCustomData` - Whether to enable or disable custom data.

    - #### setQueueingSupported

          public void setQueueingSupported(boolean isQueueingSupported)

      Whether queueing is supported in the cast receiver app. If true, queueing option is not displayer to the user. Otherwise, the is shown.
      Parameters:
        `isQueueingSupported` - Whether queuing is supported in the Cast receiver app.

    - #### isCustomDataEnabled

          public boolean isCustomDataEnabled()

      Whether custom data is enabled or not.

    - #### loadMediaInfo

          protected void loadMediaInfo()

    - #### loadMediaInfo

          protected void loadMediaInfo(@NonNull
                                       com.google.android.gms.cast.MediaInfo mediaInfo)

    - #### loadMediaInfo

          protected void loadMediaInfo(@NonNull
                                       com.google.android.gms.cast.MediaInfo mediaInfo,
                                       long positionMs)

    - #### addMediaInfo

          protected void addMediaInfo()

    - #### addMediaInfo

          protected void addMediaInfo(com.google.android.gms.cast.MediaInfo mediaInfo)

    - #### onConnectionAvailable

          protected void onConnectionAvailable(Event event)

    - #### onConnectionUnavailable

          protected void onConnectionUnavailable(Event event)

    - #### setupRemoteController

          protected void setupRemoteController()

    - #### resetToLocalController

          protected void resetToLocalController()

    - #### setupBrightcoveControlBar

          protected void setupBrightcoveControlBar(BrightcoveControlBar controlBar)

    - #### createCastCustomData

          @Nullable
          protected org.json.JSONObject createCastCustomData(@Nullable
                                                                       CustomData customData,
                                                                       @Nullable
                                                                       Video video)