com.brightcove.player.mediacontroller

## Class DefaultPreviewLoader

- java.lang.Object
- - com.brightcove.player.mediacontroller.DefaultPreviewLoader

- All Implemented Interfaces:
    PreviewLoader

      public final class DefaultPreviewLoader
      extends java.lang.Object
      implements PreviewLoader

  The default `PreviewLoader` used in the Thumbnail plugin. It uses `Picasso` to request and load the images into the `ThumbnailView`.

  Use `createDefault(Context)` to create an instance with the default configuration, or use `DefaultPreviewLoader.Builder` to configure it differently.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `DefaultPreviewLoader.Builder` The `DefaultPreviewLoader` Builder.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_NUMBER_TO_PREFETCH` Default number of preview thumbnail images to prefetch

    - ### Fields inherited from interface com.brightcove.player.mediacontroller.PreviewLoader

      `EMPTY`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static DefaultPreviewLoader` | `createDefault(android.content.Context context)` Creates a `DefaultPreviewLoader` instance with the default configuration
    `void` | `loadPreview(ThumbnailView thumbnailView, long seekBarPosition, long seekBarMax)` Given a playhead position, finds a `TimedThumbnail` in the `ThumbnailDocument` set with `PreviewLoader.setThumbnailDocument(ThumbnailDocument)`, and loads it into the `ThumbnailView`.
    `void` | `setThumbnailDocument(ThumbnailDocument thumbnailDocument)` Sets the `ThumbnailDocument` containing the `TimedThumbnail` corresponding to a particular `Video`.

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

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

- - ### Field Detail

    - #### DEFAULT_NUMBER_TO_PREFETCH

          public static final int DEFAULT_NUMBER_TO_PREFETCH

      Default number of preview thumbnail images to prefetch
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### createDefault

          public static DefaultPreviewLoader createDefault(android.content.Context context)

      Creates a `DefaultPreviewLoader` instance with the default configuration
      Parameters:
        `context` - the Android context
      Returns:
        a `DefaultPreviewLoader` instance

    - #### setThumbnailDocument

          public void setThumbnailDocument(@NonNull
                                           ThumbnailDocument thumbnailDocument)

      Description copied from interface: `PreviewLoader`
      Sets the `ThumbnailDocument` containing the `TimedThumbnail` corresponding to a particular `Video`.
      Specified by:
        `setThumbnailDocument` in interface `PreviewLoader`
      Parameters:
        `thumbnailDocument` - the Thumbnail document

    - #### loadPreview

          public void loadPreview(@NonNull
                                  ThumbnailView thumbnailView,
                                  long seekBarPosition,
                                  long seekBarMax)

      Description copied from interface: `PreviewLoader`
      Given a playhead position, finds a `TimedThumbnail` in the `ThumbnailDocument` set with `PreviewLoader.setThumbnailDocument(ThumbnailDocument)`, and loads it into the `ThumbnailView`.
      Specified by:
        `loadPreview` in interface `PreviewLoader`
      Parameters:
        `thumbnailView` - the view to load the preview thumbnail image
        `seekBarPosition` - the Video's playhead position
        `seekBarMax` - the Video's duration