Package com.castlabs.sdk.thumbs

## Interface ThumbnailProvider

- All Known Implementing Classes:
    `BifThumbnailProvider`, `JpgThumbnailProvider`, `VttThumbnailProvider`

      public interface ThumbnailProvider

  Implementations of this interface provide thumbnails for positions in the current track.
  Since:
    4.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static interface` | `ThumbnailProvider.Callback` | Because loading Thumbnails is usually an asynchronous process, this callback interface needs to be implemented to receive the results when a thumbnail was requested.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `destroy()` | Free up all the resources, meaning this provider will not be used anymore
    `DownloadableResource[]` | `getDownloadableResources​(String remoteManifestUrl, File basePath, Bundle bundle)` | This methods is used to integrate a thumbnail provider with the downloader plugins and implementation can return an array of resources that should be fetched for offline playback.
    `void` | `getThumbnail​(long positionUs, ThumbnailProvider.Callback callback, int thumbnailIndex)` | Load the thumbnail for the given position and return it through the provided callback.

- - ### Method Detail

    - #### getThumbnail

          void getThumbnail​(long positionUs,
                            ThumbnailProvider.Callback callback,
                            @ThumbnailIndex
                            int thumbnailIndex)

      Load the thumbnail for the given position and return it through the provided callback.
      Parameters:
        `positionUs` - The position in microseconds
        `callback` - The callback that will be triggered once data are available
        `thumbnailIndex` -

    - #### getDownloadableResources

          @Nullable
          DownloadableResource[] getDownloadableResources​(String remoteManifestUrl,
                                                          File basePath,
                                                          Bundle bundle)

      This methods is used to integrate a thumbnail provider with the downloader plugins and implementation can return an array of resources that should be fetched for offline playback.
      Parameters:
        `remoteManifestUrl` - The manifest URL of the remote manifest that is the source of this download
        `basePath` - The base folder for this download
        `bundle` - The bundle that was used to start the initiate the download
      Returns:
        Array of downloadable resources or null

    - #### destroy

          void destroy()

      Free up all the resources, meaning this provider will not be used anymore