summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2011-10-19 23:05:58 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-10-19 23:05:58 -0700
commit247c37b0b7cd29d58dc96322c993437674636977 (patch)
tree0ff98827d347e6767c000f3e22ea07c2f41f3939 /src/com/android
parent7c278bcad6d4cdf7eb4b8e3c0803e65bc671cebd (diff)
parent0c1ec7e8cd43de1a4b4cb650b759dd0cbe123eaa (diff)
downloadpackages_apps_LegacyCamera-247c37b0b7cd29d58dc96322c993437674636977.zip
packages_apps_LegacyCamera-247c37b0b7cd29d58dc96322c993437674636977.tar.gz
packages_apps_LegacyCamera-247c37b0b7cd29d58dc96322c993437674636977.tar.bz2
am 0c1ec7e8: Fix the resolver activity shows the apps that cannot play the video.
* commit '0c1ec7e8cd43de1a4b4cb650b759dd0cbe123eaa': Fix the resolver activity shows the apps that cannot play the video.
Diffstat (limited to 'src/com/android')
-rwxr-xr-xsrc/com/android/camera/VideoCamera.java26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java
index f244f2d..63b5cea 100755
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -564,7 +564,8 @@ public class VideoCamera extends ActivityBase
}
private void startPlayVideoActivity() {
- Intent intent = new Intent(Intent.ACTION_VIEW, mCurrentVideoUri);
+ Intent intent = new Intent(Intent.ACTION_VIEW);
+ intent.setDataAndType(mCurrentVideoUri, convertOutputFormatToMimeType(mProfile.fileFormat));
try {
startActivity(intent);
} catch (ActivityNotFoundException ex) {
@@ -1349,12 +1350,9 @@ public class VideoCamera extends ActivityBase
private void generateVideoFilename(int outputFileFormat) {
long dateTaken = System.currentTimeMillis();
String title = createName(dateTaken);
- String filename = title + ".3gp"; // Used when emailing.
- String mime = "video/3gpp";
- if (outputFileFormat == MediaRecorder.OutputFormat.MPEG_4) {
- filename = title + ".mp4";
- mime = "video/mp4";
- }
+ // Used when emailing.
+ String filename = title + convertOutputFormatToFileExt(outputFileFormat);
+ String mime = convertOutputFormatToMimeType(outputFileFormat);
mVideoFilename = Storage.DIRECTORY + '/' + filename;
mCurrentVideoValues = new ContentValues(7);
mCurrentVideoValues.put(Video.Media.TITLE, title);
@@ -2361,4 +2359,18 @@ public class VideoCamera extends ActivityBase
mResetEffect = true;
return false;
}
+
+ private String convertOutputFormatToMimeType(int outputFileFormat) {
+ if (outputFileFormat == MediaRecorder.OutputFormat.MPEG_4) {
+ return "video/mp4";
+ }
+ return "video/3gpp";
+ }
+
+ private String convertOutputFormatToFileExt(int outputFileFormat) {
+ if (outputFileFormat == MediaRecorder.OutputFormat.MPEG_4) {
+ return ".mp4";
+ }
+ return ".3gp";
+ }
}