Class 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 Detail

      • CAST_MEDIA_METADATA_OBJECT

        public static final java.lang.String CAST_MEDIA_METADATA_OBJECT
        See Also:
        Constant Field Values
      • CAST_MEDIA_METADATA_SUBTITLE

        public static final java.lang.String CAST_MEDIA_METADATA_SUBTITLE
        See Also:
        Constant Field Values
      • CAST_MEDIA_METADATA_TITLE

        public static final java.lang.String CAST_MEDIA_METADATA_TITLE
        See Also:
        Constant Field Values
      • CAST_MEDIA_METADATA_STUDIO

        public static final java.lang.String CAST_MEDIA_METADATA_STUDIO
        See Also:
        Constant Field Values
      • CAST_MEDIA_METADATA_IMAGE_URL

        public static final java.lang.String CAST_MEDIA_METADATA_IMAGE_URL
        See Also:
        Constant Field Values
      • CAST_MEDIA_METADATA_BIG_IMAGE_URL

        public static final java.lang.String CAST_MEDIA_METADATA_BIG_IMAGE_URL
        See Also:
        Constant Field Values
      • CAST_MEDIA_METADATA_URL

        public static final java.lang.String CAST_MEDIA_METADATA_URL
        See Also:
        Constant Field Values
      • CAST_MEDIA_METADATA_CONTENT_TYPE

        public static final java.lang.String CAST_MEDIA_METADATA_CONTENT_TYPE
        See Also:
        Constant Field Values
      • CAST_MEDIA_METADATA_VIDEO_ID

        public static final java.lang.String CAST_MEDIA_METADATA_VIDEO_ID
        See Also:
        Constant Field Values
      • CAST_MEDIA_QUEUE_ITEM

        public static final java.lang.String CAST_MEDIA_QUEUE_ITEM
        See Also:
        Constant Field Values
      • CAST_MEDIA_PLAY_POSITION

        @Deprecated
        public static final java.lang.String CAST_MEDIA_PLAY_POSITION
        Deprecated.
        See Also:
        Constant Field Values
      • CAST_MEDIA_PLAY_POSITION_LONG

        public static final java.lang.String CAST_MEDIA_PLAY_POSITION_LONG
        See Also:
        Constant Field Values
      • CAST_MENU

        @Deprecated
        public static final java.lang.String CAST_MENU
        Deprecated.
        See Also:
        Constant Field Values
      • CAST_MENU_RESOURCE_ID

        @Deprecated
        public static final java.lang.String CAST_MENU_RESOURCE_ID
        Deprecated.
        See Also:
        Constant Field Values
      • CAST_MINICONTROLLER

        @Deprecated
        public static final java.lang.String CAST_MINICONTROLLER
        Deprecated.
        See Also:
        Constant Field Values
    • Constructor Detail

      • GoogleCastComponent

        @Deprecated
        public GoogleCastComponent​(EventEmitter emitter,
                                   java.lang.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,
                                   java.lang.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 Detail

      • 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)
      • 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,
                                                      java.lang.String applicationId,
                                                      java.lang.Class<? extends android.app.Activity> targetActivity)
        Deprecated.
      • isSessionAvailable

        public boolean isSessionAvailable()