In my app my actual requirement is record video file and share to another through mail.. But present now i am able to record video file and share that file throgh mail friends or someone... my shared file is played sometimes on real device and some other times not plaing on real device. this happens because of reducing the file size on downloading the file . may be improper encoding of audio and video or output format of file or send to mail attachments problem...
where is the problem? please help me....
when record start my code is:
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mediaRecorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
mediaRecorder.setOutputFile("/sdcard/myvideo.3gp");
mediaRecorder.setMaxDuration(60000); // Set max duration 60 sec.
and send file to mail code is:
fileshare = new File("/sdcard/myvideo.3gp");
File filelocation = fileshare ;
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("video/3gp");
sharingIntent.putExtra(Intent.EXTRA_EMAIL, "xxxxxxxxx@gmail.com" );
sharingIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+filelocation.getAbsolutePath()));
startActivity(Intent.createChooser(sharingIntent, "Send email"));