summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2015-03-11 19:51:54 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2015-03-11 19:51:54 -0700
commit7cb1ef7c968b1c7829444d7a05aa536d9f073600 (patch)
tree8885b6da2aa891c2970a5ce92a697a7b323b2c8f /src
parent7b94131b05cc1d2846c747beb71b5a29136bf873 (diff)
parent7e23452f005201ee01f84de4a82da61996bd7da9 (diff)
downloadandroid_packages_apps_Gallery2-7cb1ef7c968b1c7829444d7a05aa536d9f073600.tar.gz
android_packages_apps_Gallery2-7cb1ef7c968b1c7829444d7a05aa536d9f073600.tar.bz2
android_packages_apps_Gallery2-7cb1ef7c968b1c7829444d7a05aa536d9f073600.zip
Merge "Gallery2: Pause video when dialog shows"
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 4c0df84cc..509201640 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 20d14f900..41fd09c53 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;