Package com.brightcove.cast.controller
Class BrightcoveCastMediaManager
java.lang.Object
com.brightcove.player.event.AbstractComponent
com.brightcove.cast.controller.BrightcoveCastMediaManager
- All Implemented Interfaces:
Component
@Emits(events={"setMediaInfo","addMediaInfo","setMediaControllerConfig","removeVideoStill","setVideoStill","setSource","pause","stop","play","restoreDefaultMediaController"})
@ListensFor(events={"completed","didSeekTo","didSetVideo","progress","setSource","play","controlBarCreated","castSessionStarted","castSessionEnded","activityStarted"})
public class BrightcoveCastMediaManager
extends AbstractComponent
-
Field Summary
Fields inherited from class com.brightcove.player.event.AbstractComponent
eventEmitter, listenerTokens
-
Constructor Summary
ConstructorDescriptionBrightcoveCastMediaManager
(android.content.Context context, EventEmitter eventEmitter) BrightcoveCastMediaManager
(android.content.Context context, EventEmitter eventEmitter, MediaControllerConfig mediaControllerConfig) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
addMediaInfo
(com.google.android.gms.cast.MediaInfo mediaInfo) protected org.json.JSONObject
createCastCustomData
(CustomData customData, Video video) void
enableCustomData
(boolean enableCustomData) If enabled, custom data is added to the MediaInfo object when sending information to the Cast receiver app.boolean
If enabled, the video playing locally will be automatically loaded to your Chromecast app receiver as soon as you get connected.boolean
Whether custom data is enabled or not.boolean
protected void
protected void
loadMediaInfo
(com.google.android.gms.cast.MediaInfo mediaInfo) protected void
loadMediaInfo
(com.google.android.gms.cast.MediaInfo mediaInfo, long positionMs) protected void
onConnectionAvailable
(Event event) protected void
onConnectionUnavailable
(Event event) protected void
void
setAutoCastIfPlaying
(boolean autoCastIfPlaying) If enabled, the video playing locally will be automatically loaded to your Chromecast app receiver as soon as you get connected.void
setCustomData
(CustomData customData) The BrightcoveCustomData
to be used when sending custom data to the Cast receiver app.void
setQueueingSupported
(boolean isQueueingSupported) Whether queueing is supported in the cast receiver app.protected void
setupBrightcoveControlBar
(BrightcoveControlBar controlBar) protected void
void
updateBrightcoveMediaController
(boolean isRemote) Methods inherited from class com.brightcove.player.event.AbstractComponent
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
-
Constructor Details
-
BrightcoveCastMediaManager
-
BrightcoveCastMediaManager
public BrightcoveCastMediaManager(android.content.Context context, EventEmitter eventEmitter, MediaControllerConfig mediaControllerConfig)
-
-
Method Details
-
isSessionAvailable
public boolean isSessionAvailable() -
updateBrightcoveMediaController
public void updateBrightcoveMediaController(boolean isRemote) -
isAutoCastIfPlaying
public boolean isAutoCastIfPlaying()If enabled, the video playing locally will be automatically loaded to your Chromecast app receiver as soon as you get connected.- Returns:
- true to enable auto cast if playing.
-
setAutoCastIfPlaying
public void setAutoCastIfPlaying(boolean autoCastIfPlaying) If enabled, the video playing locally will be automatically loaded to your Chromecast app receiver as soon as you get connected.- Parameters:
autoCastIfPlaying
- true to enable auto cast if playing.
-
setCustomData
The BrightcoveCustomData
to be used when sending custom data to the Cast receiver app. -
getCustomData
-
enableCustomData
public void enableCustomData(boolean enableCustomData) 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 or disable custom data.
-
setQueueingSupported
public void setQueueingSupported(boolean isQueueingSupported) Whether queueing is supported in the cast receiver app.If true, queueing option is not displayer to the user. Otherwise, the is shown.
- Parameters:
isQueueingSupported
- Whether queuing is supported in the Cast receiver app.
-
isCustomDataEnabled
public boolean isCustomDataEnabled()Whether custom data is enabled or not. -
loadMediaInfo
protected void loadMediaInfo() -
loadMediaInfo
protected void loadMediaInfo(@NonNull com.google.android.gms.cast.MediaInfo mediaInfo) -
loadMediaInfo
protected void loadMediaInfo(@NonNull com.google.android.gms.cast.MediaInfo mediaInfo, long positionMs) -
addMediaInfo
protected void addMediaInfo() -
addMediaInfo
protected void addMediaInfo(com.google.android.gms.cast.MediaInfo mediaInfo) -
onConnectionAvailable
-
setupRemoteController
protected void setupRemoteController() -
resetToLocalController
protected void resetToLocalController() -
setupBrightcoveControlBar
-
createCastCustomData
@Nullable protected org.json.JSONObject createCastCustomData(@Nullable CustomData customData, @Nullable Video video)
-