com.brightcove.player.mediacontroller

## Class MediaControllerConfig.Builder

- java.lang.Object
- - com.brightcove.player.mediacontroller.MediaControllerConfig.Builder

- Enclosing class:
    MediaControllerConfig

      public static class MediaControllerConfig.Builder
      extends java.lang.Object

  The MediaControllerConfig Builder.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Builder()` Instantiates a new MediaControllerConfig.Builder.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `MediaControllerConfig` | `build()` Builds the MediaControllerConfig.
    `MediaControllerConfig.Builder` | `setInitialDuration(int initialDuration)` Deprecated.
    `MediaControllerConfig.Builder` | `setInitialDuration(long initialDuration)` Sets the initial duration value in milliseconds.
    `MediaControllerConfig.Builder` | `setInitialPlayheadPosition(int initialPlayheadPosition)` Deprecated.
    `MediaControllerConfig.Builder` | `setInitialPlayheadPosition(long initialPlayheadPosition)` Sets the initial playhead position value in milliseconds.
    `MediaControllerConfig.Builder` | `setLayoutId(int layoutId)` Sets the resource layout id.
    `MediaControllerConfig.Builder` | `setMediaControllerKeyDispatcher(MediaControllerKeyDispatcher mediaControllerKeyDispatcher)` Sets the `MediaControllerKeyDispatcher`.
    `MediaControllerConfig.Builder` | `setOnTouchListener(android.view.View.OnTouchListener onTouchListener)` Sets on touch listener.
    `MediaControllerConfig.Builder` | `setShowControlsOnCreation(boolean showControlsOnCreation)` Sets whether the Media Controller will be shown when the controller is created.
    `MediaControllerConfig.Builder` | `setShowControlsWhenAdIsPlaying(boolean showControlsWhenAdIsPlaying)` Sets whether the Media Controller will be allowed to be shown when an Ad is playing.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Builder

          public Builder()

      Instantiates a new MediaControllerConfig.Builder.

  - ### Method Detail

    - #### setLayoutId

          public MediaControllerConfig.Builder setLayoutId(int layoutId)

      Sets the resource layout id.

      The default value is -1, which will be ignored by the `BrightcoveMediaController`.

      Parameters:
        `layoutId` - the layout id
      Returns:
        the builder instance

    - #### setOnTouchListener

          public MediaControllerConfig.Builder setOnTouchListener(@Nullable
                                                                  android.view.View.OnTouchListener onTouchListener)

      Sets on touch listener.

      The default value is null, which will be ignored by the `BrightcoveMediaController`.

      Parameters:
        `onTouchListener` - the on touch listener
      Returns:
        the builder instance

    - #### setInitialDuration

          @Deprecated
          public MediaControllerConfig.Builder setInitialDuration(int initialDuration)

      Deprecated.
      Deprecated. Instead use {`setInitialDuration(long)`}

    - #### setInitialDuration

          public MediaControllerConfig.Builder setInitialDuration(long initialDuration)

      Sets the initial duration value in milliseconds.

      The duration might later be updated by another component or an event. For example, by the `EventType.PROGRESS` or the `EventType.VIDEO_DURATION_CHANGED` events.

      The default value is -1, which will be ignored by the `BrightcoveMediaController`.

      Parameters:
        `initialDuration` - the initial duration value in milliseconds
      Returns:
        the builder instance

    - #### setInitialPlayheadPosition

          @Deprecated
          public MediaControllerConfig.Builder setInitialPlayheadPosition(int initialPlayheadPosition)

      Deprecated.
      Deprecated. Instead use {`setInitialPlayheadPosition(long)`}

    - #### setInitialPlayheadPosition

          public MediaControllerConfig.Builder setInitialPlayheadPosition(long initialPlayheadPosition)

      Sets the initial playhead position value in milliseconds.

      The playhead position might later be updated by another component or an event. For example, by the `EventType.PROGRESS` or the `EventType.VIDEO_DURATION_CHANGED` events.

      The default value is -1, which will be ignored by the `BrightcoveMediaController`.

      Parameters:
        `initialPlayheadPosition` - the initial playhead position value in milliseconds
      Returns:
        the builder instance

    - #### setShowControlsOnCreation

          public MediaControllerConfig.Builder setShowControlsOnCreation(boolean showControlsOnCreation)

      Sets whether the Media Controller will be shown when the controller is created. The Default value is true.
      Parameters:
        `showControlsOnCreation` - true to show the controller when it is created.
      Returns:
        the builder instance

    - #### setShowControlsWhenAdIsPlaying

          public MediaControllerConfig.Builder setShowControlsWhenAdIsPlaying(boolean showControlsWhenAdIsPlaying)

      Sets whether the Media Controller will be allowed to be shown when an Ad is playing. The Default value is false.
      Parameters:
        `showControlsWhenAdIsPlaying` - true to show the controller when an Ad is playing.
      Returns:
        the builder instance

    - #### setMediaControllerKeyDispatcher

          public MediaControllerConfig.Builder setMediaControllerKeyDispatcher(@Nullable
                                                                               MediaControllerKeyDispatcher mediaControllerKeyDispatcher)

      Sets the `MediaControllerKeyDispatcher`. The default value is null.
      Parameters:
        `mediaControllerKeyDispatcher` - the media controller key dispatcher
      Returns:
        the builder instance

    - #### build

          public MediaControllerConfig build()

      Builds the MediaControllerConfig.
      Returns:
        the media controller config