com.brightcove.player.mediacontroller.buttons

## Interface ButtonController

- All Superinterfaces:
    AccessibilityListener
  All Known Implementing Classes:
    AbstractButtonController, AudioTracksButtonController, CaptionsButtonController, CloseButtonController, FastForwardButtonController, FullScreenButtonController, LiveButtonController, PictureInPictureButtonController, PlayButtonController, PlayerOptionsButtonController, RewindButtonController, SeekButtonController, VRButtonController

      public interface ButtonController
      extends AccessibilityListener

  Defines the interface for managing a media control button which uses an icon fontset to present the button operation via a glyph defined by the font. Each button can have one or more states (a toggle button has two states) where each state is represented by a different glyph (text) on the button face. Each button state can be backed (managed) by business logic of some sort.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `android.widget.Button` | `getButton()` Obtains the managed button from the controller.
    `EventEmitter` | `getEventEmitter()` Obtains the event emitter used to set up the controllers SDK event handling.
    `int` | `getId()` Obtains the Android resource id for the button being controlled.
    `int` | `getManagedState()` Obtains the managed state information.
    `java.util.Map<java.lang.String,java.lang.Object>` | `getProperties()` Obtains a set of property values (name/value pairs) to emit as an optional part of handling a button action.
    `java.util.List<ButtonState>` | `getStateList()` Obtain the list of button states for the button being controlled.
    `int` | `getVisibilityState()` Obtains the visibility state maintained for the button.
    `void` | `removeListeners()` Removes any listeners set up by this button controller.
    `void` | `syncStates()` Ensures that the controlled button is in sync with the managed state it represents.

    - ### Methods inherited from interface com.brightcove.player.accessibility.AccessibilityListener

      `onAccessibilityStateChanged`

- - ### Method Detail

    - #### getManagedState

          int getManagedState()

      Obtains the managed state information.

    - #### getVisibilityState

          int getVisibilityState()

      Obtains the visibility state maintained for the button. This is the state which the button will be assigned on a configuration change or on an Activity restart.
      Returns:
        The expected visibility state, one of View.GONE, View.INVISIBLE or View.VISIBLE.

    - #### getButton

          android.widget.Button getButton()

      Obtains the managed button from the controller.
      Returns:
        null if the controller is not managing an Android Button widget, the managed button otherwise.

    - #### getId

          int getId()

      Obtains the Android resource id for the button being controlled.
      Returns:
        -1 if the controller is not managing an valid Android button, the resource id otherwise.

    - #### getStateList

          java.util.List<ButtonState> getStateList()

      Obtain the list of button states for the button being controlled.
      Returns:
        a non-null but possibly empty list of button states for the controlled button.

    - #### getProperties

          java.util.Map<java.lang.String,java.lang.Object> getProperties()

      Obtains a set of property values (name/value pairs) to emit as an optional part of handling a button action.

    - #### getEventEmitter

          EventEmitter getEventEmitter()

      Obtains the event emitter used to set up the controllers SDK event handling.
      Returns:
        a non-null SDK event emitter.

    - #### removeListeners

          void removeListeners()

      Removes any listeners set up by this button controller.

    - #### syncStates

          void syncStates()

      Ensures that the controlled button is in sync with the managed state it represents.