@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
Modifier and Type | Class and Description |
---|---|
static class |
GoogleCastComponent.Builder
The Builder to create a
GoogleCastComponent . |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CAST_MEDIA_INFO |
static java.lang.String |
CAST_MEDIA_METADATA_BIG_IMAGE_URL |
static java.lang.String |
CAST_MEDIA_METADATA_CONTENT_TYPE |
static java.lang.String |
CAST_MEDIA_METADATA_IMAGE_URL |
static java.lang.String |
CAST_MEDIA_METADATA_OBJECT |
static java.lang.String |
CAST_MEDIA_METADATA_STUDIO |
static java.lang.String |
CAST_MEDIA_METADATA_SUBTITLE |
static java.lang.String |
CAST_MEDIA_METADATA_TITLE |
static java.lang.String |
CAST_MEDIA_METADATA_URL |
static java.lang.String |
CAST_MEDIA_METADATA_VIDEO_ID |
static java.lang.String |
CAST_MEDIA_PLAY_POSITION |
static java.lang.String |
CAST_MEDIA_QUEUE_ITEM |
static java.lang.String |
CAST_MENU
Deprecated.
|
static java.lang.String |
CAST_MENU_RESOURCE_ID
Deprecated.
|
static java.lang.String |
CAST_MINICONTROLLER
Deprecated.
|
static java.lang.String |
CAST_PLAYER |
eventEmitter, listenerTokens
Constructor and Description |
---|
GoogleCastComponent(EventEmitter emitter,
android.content.Context context)
Deprecated.
|
GoogleCastComponent(EventEmitter emitter,
android.content.Context context,
BrightcoveCastMediaManager brightcoveCastMediaManager)
Deprecated.
|
GoogleCastComponent(EventEmitter emitter,
java.lang.String applicationId,
android.content.Context context)
Deprecated.
|
GoogleCastComponent(EventEmitter emitter,
java.lang.String applicationId,
android.content.Context context,
boolean autoPlay)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
com.google.android.gms.common.api.PendingResult<com.google.android.gms.cast.framework.media.RemoteMediaClient.MediaChannelResult> |
addItems(com.google.android.gms.cast.MediaQueueItem... mediaQueue) |
void |
enableCustomData(boolean enableCustomData)
Enables/Disables custom data in the current
BrightcoveCastMediaManager instance. |
CustomData |
getCustomData() |
static void |
initializeVideoCastManager(android.content.Context context,
java.lang.String applicationId,
java.lang.Class<? extends android.app.Activity> targetActivity)
Deprecated.
|
boolean |
isSessionAvailable() |
com.google.android.gms.common.api.PendingResult<com.google.android.gms.cast.framework.media.RemoteMediaClient.MediaChannelResult> |
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 current
BrightcoveCastMediaManager instance. |
static android.view.MenuItem |
setUpMediaRouteButton(android.app.Activity activity,
android.view.Menu menu) |
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
public static final java.lang.String CAST_MEDIA_METADATA_OBJECT
public static final java.lang.String CAST_MEDIA_METADATA_SUBTITLE
public static final java.lang.String CAST_MEDIA_METADATA_TITLE
public static final java.lang.String CAST_MEDIA_METADATA_STUDIO
public static final java.lang.String CAST_MEDIA_METADATA_IMAGE_URL
public static final java.lang.String CAST_MEDIA_METADATA_BIG_IMAGE_URL
public static final java.lang.String CAST_MEDIA_METADATA_URL
public static final java.lang.String CAST_MEDIA_METADATA_CONTENT_TYPE
public static final java.lang.String CAST_MEDIA_METADATA_VIDEO_ID
public static final java.lang.String CAST_MEDIA_INFO
public static final java.lang.String CAST_MEDIA_QUEUE_ITEM
public static final java.lang.String CAST_MEDIA_PLAY_POSITION
public static final java.lang.String CAST_PLAYER
@Deprecated public static final java.lang.String CAST_MENU
@Deprecated public static final java.lang.String CAST_MENU_RESOURCE_ID
@Deprecated public static final java.lang.String CAST_MINICONTROLLER
@Deprecated public GoogleCastComponent(EventEmitter emitter, java.lang.String applicationId, android.content.Context context, boolean autoPlay)
GoogleCastComponent.Builder.build()
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.@Deprecated public GoogleCastComponent(EventEmitter emitter, java.lang.String applicationId, android.content.Context context)
GoogleCastComponent.Builder.build()
emitter
- The current event emitter.applicationId
- The application ID for the receiver application on the Chromecast.context
- The top-level application context.@Deprecated public GoogleCastComponent(@NonNull EventEmitter emitter, @NonNull android.content.Context context)
GoogleCastComponent.Builder.build()
emitter
- The current event emitter.context
- The top-level application context.@Deprecated public GoogleCastComponent(@NonNull EventEmitter emitter, @NonNull android.content.Context context, @Nullable BrightcoveCastMediaManager brightcoveCastMediaManager)
GoogleCastComponent.Builder.build()
emitter
- The current event emitter.context
- The top-level application context.brightcoveCastMediaManager
- The Brightcove Cast Media Manager.public void loadMediaInfo(com.google.android.gms.cast.MediaInfo mediaInfo)
mediaInfo
- the media infopublic void loadMediaInfo(com.google.android.gms.cast.MediaInfo mediaInfo, long positionMs)
setAutoPlay(boolean)
.mediaInfo
- the media infopositionMs
- the position in millisRemoteMediaClient.load(MediaInfo, boolean, long)
public void setAutoPlay(boolean autoPlayEnabled)
loadMediaInfo(MediaInfo)
or loadMediaInfo(MediaInfo, long)
.autoPlayEnabled
- true enabledloadMediaInfo(MediaInfo)
,
loadMediaInfo(MediaInfo, long)
public void enableCustomData(boolean enableCustomData)
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.enableCustomData
- Whether to enable custom data.public void setIsQueuingSupported(boolean isQueuingSupported)
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.isQueuingSupported
- Whether the receiver is expected to support queuing.public void setCustomData(CustomData customData)
public CustomData getCustomData()
public static android.view.MenuItem setUpMediaRouteButton(@NonNull android.app.Activity activity, @NonNull android.view.Menu menu)
public com.google.android.gms.common.api.PendingResult<com.google.android.gms.cast.framework.media.RemoteMediaClient.MediaChannelResult> loadItem(com.google.android.gms.cast.MediaQueueItem mediaQueue, int playheadPosition)
public com.google.android.gms.common.api.PendingResult<com.google.android.gms.cast.framework.media.RemoteMediaClient.MediaChannelResult> addItems(com.google.android.gms.cast.MediaQueueItem... mediaQueue)
@Deprecated public static void initializeVideoCastManager(android.content.Context context, java.lang.String applicationId, java.lang.Class<? extends android.app.Activity> targetActivity)
public boolean isSessionAvailable()