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 void
clear()
Clears out the media controls and button controllers.ButtonController
getButtonController(int id)
Gets a button controller for a given Android resource identifier.java.util.List<ButtonController>
getButtonControllers()
Gets the list of registered button controllers.int
getId(android.view.View view)
Gets the Android resource id for a given view.int
getManagedState(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.View
getView(int id)
Implements a getter to obtain a button widget for a given button resource id.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.void
register(android.view.View view)
Registers a View object as a media control.void
register(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:
clear
in interfaceBrightcoveMediaControlRegistry
- See Also:
BrightcoveMediaControlRegistry.clear()
-
getButtonControllers
public java.util.List<ButtonController> getButtonControllers()
Gets the list of registered button controllers.- Specified by:
getButtonControllers
in 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:
getButtonController
in 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:
getView
in 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:
getView
in 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:
getManagedState
in 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:
register
in 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:
register
in 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:
getId
in 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:
getStateList
in 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)
-
-