Package com.castlabs.sdk.thumbs

# Interface ThumbnailProvider.Callback

Enclosing interface:
  `ThumbnailProvider`

public 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.

Note that implementations of `ThumbnailProvider` must ensure that `onThumbnailLoaded(long, long, Bitmap)` is always called on the main application thread.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `onThumbnailLoaded(long requestedPositionUs, long actualPositionUs, Bitmap thumbnail)`
  Called after a thumbnail load finished.
  `void`
  `onThumbnailLoadError(long requestedPositionUs, Exception exception)`
  Called when an error occurs during thumbnail loading.

- ## Method Details

  - ### onThumbnailLoaded

    void onThumbnailLoaded(long requestedPositionUs, long actualPositionUs, @Nullable Bitmap thumbnail)
    Called after a thumbnail load finished. Note that the thumbnail might be null if no data was found for the given position.
    Parameters:
      `requestedPositionUs` - The requested position in micro seconds
      `actualPositionUs` - The actual position of the thumbnail in micro seconds, or -1 if no data was found
      `thumbnail` - The thumbnail

  - ### onThumbnailLoadError

    void onThumbnailLoadError(long requestedPositionUs, @Nullable Exception exception)
    Called when an error occurs during thumbnail loading.
    Parameters:
      `requestedPositionUs` - The requested position of the thumbnail in microseconds.
      `exception` - The exception that occurred, or null if the error reason is unknown.