Class BrightcoveMediaControlRegistryImpl
java.lang.Object
com.brightcove.player.mediacontroller.BrightcoveMediaControlRegistryImpl
- All Implemented Interfaces:
BrightcoveMediaControlRegistry
public class BrightcoveMediaControlRegistryImpl
extends Object
implements BrightcoveMediaControlRegistry
Provides a button controller registry where collections of button controllers are managed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears out the media controls and button controllers.getButtonController(int id) Gets a button controller for a given Android resource identifier.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.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.ViewImplements 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.
-
Constructor Details
-
BrightcoveMediaControlRegistryImpl
public BrightcoveMediaControlRegistryImpl()
-
-
Method Details
-
clear
public void clear()Clears out the media controls and button controllers.- Specified by:
clearin interfaceBrightcoveMediaControlRegistry- See Also:
-
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:
-
getButtonController
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:
-
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:
-
getView
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:
-
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:
-
register
Implements to register a given button controller.- Specified by:
registerin interfaceBrightcoveMediaControlRegistry- Parameters:
controller- The given button controller.- See Also:
-
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:
-
getStateList
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:
-