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
Constructors Constructor Description BrightcoveCastMediaManager(android.content.Context context, EventEmitter eventEmitter)BrightcoveCastMediaManager(android.content.Context context, EventEmitter eventEmitter, MediaControllerConfig mediaControllerConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddMediaInfo()protected voidaddMediaInfo(com.google.android.gms.cast.MediaInfo mediaInfo)protected org.json.JSONObjectcreateCastCustomData(CustomData customData, Video video)voidenableCustomData(boolean enableCustomData)If enabled, custom data is added to the MediaInfo object when sending information to the Cast receiver app.CustomDatagetCustomData()booleanisAutoCastIfPlaying()If enabled, the video playing locally will be automatically loaded to your Chromecast app receiver as soon as you get connected.booleanisCustomDataEnabled()Whether custom data is enabled or not.booleanisSessionAvailable()protected voidloadMediaInfo()protected voidloadMediaInfo(com.google.android.gms.cast.MediaInfo mediaInfo)protected voidloadMediaInfo(com.google.android.gms.cast.MediaInfo mediaInfo, long positionMs)protected voidonConnectionAvailable(Event event)protected voidonConnectionUnavailable(Event event)protected voidresetToLocalController()voidsetAutoCastIfPlaying(boolean autoCastIfPlaying)If enabled, the video playing locally will be automatically loaded to your Chromecast app receiver as soon as you get connected.voidsetCustomData(CustomData customData)The BrightcoveCustomDatato be used when sending custom data to the Cast receiver app.voidsetQueueingSupported(boolean isQueueingSupported)Whether queueing is supported in the cast receiver app.protected voidsetupBrightcoveControlBar(BrightcoveControlBar controlBar)protected voidsetupRemoteController()voidupdateBrightcoveMediaController(boolean isRemote)-
Methods inherited from class com.brightcove.player.event.AbstractComponent
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
-
-
-
-
Constructor Detail
-
BrightcoveCastMediaManager
public BrightcoveCastMediaManager(android.content.Context context, EventEmitter eventEmitter)
-
BrightcoveCastMediaManager
public BrightcoveCastMediaManager(android.content.Context context, EventEmitter eventEmitter, MediaControllerConfig mediaControllerConfig)
-
-
Method Detail
-
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
public void setCustomData(@Nullable CustomData customData)The BrightcoveCustomDatato be used when sending custom data to the Cast receiver app.
-
getCustomData
@Nullable public CustomData 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
protected void onConnectionAvailable(Event event)
-
onConnectionUnavailable
protected void onConnectionUnavailable(Event event)
-
setupRemoteController
protected void setupRemoteController()
-
resetToLocalController
protected void resetToLocalController()
-
setupBrightcoveControlBar
protected void setupBrightcoveControlBar(BrightcoveControlBar controlBar)
-
createCastCustomData
@Nullable protected org.json.JSONObject createCastCustomData(@Nullable CustomData customData, @Nullable Video video)
-
-