Package com.brightcove.cast
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
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Deprecated.static final String
static final String
static final String
Deprecated.static final String
Deprecated.static final String
Deprecated.static final String
Fields inherited from class com.brightcove.player.event.AbstractComponent
eventEmitter, listenerTokens
-
Constructor Summary
ConstructorDescriptionGoogleCastComponent
(EventEmitter emitter, android.content.Context context) Deprecated.GoogleCastComponent
(EventEmitter emitter, android.content.Context context, BrightcoveCastMediaManager brightcoveCastMediaManager) Deprecated.GoogleCastComponent
(EventEmitter emitter, String applicationId, android.content.Context context) Deprecated.GoogleCastComponent
(EventEmitter emitter, String applicationId, android.content.Context context, boolean autoPlay) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addItems
(com.google.android.gms.cast.MediaQueueItem... mediaQueue) void
enableCustomData
(boolean enableCustomData) Enables/Disables custom data in the currentBrightcoveCastMediaManager
instance.static void
initializeVideoCastManager
(android.content.Context context, String applicationId, Class<? extends android.app.Activity> targetActivity) Deprecated.boolean
void
loadItem
(com.google.android.gms.cast.MediaQueueItem mediaQueue, int playheadPosition) void
loadMediaInfo
(com.google.android.gms.cast.MediaInfo mediaInfo) Load the Google Cast MediaInfo object.void
loadMediaInfo
(com.google.android.gms.cast.MediaInfo mediaInfo, long positionMs) Load the Google Cast MediaInfo object.void
setAutoPlay
(boolean autoPlayEnabled) Sets auto play.void
setCustomData
(CustomData customData) void
setIsQueuingSupported
(boolean isQueuingSupported) Enables/Disables queuing support in the currentBrightcoveCastMediaManager
instance.static android.view.MenuItem
setUpMediaRouteButton
(android.app.Activity activity, android.view.Menu menu) Methods inherited from class com.brightcove.player.event.AbstractComponent
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
-
Field Details
-
CAST_MEDIA_METADATA_OBJECT
- See Also:
-
CAST_MEDIA_METADATA_SUBTITLE
- See Also:
-
CAST_MEDIA_METADATA_TITLE
- See Also:
-
CAST_MEDIA_METADATA_STUDIO
- See Also:
-
CAST_MEDIA_METADATA_IMAGE_URL
- See Also:
-
CAST_MEDIA_METADATA_BIG_IMAGE_URL
- See Also:
-
CAST_MEDIA_METADATA_URL
- See Also:
-
CAST_MEDIA_METADATA_CONTENT_TYPE
- See Also:
-
CAST_MEDIA_METADATA_VIDEO_ID
- See Also:
-
CAST_MEDIA_INFO
- See Also:
-
CAST_MEDIA_QUEUE_ITEM
- See Also:
-
CAST_MEDIA_PLAY_POSITION
Deprecated.- See Also:
-
CAST_MEDIA_PLAY_POSITION_LONG
- See Also:
-
CAST_PLAYER
- See Also:
-
CAST_MENU
Deprecated.- See Also:
-
CAST_MENU_RESOURCE_ID
Deprecated.- See Also:
-
CAST_MINICONTROLLER
Deprecated.- See Also:
-
-
Constructor Details
-
GoogleCastComponent
@Deprecated public GoogleCastComponent(EventEmitter emitter, String applicationId, android.content.Context context, boolean autoPlay) Deprecated.- 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) Deprecated.- 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) Deprecated.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) Deprecated.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 withsetAutoPlay(boolean)
.- Parameters:
mediaInfo
- the media infopositionMs
- 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 usingloadMediaInfo(MediaInfo)
orloadMediaInfo(MediaInfo, long)
.- Parameters:
autoPlayEnabled
- true enabled- See Also:
-
enableCustomData
public void enableCustomData(boolean enableCustomData) Enables/Disables custom data in the currentBrightcoveCastMediaManager
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 currentBrightcoveCastMediaManager
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
-
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()
-
GoogleCastComponent.Builder.build()