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

  Constructors
  Constructor
  Description
  `ThumbnailViewComponent()`
  Default constructor for the ThumbnailViewComponent.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clear()`
  Clear the currently displayed Thumbnail, if any
  `int`
  `getViewElevation()`
  `void`
  `hide()`
  Hide the thumbnail view
  `void`
  `show(long positionUs, DefaultThumbnailView.Callback callback)`
  Shows the `current` 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`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ThumbnailViewComponent

    public ThumbnailViewComponent()
    Default constructor for the ThumbnailViewComponent.

    Used by the `ThumbsPlugin.ThumbnailViewPlugin` to create an instance of this component.

- ## 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