PlaybackSeekDataProvider

Types

Link copied to clipboard
interface ResultCallback

Client to receive result for PlaybackSeekDataProvider.getThumbnail.

Functions

Link copied to clipboard
abstract fun getMetaDataSize(): Int
Link copied to clipboard
abstract fun getSeekPositions(): LongArray?

Get a list of sorted seek positions. The positions should not change after user starts seeking.

Link copied to clipboard
abstract fun getThumbnail(index: Int, callback: PlaybackSeekDataProvider.ResultCallback)

Called to get thumbnail bitmap. This method is called on UI thread. When provider finds cache bitmap, it may invoke ResultCallback.onThumbnailLoaded immediately. Provider may start background thread and invoke ResultCallback.onThumbnailLoaded later in UI thread. The method might be called multiple times for the same position, PlaybackSeekDataProvider must guarantee to replace pending ResultCallback with the new one. When seeking right, getThumbnail() will be called with increasing index; when seeking left, getThumbnail() will be called with decreasing index. The increment of index can be used by subclass to determine prefetch direction.

Link copied to clipboard
abstract fun reset()

Called when seek stops, Provider should cancel pending requests for the thumbnails.