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 PreviewLoadergetPreviewLoader()Gets thePreviewLoaderresponsible to download the images and load them into the Thumbnail View.ThumbnailDocumentCreatorgetThumbnailDocumentCreator()Returns theThumbnailDocumentCreatorvoidsetPreviewLoader(PreviewLoader previewLoader)Sets aPreviewLoaderresponsible to download the images and load them into the Thumbnail View.voidsetThumbnailDocumentCreator(ThumbnailDocumentCreator thumbnailDocumentCreator)Sets theThumbnailDocumentCreatorfor creating theThumbnailDocumentvoidsetThumbnailFormatSelector(PreviewThumbnailFormatSelector selector)Sets thePreviewThumbnailFormatSelector, used to select aPreviewThumbnailFormatto create ourThumbnailDocument.voidsetupPreviewThumbnailController()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 newBrightcoveMediaControllerinstance 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 aPreviewThumbnailFormatto create ourThumbnailDocument.- Parameters:
selector- thePreviewThumbnailFormatselector
-
getPreviewLoader
@NonNull public PreviewLoader getPreviewLoader()
Gets thePreviewLoaderresponsible to download the images and load them into the Thumbnail View.- Returns:
- the preview loader
-
setPreviewLoader
public void setPreviewLoader(@NonNull PreviewLoader previewLoader)Sets aPreviewLoaderresponsible to download the images and load them into the Thumbnail View.- Parameters:
previewLoader- the preview loader
-
setThumbnailDocumentCreator
public void setThumbnailDocumentCreator(@NonNull ThumbnailDocumentCreator thumbnailDocumentCreator)Sets theThumbnailDocumentCreatorfor creating theThumbnailDocument- Parameters:
thumbnailDocumentCreator- theThumbnailDocumentcreator
-
getThumbnailDocumentCreator
@NonNull public ThumbnailDocumentCreator getThumbnailDocumentCreator()
Returns theThumbnailDocumentCreator
-
-