I have a media player in my android app. I have to find the codecs used in the file that is played by this media player. I have the following code.
TrackInfo[] ti = mediaplayer.getTrackInfo();
MediaFormat mf;
for (int i = 0; i<ti.length;i++){
if(ti[i].getTrackType() == TrackInfo.MEDIA_TRACK_TYPE_AUDIO)
{
mf = ti[i].getFormat();
}
}
But, I get an error saying "The method getFormat() is undefined for the type MediaPlayer.TrackInfo". But it can be seen here that there is indeed a function. I am able to call getTrackType, but not getFormat. What is the reason?