Class AbstractButtonController

    • Field Detail

      • DEFAULT_AUDIO_TRACKS_BUTTON_ID

        public static final int DEFAULT_AUDIO_TRACKS_BUTTON_ID
      • DEFAULT_CAPTIONS_BUTTON_ID

        public static final int DEFAULT_CAPTIONS_BUTTON_ID
      • DEFAULT_FAST_FORWARD_BUTTON_ID

        public static final int DEFAULT_FAST_FORWARD_BUTTON_ID
      • DEFAULT_FULL_SCREEN_BUTTON_ID

        public static final int DEFAULT_FULL_SCREEN_BUTTON_ID
      • DEFAULT_LIVE_BUTTON_ID

        public static final int DEFAULT_LIVE_BUTTON_ID
      • DEFAULT_PLAY_BUTTON_ID

        public static final int DEFAULT_PLAY_BUTTON_ID
      • DEFAULT_REWIND_BUTTON_ID

        public static final int DEFAULT_REWIND_BUTTON_ID
      • DEFAULT_SEEK_BUTTON_ID

        public static final int DEFAULT_SEEK_BUTTON_ID
      • properties

        protected final java.util.Map<java.lang.String,​java.lang.Object> properties
        A set of properties supplied when emitting events as part of button click handling.
      • stateList

        protected final java.util.List<ButtonState> stateList
        A list of states the button will sequence through as it is clicked.
      • videoView

        protected final BaseVideoView videoView
        The Brightcove video view, provided as a convenience to subclasses.
    • Constructor Detail

      • AbstractButtonController

        public AbstractButtonController​(android.content.Context context,
                                        BaseVideoView videoView,
                                        android.view.View controlBar,
                                        int id,
                                        android.graphics.Typeface font)
        Builds a complete controller.
        Parameters:
        context - The given Android application context.
        videoView - The SDK video view used, possibly, to determine managed state asssociated with the button.
        controlBar - The layout widget to which the button will be added.
        id - The Android resource identifier for the button being controlled.
    • Method Detail

      • getFont

        @Nullable
        public android.graphics.Typeface getFont()
        Gets the button font. Used for testing.
        Returns:
        The button font.
      • getButton

        @Nullable
        public android.widget.Button getButton()
        Implements a getter for the button.
        Specified by:
        getButton in interface ButtonController
        Returns:
        null if the controller is not managing an Android Button widget, the managed button otherwise.
        See Also:
        ButtonController.getButton()
      • setVisibility

        public void setVisibility​(int visibility)
        Sets the button visibility.
        Parameters:
        visibility - One of View.VISIBLE, View.INVISIBLE, or View.GONE.
      • getId

        public int getId()
        Description copied from interface: ButtonController
        Obtains the Android resource id for the button being controlled.
        Specified by:
        getId in interface ButtonController
        Returns:
        The Android resource id defining this button controller.
      • getProperties

        public java.util.Map<java.lang.String,​java.lang.Object> getProperties()
        Implements a default behavior to get the current properties without any additional processing. Subclasses should override to tailor the properties emitted on a button click.
        Specified by:
        getProperties in interface ButtonController
        See Also:
        ButtonController.getProperties()
      • getStateList

        public java.util.List<ButtonState> getStateList()
        Gets the button state list providing information about the states associated with a button face.
        Specified by:
        getStateList in interface ButtonController
        Returns:
        a non-null but possibly empty list of button states for the controlled button.
        See Also:
        ButtonController.getStateList()
      • getVisibilityState

        public int getVisibilityState()
        Gets the maintained visibility state for a button. Defaults to View.VISIBLE but can be overridden based on events. An example is the caption button.
        Specified by:
        getVisibilityState in interface ButtonController
        Returns:
        The expected visibility state, one of View.GONE, View.INVISIBLE or View.VISIBLE.
        See Also:
        ButtonController.getVisibilityState()
      • onSkipBackward

        public boolean onSkipBackward​(android.view.KeyEvent event)
        Description copied from interface: RemoteControlKeyState
        On skip backward key actioned
        Specified by:
        onSkipBackward in interface RemoteControlKeyState
        Parameters:
        event - the android.view.KeyEvent
        Returns:
        true if the key event was handled, false otherwies.
      • onSkipForward

        public boolean onSkipForward​(android.view.KeyEvent event)
        Description copied from interface: RemoteControlKeyState
        On skip forward key actioned
        Specified by:
        onSkipForward in interface RemoteControlKeyState
        Parameters:
        event - the android.view.KeyEvent
        Returns:
        true if the key event was handled, false otherwies.
      • onHome

        public boolean onHome​(android.view.KeyEvent event)
        Description copied from interface: RemoteControlKeyState
        On home key actioned
        Specified by:
        onHome in interface RemoteControlKeyState
        Parameters:
        event - the android.view.KeyEvent
        Returns:
        true if the key event was handled, false otherwies.
      • onMenu

        public boolean onMenu​(android.view.KeyEvent event)
        Description copied from interface: RemoteControlKeyState
        On menu key actioned
        Specified by:
        onMenu in interface RemoteControlKeyState
        Parameters:
        event - the android.view.KeyEvent
        Returns:
        true if the key event was handled, false otherwies.
      • onBack

        public boolean onBack​(android.view.KeyEvent event)
        Description copied from interface: RemoteControlKeyState
        On back key actioned
        Specified by:
        onBack in interface RemoteControlKeyState
        Parameters:
        event - the android.view.KeyEvent
        Returns:
        true if the key event was handled, false otherwies.
      • onRewind

        public boolean onRewind​(android.view.KeyEvent event)
        Description copied from interface: RemoteControlKeyState
        On rewind key actioned
        Specified by:
        onRewind in interface RemoteControlKeyState
        Parameters:
        event - the android.view.KeyEvent
        Returns:
        true if the key event was handled, false otherwies.
      • onFastForward

        public boolean onFastForward​(android.view.KeyEvent event)
        Description copied from interface: RemoteControlKeyState
        On fast forward key actioned
        Specified by:
        onFastForward in interface RemoteControlKeyState
        Parameters:
        event - the android.view.KeyEvent
        Returns:
        true if the key event was handled, false otherwies.
      • onPlayPause

        public boolean onPlayPause​(android.view.KeyEvent event)
        Description copied from interface: RemoteControlKeyState
        On play pause key actioned
        Specified by:
        onPlayPause in interface RemoteControlKeyState
        Parameters:
        event - the android.view.KeyEvent
        Returns:
        true if the key event was handled, false otherwies.
      • onPause

        public boolean onPause​(android.view.KeyEvent event)
        Description copied from interface: RemoteControlKeyState
        On pause key actioned
        Specified by:
        onPause in interface RemoteControlKeyState
        Parameters:
        event - the android.view.KeyEvent
        Returns:
        true if the key event was handled, false otherwies.
      • onPlay

        public boolean onPlay​(android.view.KeyEvent event)
        Description copied from interface: RemoteControlKeyState
        On play key actioned
        Specified by:
        onPlay in interface RemoteControlKeyState
        Parameters:
        event - the android.view.KeyEvent
        Returns:
        true if the key event was handled, false otherwies.
      • onDpadCenter

        public boolean onDpadCenter​(android.view.KeyEvent event)
        Description copied from interface: RemoteControlKeyState
        On dpad center key actioned
        Specified by:
        onDpadCenter in interface RemoteControlKeyState
        Parameters:
        event - the android.view.KeyEvent
        Returns:
        true if the key event was handled, false otherwies.
      • onDpadRight

        public boolean onDpadRight​(android.view.KeyEvent event)
        Description copied from interface: RemoteControlKeyState
        On dpad right key actioned
        Specified by:
        onDpadRight in interface RemoteControlKeyState
        Parameters:
        event - the android.view.KeyEvent
        Returns:
        true if the key event was handled, false otherwies.
      • onDpadLeft

        public boolean onDpadLeft​(android.view.KeyEvent event)
        Description copied from interface: RemoteControlKeyState
        On dpad left key actioned
        Specified by:
        onDpadLeft in interface RemoteControlKeyState
        Parameters:
        event - the android.view.KeyEvent
        Returns:
        true if the key event was handled, false otherwies.
      • onDpadDown

        public boolean onDpadDown​(android.view.KeyEvent event)
        Description copied from interface: RemoteControlKeyState
        On dpad down key actioned
        Specified by:
        onDpadDown in interface RemoteControlKeyState
        Parameters:
        event - the android.view.KeyEvent
        Returns:
        true if the key event was handled, false otherwies.
      • onDpadUp

        public boolean onDpadUp​(android.view.KeyEvent event)
        Description copied from interface: RemoteControlKeyState
        On dpad up key actioned
        Specified by:
        onDpadUp in interface RemoteControlKeyState
        Parameters:
        event - the android.view.KeyEvent
        Returns:
        true if the key event was handled, false otherwies.