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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
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.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.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
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.
-
Constructor Details
-
BrightcoveMediaControlRegistryImpl
public BrightcoveMediaControlRegistryImpl()
-
-
Method Details
-
clear
public void clear()Clears out the media controls and button controllers.- Specified by:
clear
in interfaceBrightcoveMediaControlRegistry
- See Also:
-
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:
-
getButtonController
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:
-
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:
-
getView
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:
-
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:
-
register
Implements to register a given button controller.- Specified by:
register
in 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:
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:
-
getStateList
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:
-