Buntupana
Buntupana

Reputation: 1023

MediaMetadataRetriever throws RuntimeException in Android 11

I'm trying to get a frame from a video with MediaMetadataRetriever and just in Android 11 the function MetadataRetriever.setDataSource(path: String) is throwing an exception like this:

java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA

I've noticed that in Android 11, in that function this info has been added: The path, or the URI (doesn't support streaming source currently) of the input media file.

does it mean that video files in MediaMetadataRetriever are not supported anymore in Android 11??

Upvotes: 0

Views: 641

Answers (1)

Berslen Akkaya
Berslen Akkaya

Reputation: 13

I have found the solution. I hope it helps, use MetadataRetriever as follows

inputStream = new FileInputStream(file.getAbsolutePath());
retriever.setDataSource(inputStream.getFD());

Upvotes: 1

Related Questions