summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/app/MovieActivity.java
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2011-09-14 19:49:03 +0800
committerOwen Lin <owenlin@google.com>2011-09-20 11:40:17 +0800
commit0fdbf235f6021738172f6f1ca4b6bbfa0d7ce655 (patch)
tree2a1b718c690813e468926be94df46073ebad1f5a /src/com/android/gallery3d/app/MovieActivity.java
parent350646b3edc73227bfcd1024202cc0fe0405c1b9 (diff)
downloadandroid_packages_apps_Snap-0fdbf235f6021738172f6f1ca4b6bbfa0d7ce655.tar.gz
android_packages_apps_Snap-0fdbf235f6021738172f6f1ca4b6bbfa0d7ce655.tar.bz2
android_packages_apps_Snap-0fdbf235f6021738172f6f1ca4b6bbfa0d7ce655.zip
Pause the playback of video if the activity is resumed after 3 mins.
fix: 5260232 Also keep the current playback position when the activity is resumed. Originally, we use the bookmark to keep the position. However, the bookmark will be ignored if 1.) The video duration is less than 2 mins, 2.) The video is just started (with 30sec), or 3.) The video is approching the end. I think resume should not limited by the above rules. And we did get some reports on this. (We mark them as WORK AS INTENTDED). Change-Id: Ib9ac359d7ccb6a0278777b0892f0821e16bbb745
Diffstat (limited to 'src/com/android/gallery3d/app/MovieActivity.java')
-rw-r--r--src/com/android/gallery3d/app/MovieActivity.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/app/MovieActivity.java b/src/com/android/gallery3d/app/MovieActivity.java
index 4c9be7ef0..d0383aa35 100644
--- a/src/com/android/gallery3d/app/MovieActivity.java
+++ b/src/com/android/gallery3d/app/MovieActivity.java
@@ -52,7 +52,7 @@ public class MovieActivity extends Activity {
View rootView = findViewById(R.id.root);
Intent intent = getIntent();
setVideoTitle(intent);
- mPlayer = new MoviePlayer(rootView, this, intent.getData()) {
+ mPlayer = new MoviePlayer(rootView, this, intent.getData(), savedInstanceState) {
@Override
public void onCompletion() {
if (mFinishOnCompletion) {
@@ -73,7 +73,6 @@ public class MovieActivity extends Activity {
WindowManager.LayoutParams winParams = win.getAttributes();
winParams.buttonBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_OFF;
win.setAttributes(winParams);
-
}
private void setVideoTitle(Intent intent) {
@@ -124,6 +123,12 @@ public class MovieActivity extends Activity {
}
@Override
+ public void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+ mPlayer.onSaveInstanceState(outState);
+ }
+
+ @Override
public void onDestroy() {
mPlayer.onDestroy();
super.onDestroy();