Issue
I tried to use MediaMetadataRetriever with Kotlin use:
MediaMetadataRetriever().apply {
setDataSource(context, uri)
}.use {
...
}
But it gives me an error on Android 6 Marshmallow (23 API):
java.lang.ClassCastException: android.media.MediaMetadataRetriever cannot be cast to java.lang.AutoCloseable
Why so?
Solution
MediaMetadataRetriever implements AutoCloseable since API level 29.
Answered By - sdex
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.