Package com.brightcove.player.event
Class AbstractComponent
java.lang.Object
com.brightcove.player.event.AbstractComponent
- All Implemented Interfaces:
Component
- Direct Known Subclasses:
AbstractButtonController
,AdCuePointComponent
,AdOverlayHandler
,Analytics
,BrightcoveAudioTracksController
,BrightcoveCastMediaManager
,BrightcoveClosedCaptioningController
,BrightcoveMediaController
,BrightcovePluginManager
,BrightcoveSeekBarController
,BrightcoveShowHideController
,Catalog
,CompanionAdHandler
,ConcurrencyClient
,DefaultSourceSelectionController
,ExoAdPlayer
,ExoMediaPlayback
,FreeWheelAnalytics
,FreeWheelController
,GoogleCastComponent
,GoogleIMAComponent
,IMAAnalytics
,LifecycleUtil
,LiveVideoOrchestrator
,LoadCaptionsService
,MediaPlayerPlayback
,OmnitureComponent
,PulseComponent
,SeekManager
,ShutterViewController
,SSAIAnalytics
,SSAIComponent
,ThumbnailComponent
,TimelineManager
,UIManager
,UiTimedTracker
,VideoDisplayComponent
,VideoPlaybackController
,VideoStillDisplayComponent
Provides some common implementation that useful to all that interact with
RegisteringEventEmitters components, including:
- Maintaining a reference to an EventEmitter
- Wraps incoming EventEmitter in a RegisteringEventEmitter
- Ensures incoming EventEmitter is not null
- Maintains a collection of EventListener tokens for use with EventEmitter.off()
- Provides standard required method for initializing Event listeners
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAbstractComponent
(EventEmitter eventEmitter) Build an AbstractComponent that does not use a registering event emitter.AbstractComponent
(EventEmitter eventEmitter, Class<? extends Component> componentClass) Being Components, Controllers inheriting from AbstractController require an EventEmitter on initialization. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(String eventType, EventListener listener) Convenience method to add an EventListener for the given type using the EventEmitter.on() method.void
addOnceListener
(String eventType, EventListener listener) Convenience method to add an EventListener for the given type using the EventEmitter.once() method.Provides a reference to the EventEmitter with which this component was initializedvoid
removeListener
(String eventType) Removes the specified listener from the EventEmitter.void
Removes all set listeners from the EventEmitter.
-
Field Details
-
eventEmitter
-
listenerTokens
-
-
Constructor Details
-
AbstractComponent
Being Components, Controllers inheriting from AbstractController require an EventEmitter on initialization.- Parameters:
eventEmitter
- the EventEmitter through which this Component will listen for and emit events to interact with other components in the player
-
AbstractComponent
Build an AbstractComponent that does not use a registering event emitter.- Parameters:
eventEmitter
- the EventEmitter through which this Component will listen for and emit events to interact with other components in the player
-
-
Method Details
-
addListener
Convenience method to add an EventListener for the given type using the EventEmitter.on() method.- Parameters:
eventType
- the EventType for which the listener should be calledlistener
- the implementation of EventListener for this EventType
-
addOnceListener
Convenience method to add an EventListener for the given type using the EventEmitter.once() method.- Parameters:
eventType
- the EventType for which the listener should be calledlistener
- the implementation of EventListener for this EventType
-
removeListener
Removes the specified listener from the EventEmitter.- Parameters:
eventType
- the EventType for which the listener should be called
-
removeListeners
public void removeListeners()Removes all set listeners from the EventEmitter. -
getEventEmitter
Provides a reference to the EventEmitter with which this component was initialized- Returns:
- the EventEmitter used by this Component
-