DASH-IF thumbnails
To test this feature and view the example code, please see the (5.33.x) Android SDK 5 Example Code Quick Start guide.
The operation is instigated by the application providing the OTVVideoView
instance with a thumbnail listener before delivering it with the stream’s URL. So that playback start time is not compromised, thumbnails are prepared asynchronously; this also means that the thumbnails are not available at the beginning of playback. The SDK notifies the application of the thumbnail preparation state through the provided listener and, once prepared, will provide the application with a thumbnail view to display.
Preparation time (the time it takes from the start of playback until thumbnails are available for preview) depends on the number of thumbnails and their size (bandwidth). This could take a fraction of a second for short content with few thumbnails to several seconds for long-duration content with a high density of thumbnails.
Preparing a listener in the application
Just before setting the video path of the stream to play, provide the OTVVideoView
instance with the thumbnail listener
mOTVVideoView.setThumbnailListener(mThumbnailListener);
// ...
mOTVVideoView.setVideoPath(STREAM_URI);
The OTVThumbnailView
instance provided in the prepared()
callback is used to display all thumbnails. The application must update the view with the correct image by specifying the desired time. The SDK will match the position (in milliseconds) with the correct thumbnail image.
thumbnailView.seekTime(positionMs);
The example code implements a simple seek bar in a ThumbnailMediaController
class which demonstrates the usage of the thumbnail view provided in the prepared()
callback.