Package com.castlabs.sdk.thumbs
Class ThumbsPlugin.ThumbnailViewComponent
java.lang.Object
com.castlabs.android.player.PlayerViewPlugin.SingleViewPlayerViewComponent<DefaultThumbnailView>
com.castlabs.sdk.thumbs.ThumbsPlugin.ThumbnailViewComponent
- All Implemented Interfaces:
PlayerViewPlugin.PlayerViewComponent
- Enclosing class:
ThumbsPlugin
public static class ThumbsPlugin.ThumbnailViewComponent
extends PlayerViewPlugin.SingleViewPlayerViewComponent<DefaultThumbnailView>
If you registered the plugin with the default view integration enabled, this component will
be registered with the
PlayerView
and you can access it
to trigger displaying thumbnails.
The view component adds the default DefaultThumbnailView
to the root view
of the PlayerView
and uses the Thumbnail provider
exposed through PlayerController.getComponent(Class)
to get thumbnail images.
This view is accessible through PlayerView.getComponent(Class)
and exposes show(long, DefaultThumbnailView.Callback)
and hide()
methods
to start displaying thumbnails or to hide them respectively.
Please note that this component uses the default DefaultThumbnailView
as its view
implementation and you need to provide a DefaultThumbnailView.Callback
implementation when thumbnails should be rendered. The callback is used to get a
target rectangle for the thumbnail image.
-
Field Summary
Fields inherited from interface com.castlabs.android.player.PlayerViewPlugin.PlayerViewComponent
POSITION_DEBUG, POSITION_SUBTITLES, POSITION_THUMBNAILS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear the currently displayed Thumbnail, if anyint
void
hide()
Hide the thumbnail viewvoid
show
(long positionUs, DefaultThumbnailView.Callback callback) Shows thecurrent
thumbnail for the given position in microseconds.void
show
(long positionUs, DefaultThumbnailView.Callback callback, int thumbnailIndex) Shows a thumbnail for the given position in microseconds.Methods inherited from class com.castlabs.android.player.PlayerViewPlugin.SingleViewPlayerViewComponent
attachToPlayerView, getView, id
-
Constructor Details
-
ThumbnailViewComponent
public ThumbnailViewComponent()
-
-
Method Details
-
getViewElevation
public int getViewElevation() -
show
public void show(long positionUs, @NonNull DefaultThumbnailView.Callback callback, @ThumbnailIndex int thumbnailIndex) Shows a thumbnail for the given position in microseconds.- Parameters:
positionUs
- The position in microsecondscallback
- The callback that will be used to get the target output locationthumbnailIndex
- The type thumbnail to return, one ofThumbsPlugin.THUMBNAIL_INDEX_CURRENT
,ThumbsPlugin.THUMBNAIL_INDEX_NEXT
orThumbsPlugin.THUMBNAIL_INDEX_CLOSEST
-
show
Shows thecurrent
thumbnail for the given position in microseconds.- Parameters:
positionUs
- The position in microsecondscallback
- The callback that will be used to get the target output location
-
hide
public void hide()Hide the thumbnail view -
clear
public void clear()Clear the currently displayed Thumbnail, if any
-