John
John

Reputation: 8946

browsing and playing audio and video files in android

I am developing a project in which i need to play Audio and Video files. When audio player is clicked i should display only audio files from sdcard and play those files.

When video player is clicked i only need to display video files and play those video files.

I am using media player for playing the files.

 MediaPlayer mp = new MediaPlayer();
 String filepath = Environment.getExternalStorageDirectory()+"/f.mp3";
 mp.setDataSource(filepath);
 mp.start();

But My problem is,how to browse the audio/video files and set the data source dynamically when the user selects a particular file.

Upvotes: 0

Views: 1605

Answers (1)

Related Questions