Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b60b793 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Hide video preference when video is not avaiable."

parents a3a83470 26ce68c0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ public class VideoPreference extends Preference {
                    .build();
            mMediaPlayer = MediaPlayer.create(mContext, mVideoPath);
            if (mMediaPlayer != null && mMediaPlayer.getDuration() > 0) {
                setVisible(true);
                setLayoutResource(R.layout.video_preference);

                mPreviewResource = attributes.getResourceId(
@@ -71,6 +72,8 @@ public class VideoPreference extends Preference {

                mMediaPlayer.setOnPreparedListener(mediaPlayer -> mediaPlayer.setLooping(true));
                mAnimationAvailable = true;
            } else {
                setVisible(false);
            }
        } catch (Exception e) {
            Log.w(TAG, "Animation resource not found. Will not show animation.");