Class GoogleCastComponent

java.lang.Object
com.brightcove.player.event.AbstractComponent
com.brightcove.cast.GoogleCastComponent
All Implemented Interfaces:
Component

@Emits(events={"registerPlugin","didPlay","didPause","castSessionStarted","castSessionEnded"}) @ListensFor(events={"activityPaused","activityResumed","fragmentPaused","fragmentResumed","activityDestroyed","fragmentDestroyed","setMediaMetadata","destroyCast","setMediaInfo","addMediaInfo","setMediaQueueItem","addMediaQueueItem","controlBarCreated"}) public class GoogleCastComponent extends AbstractComponent
  • Field Details

  • Constructor Details

    • GoogleCastComponent

      @Deprecated public GoogleCastComponent(EventEmitter emitter, String applicationId, android.content.Context context, boolean autoPlay)
      Parameters:
      emitter - The current event emitter.
      applicationId - The application ID for the receiver application on the Chromecast.
      context - The top-level application context.
      autoPlay - Boolean for deciding whether or not to auto play local playback on return from the Chromecast.
    • GoogleCastComponent

      @Deprecated public GoogleCastComponent(EventEmitter emitter, String applicationId, android.content.Context context)
      Parameters:
      emitter - The current event emitter.
      applicationId - The application ID for the receiver application on the Chromecast.
      context - The top-level application context.
    • GoogleCastComponent

      @Deprecated public GoogleCastComponent(@NonNull EventEmitter emitter, @NonNull android.content.Context context)
      Instantiates a new Google Cast Component.
      Parameters:
      emitter - The current event emitter.
      context - The top-level application context.
    • GoogleCastComponent

      @Deprecated public GoogleCastComponent(@NonNull EventEmitter emitter, @NonNull android.content.Context context, @Nullable BrightcoveCastMediaManager brightcoveCastMediaManager)
      Instantiates a new Google Cast Component.
      Parameters:
      emitter - The current event emitter.
      context - The top-level application context.
      brightcoveCastMediaManager - The Brightcove Cast Media Manager.
  • Method Details

    • loadMediaInfo

      public void loadMediaInfo(com.google.android.gms.cast.MediaInfo mediaInfo)
      Load the Google Cast MediaInfo object.
      Parameters:
      mediaInfo - the media info
    • loadMediaInfo

      public void loadMediaInfo(com.google.android.gms.cast.MediaInfo mediaInfo, long positionMs)
      Load the Google Cast MediaInfo object. This will load and auto play the video by default. To change this, you can set autoPlay to false with setAutoPlay(boolean).
      Parameters:
      mediaInfo - the media info
      positionMs - the position in millis
      See Also:
      • RemoteMediaClient.load(MediaInfo, boolean, long)
    • setAutoPlay

      public void setAutoPlay(boolean autoPlayEnabled)
      Sets auto play. It is enabled by default. This only applies when using loadMediaInfo(MediaInfo) or loadMediaInfo(MediaInfo, long).
      Parameters:
      autoPlayEnabled - true enabled
      See Also:
    • enableCustomData

      public void enableCustomData(boolean enableCustomData)
      Enables/Disables custom data in the current BrightcoveCastMediaManager instance. 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 custom data.
    • setIsQueuingSupported

      public void setIsQueuingSupported(boolean isQueuingSupported)
      Enables/Disables queuing support in the current BrightcoveCastMediaManager instance. If enabled, it is expected that the Receiver will support queuing, and so an Add To Queue menu item will be shown to the user in the play menu when a cast session is in progress. If disabled, it is expected that the Receiver will not support queuing, and so only a Play Now menu item will be shown to the user in the play menu when a cast session is in progress.
      Parameters:
      isQueuingSupported - Whether the receiver is expected to support queuing.
    • setCustomData

      public void setCustomData(CustomData customData)
    • getCustomData

      public CustomData getCustomData()
    • setUpMediaRouteButton

      public static android.view.MenuItem setUpMediaRouteButton(@NonNull android.app.Activity activity, @NonNull android.view.Menu menu)
    • loadItem

      public void loadItem(com.google.android.gms.cast.MediaQueueItem mediaQueue, int playheadPosition)
    • addItems

      public void addItems(com.google.android.gms.cast.MediaQueueItem... mediaQueue)
    • initializeVideoCastManager

      @Deprecated public static void initializeVideoCastManager(android.content.Context context, String applicationId, Class<? extends android.app.Activity> targetActivity)
      Deprecated.
    • isSessionAvailable

      public boolean isSessionAvailable()