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() {
|
mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPrepared(MediaPlayer mp) {
|
public void onPrepared(MediaPlayer mp) {
|
||||||
|
|
||||||
|
View loadingBar = findViewById(R.id.video_loading);
|
||||||
|
if (loadingBar != null) loadingBar.setVisibility(View.GONE);
|
||||||
|
|
||||||
resizeSurface();
|
resizeSurface();
|
||||||
mp.setLooping(true);
|
mp.setLooping(true);
|
||||||
mp.start();
|
mp.start();
|
||||||
|
@ -16,6 +16,13 @@
|
|||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:id="@+id/video_player"
|
android:id="@+id/video_player"
|
||||||
android:transitionName="TRANSITION:ARTICLE_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>
|
</FrameLayout>
|
||||||
|
|
||||||
<include layout="@layout/toolbar" android:id="@+id/toolbar" />
|
<include layout="@layout/toolbar" android:id="@+id/toolbar" />
|
||||||
|
Loading…
Reference in New Issue
Block a user