Remove dependencies on APIs only exist on newer platforms.
Change-Id: I606a23863247454051dd183ddf6b77f6bc882685
diff --git a/src/com/android/gallery3d/app/MoviePlayer.java b/src/com/android/gallery3d/app/MoviePlayer.java
index 660c4d9..f2dc9ad 100644
--- a/src/com/android/gallery3d/app/MoviePlayer.java
+++ b/src/com/android/gallery3d/app/MoviePlayer.java
@@ -58,6 +58,10 @@
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 @@
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();
}