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 thePlayerView
and you can access it to trigger displaying thumbnails.The view component adds the default
DefaultThumbnailView
to the root view of thePlayerView
and uses the Thumbnail provider exposed throughPlayerController.getComponent(Class)
to get thumbnail images.This view is accessible through
PlayerView.getComponent(Class)
and exposesshow(long, DefaultThumbnailView.Callback)
andhide()
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 aDefaultThumbnailView.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
Constructors Constructor Description ThumbnailViewComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clear the currently displayed Thumbnail, if anyint
getViewElevation()
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
-
-
-
-
Method Detail
-
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
public void show(long positionUs, @NonNull DefaultThumbnailView.Callback callback)
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
-
-