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

  • 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 microseconds
      callback - The callback that will be used to get the target output location
      thumbnailIndex - The type thumbnail to return, one of ThumbsPlugin.THUMBNAIL_INDEX_CURRENT, ThumbsPlugin.THUMBNAIL_INDEX_NEXT or ThumbsPlugin.THUMBNAIL_INDEX_CLOSEST
    • show

      public void show(long positionUs, @NonNull DefaultThumbnailView.Callback callback)
      Shows the current thumbnail for the given position in microseconds.
      Parameters:
      positionUs - The position in microseconds
      callback - 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