-
- All Implemented Interfaces:
-
com.brightcove.player.event.Component
@Emits(events = {EventType.REGISTER_PLUGIN, EventType.DID_PLAY, EventType.DID_PAUSE, GoogleCastEventType.CAST_SESSION_STARTED, GoogleCastEventType.CAST_SESSION_ENDED})@ListensFor(events = {EventType.ACTIVITY_PAUSED, EventType.ACTIVITY_RESUMED, EventType.FRAGMENT_PAUSED, EventType.FRAGMENT_RESUMED, EventType.ACTIVITY_DESTROYED, EventType.FRAGMENT_DESTROYED, GoogleCastEventType.SET_MEDIA_METADATA, GoogleCastEventType.DESTROY_CAST, GoogleCastEventType.LOAD_MEDIA_INFO, GoogleCastEventType.ADD_MEDIA_INFO, GoogleCastEventType.LOAD_MEDIA_QUEUE_ITEM, GoogleCastEventType.ADD_MEDIA_QUEUE_ITEM}) public class GoogleCastComponent extends AbstractComponent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
GoogleCastComponent.Builder
The Builder to create a GoogleCastComponent.
-
Field Summary
Fields Modifier and Type Field Description public final static String
CAST_MEDIA_METADATA_OBJECT
public final static String
CAST_MEDIA_METADATA_SUBTITLE
public final static String
CAST_MEDIA_METADATA_TITLE
public final static String
CAST_MEDIA_METADATA_STUDIO
public final static String
CAST_MEDIA_METADATA_IMAGE_URL
public final static String
CAST_MEDIA_METADATA_BIG_IMAGE_URL
public final static String
CAST_MEDIA_METADATA_URL
public final static String
CAST_MEDIA_METADATA_CONTENT_TYPE
public final static String
CAST_MEDIA_METADATA_VIDEO_ID
public final static String
CAST_MEDIA_INFO
public final static String
CAST_MEDIA_QUEUE_ITEM
public final static String
CAST_MEDIA_PLAY_POSITION
public final static String
CAST_MEDIA_PLAY_POSITION_LONG
public final static String
CAST_PLAYER
public final static String
CAST_MENU
public final static String
CAST_MENU_RESOURCE_ID
public final static String
CAST_MINICONTROLLER
-
Constructor Summary
Constructors Constructor Description GoogleCastComponent(EventEmitter emitter, String applicationId, Context context, boolean autoPlay)
GoogleCastComponent(EventEmitter emitter, String applicationId, Context context)
GoogleCastComponent(EventEmitter emitter, Context context)
Instantiates a new Google Cast Component. GoogleCastComponent(EventEmitter emitter, Context context, BrightcoveCastMediaManager brightcoveCastMediaManager)
Instantiates a new Google Cast Component.
-
Method Summary
Modifier and Type Method Description void
loadMediaInfo(MediaInfo mediaInfo)
Load the Google Cast MediaInfo object. void
loadMediaInfo(MediaInfo mediaInfo, long positionMs)
Load the Google Cast MediaInfo object.This will load and auto play the video by default. void
setAutoPlay(boolean autoPlayEnabled)
Sets auto play.It is enabled by default. void
enableCustomData(boolean enableCustomData)
Enables/Disables custom data in the current BrightcoveCastMediaManager instance. 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 tothe 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 beshown to the user in the play menu when a cast session is in progress. void
setCustomData(CustomData customData)
CustomData
getCustomData()
static MenuItem
setUpMediaRouteButton(@NonNull() Activity activity, @NonNull() Menu menu)
void
loadItem(MediaQueueItem mediaQueue, int playheadPosition)
void
addItems(Array<MediaQueueItem> mediaQueue)
static void
initializeVideoCastManager(Context context, String applicationId, Class<out Activity> targetActivity)
boolean
isSessionAvailable()
-
-
Constructor Detail
-
GoogleCastComponent
GoogleCastComponent(EventEmitter emitter, String applicationId, 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 returnfrom the Chromecast.
-
GoogleCastComponent
GoogleCastComponent(EventEmitter emitter, String applicationId, 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
GoogleCastComponent(EventEmitter emitter, Context context)
Instantiates a new Google Cast Component.- Parameters:
emitter
- The current event emitter.context
- The top-level application context.
-
GoogleCastComponent
GoogleCastComponent(EventEmitter emitter, Context context, 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
void loadMediaInfo(MediaInfo mediaInfo)
Load the Google Cast MediaInfo object.
- Parameters:
mediaInfo
- the media info
-
loadMediaInfo
void loadMediaInfo(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.
- Parameters:
mediaInfo
- the media infopositionMs
- the position in millis
-
setAutoPlay
void setAutoPlay(boolean autoPlayEnabled)
Sets auto play.It is enabled by default.This only applies when using loadMediaInfo or loadMediaInfo.
- Parameters:
autoPlayEnabled
- true enabled
-
enableCustomData
void enableCustomData(boolean enableCustomData)
Enables/Disables custom data in the current BrightcoveCastMediaManager instance. Ifenabled, custom data is added to the MediaInfo object when sending information to the Castreceiver app. Otherwise, custom data is not added.
- Parameters:
enableCustomData
- Whether to enable custom data.
-
setIsQueuingSupported
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 tothe 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 beshown 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
void setCustomData(CustomData customData)
-
getCustomData
CustomData getCustomData()
-
setUpMediaRouteButton
static MenuItem setUpMediaRouteButton(@NonNull() Activity activity, @NonNull() Menu menu)
-
loadItem
void loadItem(MediaQueueItem mediaQueue, int playheadPosition)
-
initializeVideoCastManager
@Deprecated() static void initializeVideoCastManager(Context context, String applicationId, Class<out Activity> targetActivity)
-
isSessionAvailable
boolean isSessionAvailable()
-
-
-
-