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

Commit 7cb1ef7c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Gallery2: Pause video when dialog shows"

parents 7b94131b 7e23452f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1356,6 +1356,12 @@ public class MoviePlayer implements
                            }

                        })
                        .setOnCancelListener(new OnCancelListener() {
                            public void onCancel(DialogInterface dialog) {
                                mController.showEnded();
                                onCompletion();
                            }
                        })
                        .create();
                mServerTimeoutDialog.setOnDismissListener(new OnDismissListener() {

@@ -1363,6 +1369,7 @@ public class MoviePlayer implements
                        if (LOG) {
                            Log.v(TAG, "mServerTimeoutDialog.onDismiss()");
                        }
                        mVideoView.setDialogShowState(false);
                        mIsShowDialog = false;
                    }

@@ -1373,6 +1380,7 @@ public class MoviePlayer implements
                        if (LOG) {
                            Log.v(TAG, "mServerTimeoutDialog.onShow()");
                        }
                        mVideoView.setDialogShowState(true);
                        mIsShowDialog = true;
                    }

+6 −0
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ public class CodeauroraVideoView extends SurfaceView implements MediaPlayerContr
    private boolean mNeedWaitLayout = false;
    private boolean mHasGotMetaData = false;
    private boolean mOnResumed;
    private boolean mIsShowDialog = false;

    private final Handler mHandler = new Handler() {
        public void handleMessage(final Message msg) {
@@ -746,8 +747,13 @@ public class CodeauroraVideoView extends SurfaceView implements MediaPlayerContr
        }
    }

    public void setDialogShowState(boolean isDialogShow) {
        mIsShowDialog = isDialogShow;
    }

    @Override
    public void start() {
        if (mIsShowDialog) return;
        if (isInPlaybackState()) {
            mMediaPlayer.start();
            mCurrentState = STATE_PLAYING;