HLS I-frame thumbnails
To test this feature and view the example code, please see the Android SDK 5 Example Code Quick Start guide.
The HLS I-Frame thumbnails view requires an extra decoder/descrambler; this feature may not work on some older devices with decoder hardware limitations.
Preparing the listener
To preview HLS I-Frame thumbnails while performing a seek, the application needs to implement and set IOTVThumbnailListener
on the OTVVideoView
instance.
Seek method
While performing a player seek on the control bar, to display the HLS I-Frame thumbnails, the application needs to call seekIFrameTo
method on the player view instance. When the control bar is initialised, so that it can call seekIFrameTo
when the user seeks, the application needs to pass the player view instance to the control bar.
//void seekIFrameTo(long position)
mOTVVideoView.seekIFrameTo(position)
Disabling I-frame Thumbnail Tracks
If i-frame thumbnails are not required, they can be disabled through player configuration prior to starting playback:
// Apply the configuration
OTVPlayerConfiguration.Builder configBuilder = new OTVPlayerConfiguration.Builder();
configBuilder.setDisableLoadingIFrameOnlyTracks(true);
mOTVVideoView.setPlayerConfiguration(configBuilder.build());
// Start playback
mOTVVideoView.setVideoPath("https://video.host/stream.mpd");
mOTVVideoView.start();