video player: add progress bar
This commit is contained in:
parent
b26d659004
commit
c79fb5a1b2
@ -147,6 +147,10 @@ public class VideoPlayerActivity extends CommonActivity {
|
||||
mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
|
||||
@Override
|
||||
public void onPrepared(MediaPlayer mp) {
|
||||
|
||||
View loadingBar = findViewById(R.id.video_loading);
|
||||
if (loadingBar != null) loadingBar.setVisibility(View.GONE);
|
||||
|
||||
resizeSurface();
|
||||
mp.setLooping(true);
|
||||
mp.start();
|
||||
|
@ -16,6 +16,13 @@
|
||||
android:layout_gravity="center"
|
||||
android:id="@+id/video_player"
|
||||
android:transitionName="TRANSITION:ARTICLE_VIDEO_PLAYER" />
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/video_loading"
|
||||
android:layout_gravity="center"
|
||||
android:indeterminate="true" />
|
||||
</FrameLayout>
|
||||
|
||||
<include layout="@layout/toolbar" android:id="@+id/toolbar" />
|
||||
|
Loading…
Reference in New Issue
Block a user