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
ConstructorsConstructorDescriptionBrightcoveCastMediaManager(android.content.Context context, EventEmitter eventEmitter) BrightcoveCastMediaManager(android.content.Context context, EventEmitter eventEmitter, MediaControllerConfig mediaControllerConfig) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected 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.booleanIf enabled, the video playing locally will be automatically loaded to your Chromecast app receiver as soon as you get connected.booleanWhether custom data is enabled or not.booleanprotected voidprotected 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 voidvoidsetAutoCastIfPlaying(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 voidvoidupdateBrightcoveMediaController(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 BrightcoveCustomDatato 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)
-