Display An Image In Default Media Player Of Android
Here is my code. First I recorded an audio file and started playing it. For playing the audio file /** * * play the recorded audio * */ public void playAudio() { try
Solution 1:
The default media player is using the following code to retrieve the album art of a song.
Uri sArtworkUri = Uri.parse("content://media/external/audio/albumart");
Uri uri = ContentUris.withAppendedId(sArtworkUri, album_id);
ContentResolver res = context.getContentResolver();
InputStream in = res.openInputStream(uri);
Bitmap artwork = BitmapFactory.decodeStream(in);
where album_id is the albumd id of the song. So in order to show an album art the default player should know the album id and check if there is album art associated with this id. So if you want to show artwork you have to insert your file in android's database and then play it from there.
Post a Comment for "Display An Image In Default Media Player Of Android"