summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/app/MoviePlayer.java
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2012-07-03 12:49:45 +0800
committerChih-Chung Chang <chihchung@google.com>2012-07-03 18:31:13 +0800
commit6772173d2a49b87a1d209f42fe52b5f830596f99 (patch)
tree051c9c01b242bcb1e11ccfdf8f4fcac7a355995e /src/com/android/gallery3d/app/MoviePlayer.java
parentdf4763cf8752fb1babc7244fc2be33ed87d3b072 (diff)
downloadandroid_packages_apps_Gallery2-6772173d2a49b87a1d209f42fe52b5f830596f99.tar.gz
android_packages_apps_Gallery2-6772173d2a49b87a1d209f42fe52b5f830596f99.tar.bz2
android_packages_apps_Gallery2-6772173d2a49b87a1d209f42fe52b5f830596f99.zip
Remove dependencies on APIs only exist on newer platforms.
Change-Id: I606a23863247454051dd183ddf6b77f6bc882685
Diffstat (limited to 'src/com/android/gallery3d/app/MoviePlayer.java')
-rw-r--r--src/com/android/gallery3d/app/MoviePlayer.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/app/MoviePlayer.java b/src/com/android/gallery3d/app/MoviePlayer.java
index 660c4d953..f2dc9ad20 100644
--- a/src/com/android/gallery3d/app/MoviePlayer.java
+++ b/src/com/android/gallery3d/app/MoviePlayer.java
@@ -58,6 +58,10 @@ public class MoviePlayer implements
private static final String KEY_VIDEO_POSITION = "video-position";
private static final String KEY_RESUMEABLE_TIME = "resumeable-timeout";
+ // These are constants in KeyEvent, appearing on API level 11.
+ private static final int KEYCODE_MEDIA_PLAY = 126;
+ private static final int KEYCODE_MEDIA_PAUSE = 127;
+
// Copied from MediaPlaybackService in the Music Player app.
private static final String SERVICECMD = "com.android.music.musicservicecommand";
private static final String CMDNAME = "command";
@@ -411,12 +415,12 @@ public class MoviePlayer implements
playVideo();
}
return true;
- case KeyEvent.KEYCODE_MEDIA_PAUSE:
+ case KEYCODE_MEDIA_PAUSE:
if (mVideoView.isPlaying()) {
pauseVideo();
}
return true;
- case KeyEvent.KEYCODE_MEDIA_PLAY:
+ case KEYCODE_MEDIA_PLAY:
if (!mVideoView.isPlaying()) {
playVideo();
}