summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkaiyiz <kaiyiz@codeaurora.org>2015-03-06 10:56:23 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2015-03-11 00:01:09 -0700
commit7e23452f005201ee01f84de4a82da61996bd7da9 (patch)
tree8885b6da2aa891c2970a5ce92a697a7b323b2c8f /src
parent7b94131b05cc1d2846c747beb71b5a29136bf873 (diff)
downloadandroid_packages_apps_Gallery2-7e23452f005201ee01f84de4a82da61996bd7da9.zip
android_packages_apps_Gallery2-7e23452f005201ee01f84de4a82da61996bd7da9.tar.gz
android_packages_apps_Gallery2-7e23452f005201ee01f84de4a82da61996bd7da9.tar.bz2
Gallery2: Pause video when dialog shows
The live stream will be pause by server timeout dialog but start by surface change callback later. Check whether the dialog shows before start media player. Change-Id: I77e8e2b6f84cb0957571d86d9eef2cfb997f1074 CRs-Fixed: 802294
Diffstat (limited to 'src')
-rwxr-xr-xsrc/com/android/gallery3d/app/MoviePlayer.java8
-rwxr-xr-xsrc/org/codeaurora/gallery3d/video/CodeauroraVideoView.java6
2 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/app/MoviePlayer.java b/src/com/android/gallery3d/app/MoviePlayer.java
index 4c0df84..5092016 100755
--- a/src/com/android/gallery3d/app/MoviePlayer.java
+++ b/src/com/android/gallery3d/app/MoviePlayer.java
@@ -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;
}
diff --git a/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java b/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
index 20d14f9..41fd09c 100755
--- a/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
+++ b/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
@@ -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;