Class ThumbnailComponent
- java.lang.Object
-
- com.brightcove.player.event.AbstractComponent
-
- com.brightcove.player.mediacontroller.ThumbnailComponent
-
- All Implemented Interfaces:
Component
@ListensFor(events={"didSetVideo","configurationChanged","restoreDefaultMediaController"}) @Emits(events={"thumbnailFormatSelected","seekControllerConfiguration"}) public final class ThumbnailComponent extends AbstractComponent
Thumbnail Component Plugin.This plugin facilitates displaying preview thumbnail
The main code to be implemented from this class:
ThumbnailComponent thumbnailComponent = new ThumbnailComponent(brightcoveVideoView); thumbnailComponent.setupPreviewThumbnailController(); ...
If you are also using the SSAI plugin, you will need additional setup to account for the gap between the absolute and relative playhead position introduced by the Ad breaks.
eventEmitter.once(AD_DATA_READY, event -> { Timeline timeline = event.getProperty(SSAIEvent.VMAP_TIMELINE, Timeline.class); thumbnailComponent.setThumbnailDocumentCreator( new SSAIThumbnailDocumentCreatorWrapper(new DefaultThumbnailDocumentCreator(), timeline) ); });
-
-
Field Summary
-
Fields inherited from class com.brightcove.player.event.AbstractComponent
eventEmitter, listenerTokens
-
-
Constructor Summary
Constructors Constructor Description ThumbnailComponent(BaseVideoView baseVideoView)
Creates a new ThumbnailComponent instance with theBaseVideoView
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PreviewLoader
getPreviewLoader()
Gets thePreviewLoader
responsible to download the images and load them into the Thumbnail View.ThumbnailDocumentCreator
getThumbnailDocumentCreator()
Returns theThumbnailDocumentCreator
void
setPreviewLoader(PreviewLoader previewLoader)
Sets aPreviewLoader
responsible to download the images and load them into the Thumbnail View.void
setThumbnailDocumentCreator(ThumbnailDocumentCreator thumbnailDocumentCreator)
Sets theThumbnailDocumentCreator
for creating theThumbnailDocument
void
setThumbnailFormatSelector(PreviewThumbnailFormatSelector selector)
Sets thePreviewThumbnailFormatSelector
, used to select aPreviewThumbnailFormat
to create ourThumbnailDocument
.void
setupPreviewThumbnailController()
Finish setting up the component to support Preview Thumbnail scrubbing.-
Methods inherited from class com.brightcove.player.event.AbstractComponent
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
-
-
-
-
Constructor Detail
-
ThumbnailComponent
public ThumbnailComponent(@NonNull BaseVideoView baseVideoView)
Creates a new ThumbnailComponent instance with theBaseVideoView
- Parameters:
baseVideoView
- the Brightcove video view
-
-
Method Detail
-
setupPreviewThumbnailController
public void setupPreviewThumbnailController()
Finish setting up the component to support Preview Thumbnail scrubbing. As part of the setup, a newBrightcoveMediaController
instance with Preview Thumbnail support is created and is automatically added to the Video View. Because this method creates View components, it MUST be called from the UI thread.
-
setThumbnailFormatSelector
public void setThumbnailFormatSelector(@NonNull PreviewThumbnailFormatSelector selector)
Sets thePreviewThumbnailFormatSelector
, used to select aPreviewThumbnailFormat
to create ourThumbnailDocument
.- Parameters:
selector
- thePreviewThumbnailFormat
selector
-
getPreviewLoader
@NonNull public PreviewLoader getPreviewLoader()
Gets thePreviewLoader
responsible to download the images and load them into the Thumbnail View.- Returns:
- the preview loader
-
setPreviewLoader
public void setPreviewLoader(@NonNull PreviewLoader previewLoader)
Sets aPreviewLoader
responsible to download the images and load them into the Thumbnail View.- Parameters:
previewLoader
- the preview loader
-
setThumbnailDocumentCreator
public void setThumbnailDocumentCreator(@NonNull ThumbnailDocumentCreator thumbnailDocumentCreator)
Sets theThumbnailDocumentCreator
for creating theThumbnailDocument
- Parameters:
thumbnailDocumentCreator
- theThumbnailDocument
creator
-
getThumbnailDocumentCreator
@NonNull public ThumbnailDocumentCreator getThumbnailDocumentCreator()
Returns theThumbnailDocumentCreator
-
-