Class BrightcoveMediaControlRegistryImpl
- java.lang.Object
-
- com.brightcove.player.mediacontroller.BrightcoveMediaControlRegistryImpl
-
- All Implemented Interfaces:
BrightcoveMediaControlRegistry
public class BrightcoveMediaControlRegistryImpl extends java.lang.Object implements BrightcoveMediaControlRegistry
Provides a button controller registry where collections of button controllers are managed.
-
-
Constructor Summary
Constructors Constructor Description BrightcoveMediaControlRegistryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears out the media controls and button controllers.ButtonControllergetButtonController(int id)Gets a button controller for a given Android resource identifier.java.util.List<ButtonController>getButtonControllers()Gets the list of registered button controllers.intgetId(android.view.View view)Gets the Android resource id for a given view.intgetManagedState(int id)Gets the managed state for a controller with a given button resource id.java.util.List<ButtonState>getStateList(int id)Implements a getter for the state list associated with a given button.android.view.ViewgetView(int id)Implements a getter to obtain a button widget for a given button resource id.android.view.ViewgetView(java.lang.String resourceTag)Implements a getter to obtain a view given the tag part of a resource id, i.e.voidregister(android.view.View view)Registers a View object as a media control.voidregister(ButtonController controller)Implements to register a given button controller.
-
-
-
Method Detail
-
clear
public void clear()
Clears out the media controls and button controllers.- Specified by:
clearin interfaceBrightcoveMediaControlRegistry- See Also:
BrightcoveMediaControlRegistry.clear()
-
getButtonControllers
public java.util.List<ButtonController> getButtonControllers()
Gets the list of registered button controllers.- Specified by:
getButtonControllersin interfaceBrightcoveMediaControlRegistry- Returns:
- An empty list if not controllers are registered, the list of registered controllers otherwise.
- See Also:
BrightcoveMediaControlRegistry.getButtonControllers()
-
getButtonController
public ButtonController getButtonController(int id)
Gets a button controller for a given Android resource identifier.- Specified by:
getButtonControllerin interfaceBrightcoveMediaControlRegistry- Parameters:
id- The given button identifier.- Returns:
- null if there is no associated button controller, the associated ButtonController object otherwise.
- See Also:
BrightcoveMediaControlRegistry.getButtonController(int)
-
getView
public android.view.View getView(int id)
Implements a getter to obtain a button widget for a given button resource id.- Specified by:
getViewin interfaceBrightcoveMediaControlRegistry- Parameters:
id- The Android resource identifier.- Returns:
- null if no such control exists in the registry, the View object otherwise.
- See Also:
BrightcoveMediaControlRegistry.getView(int)
-
getView
public android.view.View getView(java.lang.String resourceTag)
Implements a getter to obtain a view given the tag part of a resource id, i.e. "@+id/tag".- Specified by:
getViewin interfaceBrightcoveMediaControlRegistry- Parameters:
resourceTag- The Android resource identifier.- Returns:
- null if no such control exists in the registry, the View object otherwise.
- See Also:
BrightcoveMediaControlRegistry.getView(String)
-
getManagedState
public int getManagedState(int id)
Gets the managed state for a controller with a given button resource id.- Specified by:
getManagedStatein interfaceBrightcoveMediaControlRegistry- Returns:
- -1 if no matching controller is found, the non-negative value otherwise.
- See Also:
BrightcoveMediaControlRegistry.getManagedState(int)
-
register
public void register(ButtonController controller)
Implements to register a given button controller.- Specified by:
registerin interfaceBrightcoveMediaControlRegistry- Parameters:
controller- The given button controller.- See Also:
BrightcoveMediaControlRegistry.register(com.brightcove.player.mediacontroller.buttons.ButtonController)
-
register
public void register(android.view.View view)
Registers a View object as a media control. If the view is a ViewGroup, all children will be registered recursively.- Specified by:
registerin interfaceBrightcoveMediaControlRegistry- Parameters:
view- The View to register.
-
getId
public int getId(android.view.View view)
Gets the Android resource id for a given view.- Specified by:
getIdin interfaceBrightcoveMediaControlRegistry- Parameters:
view- The given media control view.- Returns:
- -1 if there is no such View in the registry, the associated resource id otherwise.
- See Also:
BrightcoveMediaControlRegistry.getId(View)
-
getStateList
public java.util.List<ButtonState> getStateList(int id)
Implements a getter for the state list associated with a given button.- Specified by:
getStateListin interfaceBrightcoveMediaControlRegistry- Parameters:
id- The given button resource id.- Returns:
- an empty list if no button state has been defined for the given button, a non-empty list otherwise.
- See Also:
BrightcoveMediaControlRegistry.getStateList(int)
-
-