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
ConstructorDescriptionThumbnailComponent
(BaseVideoView baseVideoView) Creates a new ThumbnailComponent instance with theBaseVideoView
-
Method Summary
Modifier and TypeMethodDescriptionGets thePreviewLoader
responsible to download the images and load them into the Thumbnail View.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
Sets thePreviewThumbnailFormatSelector
, used to select aPreviewThumbnailFormat
to create ourThumbnailDocument
.void
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 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 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
Sets thePreviewThumbnailFormatSelector
, used to select aPreviewThumbnailFormat
to create ourThumbnailDocument
.- Parameters:
selector
- thePreviewThumbnailFormat
selector
-
getPreviewLoader
Gets thePreviewLoader
responsible to download the images and load them into the Thumbnail View.- Returns:
- the preview loader
-
setPreviewLoader
Sets aPreviewLoader
responsible to download the images and load them into the Thumbnail View.- Parameters:
previewLoader
- the preview loader
-
setThumbnailDocumentCreator
Sets theThumbnailDocumentCreator
for creating theThumbnailDocument
- Parameters:
thumbnailDocumentCreator
- theThumbnailDocument
creator
-
getThumbnailDocumentCreator
Returns theThumbnailDocumentCreator
-