@ListensFor(events={"didSetVideo","configurationChanged","restoreDefaultMediaController"}) @Emits(events={"thumbnailFormatSelected","seekControllerConfiguration"}) public final class ThumbnailComponent extends AbstractComponent
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)
);
});
eventEmitter, listenerTokens
Constructor and Description |
---|
ThumbnailComponent(BaseVideoView baseVideoView)
Creates a new ThumbnailComponent instance with the
BaseVideoView |
Modifier and Type | Method and Description |
---|---|
PreviewLoader |
getPreviewLoader()
Gets the
PreviewLoader responsible to download the images and load them into the Thumbnail View. |
ThumbnailDocumentCreator |
getThumbnailDocumentCreator()
Returns the
ThumbnailDocumentCreator |
void |
setPreviewLoader(PreviewLoader previewLoader)
Sets a
PreviewLoader responsible to download the images and load them into the Thumbnail View. |
void |
setThumbnailDocumentCreator(ThumbnailDocumentCreator thumbnailDocumentCreator)
Sets the
ThumbnailDocumentCreator for creating the ThumbnailDocument |
void |
setThumbnailFormatSelector(PreviewThumbnailFormatSelector selector)
Sets the
PreviewThumbnailFormatSelector , used to select a PreviewThumbnailFormat to create our ThumbnailDocument . |
void |
setupPreviewThumbnailController()
Finish setting up the component to support Preview Thumbnail scrubbing.
|
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
public ThumbnailComponent(@NonNull BaseVideoView baseVideoView)
BaseVideoView
baseVideoView
- the Brightcove video viewpublic void setupPreviewThumbnailController()
BrightcoveMediaController
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.public void setThumbnailFormatSelector(@NonNull PreviewThumbnailFormatSelector selector)
PreviewThumbnailFormatSelector
, used to select a PreviewThumbnailFormat
to create our ThumbnailDocument
.selector
- the PreviewThumbnailFormat
selector@NonNull public PreviewLoader getPreviewLoader()
PreviewLoader
responsible to download the images and load them into the Thumbnail View.public void setPreviewLoader(@NonNull PreviewLoader previewLoader)
PreviewLoader
responsible to download the images and load them into the Thumbnail View.previewLoader
- the preview loaderpublic void setThumbnailDocumentCreator(@NonNull ThumbnailDocumentCreator thumbnailDocumentCreator)
ThumbnailDocumentCreator
for creating the ThumbnailDocument
thumbnailDocumentCreator
- the ThumbnailDocument
creator@NonNull public ThumbnailDocumentCreator getThumbnailDocumentCreator()
ThumbnailDocumentCreator