public final class DefaultPreviewLoader extends java.lang.Object implements PreviewLoader
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.
Modifier and Type | Class and Description |
---|---|
static class |
DefaultPreviewLoader.Builder
The
DefaultPreviewLoader Builder. |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_NUMBER_TO_PREFETCH
Default number of preview thumbnail images to prefetch
|
EMPTY
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)
|
public static final int DEFAULT_NUMBER_TO_PREFETCH
public static DefaultPreviewLoader createDefault(android.content.Context context)
DefaultPreviewLoader
instance with the default configurationcontext
- the Android contextDefaultPreviewLoader
instancepublic void setThumbnailDocument(@NonNull ThumbnailDocument thumbnailDocument)
PreviewLoader
setThumbnailDocument
in interface PreviewLoader
thumbnailDocument
- the Thumbnail documentpublic void loadPreview(@NonNull ThumbnailView thumbnailView, long seekBarPosition, long seekBarMax)
PreviewLoader
TimedThumbnail
in the ThumbnailDocument
set with
PreviewLoader.setThumbnailDocument(ThumbnailDocument)
, and loads it into the ThumbnailView
.loadPreview
in interface PreviewLoader
thumbnailView
- the view to load the preview thumbnail imageseekBarPosition
- the Video's playhead positionseekBarMax
- the Video's duration