private String mimeType = ""; private MediaPlayer mMediapPlayer = null;
MediaPlayer.TrackInfo[] ti = mMediapPlayer.getTrackInfo(); MediaPlayer.TrackInfo videoInfo = null; for (int i = 0; i<ti.length;i++){ if(ti[i].getTrackType() == MediaPlayer.TrackInfo.MEDIA_TRACK_TYPE_VIDEO) { videoInfo = ti[i]; } } if(videoInfo != null) { Log.d(TAG, "video info is : " + videoInfo.toString()); String fullStr = videoInfo.toString(); String sub1 = fullStr.substring(fullStr.indexOf("mime=")); mimeType = sub1.substring(5, sub1.indexOf(",")); }