Reputation: 1013
I have followed this to record the video. I have used the following coding to play the recorded Video..
url = "file:///mnt/sdcard/CaptureVideo/1510402819.3gpp"
Intent i = new Intent(Intent.ACTION_VIEW);
i.setDataAndType(Uri.parse(url), "video/*");
startActivity(i);
i have tried with mp4 and mp3 format still could not hear the sound. . .
NOTE: if i am playing the recorded video directly not able to hear sound.. Any one help me..
Upvotes: 1
Views: 505
Reputation: 7031
Set the AudioSource and Audio Encoder as follows,
recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.DEFAULT);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
Upvotes: 0
Reputation: 16053
try this :
Intent movieIntent = new Intent();
movieIntent.setAction(android.content.Intent.ACTION_VIEW);
movieIntent.setDataAndType(Uri.fromFile(file), "video/*");
startActivity(movieIntent);
Upvotes: 1