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
ConstructorsConstructorDescriptionThumbnailComponent(BaseVideoView baseVideoView) Creates a new ThumbnailComponent instance with theBaseVideoView -
Method Summary
Modifier and TypeMethodDescriptionGets thePreviewLoaderresponsible to download the images and load them into the Thumbnail View.Returns theThumbnailDocumentCreatorvoidsetPreviewLoader(PreviewLoader previewLoader) Sets aPreviewLoaderresponsible to download the images and load them into the Thumbnail View.voidsetThumbnailDocumentCreator(ThumbnailDocumentCreator thumbnailDocumentCreator) Sets theThumbnailDocumentCreatorfor creating theThumbnailDocumentvoidSets thePreviewThumbnailFormatSelector, used to select aPreviewThumbnailFormatto create ourThumbnailDocument.voidFinish setting up the component to support Preview Thumbnail scrubbing.Methods inherited from class com.brightcove.player.event.AbstractComponent
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
-
Constructor Details
-
ThumbnailComponent
Creates a new ThumbnailComponent instance with theBaseVideoView- Parameters:
baseVideoView- the Brightcove video view
-
-
Method Details
-
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
Sets thePreviewThumbnailFormatSelector, used to select aPreviewThumbnailFormatto create ourThumbnailDocument.- Parameters:
selector- thePreviewThumbnailFormatselector
-
getPreviewLoader
Gets thePreviewLoaderresponsible to download the images and load them into the Thumbnail View.- Returns:
- the preview loader
-
setPreviewLoader
Sets aPreviewLoaderresponsible to download the images and load them into the Thumbnail View.- Parameters:
previewLoader- the preview loader
-
setThumbnailDocumentCreator
Sets theThumbnailDocumentCreatorfor creating theThumbnailDocument- Parameters:
thumbnailDocumentCreator- theThumbnailDocumentcreator
-
getThumbnailDocumentCreator
Returns theThumbnailDocumentCreator
-