Multimedia
Multimedia
We can play and control the audio files in android by the help of MediaPlayer
class.
The android.media.MediaPlayer class is used to control the audio or video
files.
Methods of MediaPlayer
class
There are many methods of MediaPlayer class. Some of them are as follows:
Method Description
public void setDataSource(String path) sets the data source (file path or http url) to use.
public void setLooping(boolean looping) sets the player for looping or non-looping.
public void selectTrack(int index) it selects a track for the specified index.