I run ./gradlew :app:lint
task to generate a report.
One of them is Media Capabilities property not specified
:
../../src/main/AndroidManifest.xml:6: The app accesses MediaStore.Video, but is missing a tag with a android.content.MEDIA_CAPABILITIES declaration
3 xmlns:tools="http://schemas.android.com/tools"
4 package="com.example.myapp">
5
6 <application
7 android:name=".App"
8 android:allowBackup="false"
9 android:icon="@mipmap/ic_launcher"
In Android 12 and higher, an app that opens media files should explicitly specify media formats that it doesn't support, so the OS can provide a transcoded file instead. To suppress this error, use the issue id "MediaCapabilities" as explained in the Suppressing Warnings and Errors section.
How to fix it?
The Media Capabilities API allows developers to determine decoding and encoding abilities of the device, exposing information such as whether media is supported and whether playback should be smooth and power efficient, with real time feedback about playback to better enable adaptive streaming, and access to display ...
HDR content has 3 properties that need to be understood by the decoder and renderer: color gamut, transfer function, and frame metadata if applicable. They can be used to determine whether a UA supports a particular HDR format. Color gamut: HDR content requires a wider color gamut than SDR content.
The Media Capabilities API enables determining which codecs are supported and how performant a media file will be both in terms of smoothness and power efficiency.
Windows Portable Devices supports the following media properties. A string that identifies the artist performing the media. A string that specifies an encoding profile. Media codecs may be encoded in accordance with a profile, which defines a particular encoding algorithm or optimization process.
A null-terminated, human-readable string that indicates the source URL for the given media. Mediacast objects often use this property to specify where the content originated. A number between 0 and 5 that rates the content, where 0 is unrated, 1 is the lowest rating, and 5 is the highest rating. This value is entered explicitly by the user.
A subordinate description for the given object. This property is often used to provide additional information about content.Where the WPD_MEDIA_DESCRIPTION property may describe a collection of related media, this property will describe a single piece of content. A subtitle for the object.
I am not using any media capabilities in my app, and will still get this lint issue.
I simply suppressed the error to "fix" it. Seems like a false positive with Android Lint.
<application
tools:ignore="MediaCapabilities">
</application>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With