适合显示某物预览的SeekBar。就像Google Play Movies中看到的那样。


dependencies {
compile 'com.github.rubensousa:previewseekbar:0.2'
}
<com.github.rubensousa.previewseekbar.PreviewSeekBarLayout
android:id="@+id/previewSeekBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:id="@+id/previewFrameLayout"
android:layout_width="@dimen/video_preview_width"
android:layout_height="@dimen/video_preview_height">
<View
android:id="@+id/videoView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@color/colorPrimary" />
</FrameLayout>
<com.github.rubensousa.previewseekbar.PreviewSeekBar
android:id="@+id/previewSeekBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/previewFrameLayout"
android:layout_marginTop="25dp"
android:max="800" />
</com.github.rubensousa.previewseekbar.PreviewSeekBarLayout>
PreviewSeekBarLayout从RelativeLayout中扩展所以你可以在其中添加其他视图或者布局。
// setOnSeekBarChangeListener was overridden to do the same as below seekBar.addOnSeekBarChangeListener(this);
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
// I can't help anymore
}
<com.google.android.exoplayer2.ui.SimpleExoPlayerView
android:id="@+id/player_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:controller_layout_id="@layout/exoplayer_controls"/>
exoplayer_controls中的PreviewSeekBarLayout应该类似这样:
<com.github.rubensousa.previewseekbar.PreviewSeekBarLayout
android:id="@+id/previewSeekBarLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<FrameLayout
android:id="@+id/previewFrameLayout"
android:layout_width="@dimen/video_preview_width"
android:layout_height="@dimen/video_preview_height"
android:background="@drawable/video_frame"
android:padding="@dimen/video_frame_width">
<com.google.android.exoplayer2.ui.SimpleExoPlayerView
android:id="@+id/previewPlayerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:controller_layout_id="@layout/exo_simple_player_view"
app:surface_type="texture_view"
app:use_artwork="false"
app:use_controller="false" />
</FrameLayout>
<com.github.rubensousa.previewseekbar.PreviewSeekBar
android:id="@+id/exo_progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/previewFrameLayout"
android:layout_marginTop="10dp"
android:max="800" />
</com.github.rubensousa.previewseekbar.PreviewSeekBarLayout>
<com.google.android.exoplayer2.ui.SimpleExoPlayerView
android:id="@+id/previewPlayerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:controller_layout_id="@layout/exo_simple_player_view"
app:surface_type="texture_view"
app:use_artwork="false"
app:use_controller="false" />
一个完美的Android视频播放条控件(刻度尺)
Android基于IJKPlayer,实现了多功能的视频播放器源码
Android支持全屏、小窗口的视频播放器
Android一个支持自定义布局和直播 手势 亮度,音量,快进,等手
安卓MP3音频录制,支持类似IOS原生的单边或者双边波形显示
EvilsLive一款开源的视频直播项目
安卓来疯直播控件,支持flv,支持rtmp,支持添加视频特效等等
Android显示视频预览的SeekBar - PreviewSeekBar
Android 音乐播放器 KJ音乐
科大讯飞语音识别最简单的使用例子Android源码
Android自定义控件音乐播放器
北邮IPTV Android客户端源码,可收看频道,收藏频道,发送弹幕。
一个完美的Android视频播放条控件(刻度尺)
Android基于IJKPlayer,实现了多功能的视频播放器源码
Android支持全屏、小窗口的视频播放器
Android一个支持自定义布局和直播 手势 亮度,音量,快进,等手
安卓MP3音频录制,支持类似IOS原生的单边或者双边波形显示
EvilsLive一款开源的视频直播项目
热门源码