PreviewSeekBar
A SeekBar suited for showing a preview of something. As seen in Google Play Movies.
Build
Add the following to your app's build.gradle:
How to use
Add the following XML:
You need to add at least one PreviewSeekBar and a FrameLayout inside PreviewSeekBarLayout, else an exception will be thrown.
PreviewSeekBarLayout extends from RelativeLayout so you can add other views or layouts there.
Create a PreviewLoader and pass it to PreviewSeekBarLayout:
How to use with ExoPlayer
Add a custom controller to your SimpleExoPlayerView
Here's the sample's exoplayer_controls: https://github.com/rubensousa/PreviewSeekBar/blob/master/sample/src/main/res/layout/exoplayer_controls.xml
The PreviewSeekBarLayout inside exoplayer_controls should be similar to this:
Use the following SimpleExoPlayerView for the preview:
We specify another controller layout because the default one includes a SeekBar with the same id as ours.
Create a player with a custom TrackSelection and LoadControl
PreviewLoadControl and WorstVideoTrackSelection are already included in previewseekbar-exoplayer.
Check the next section for some improvements notes.