Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Media Capabilities property not specified

Tags:

android

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?

like image 926
Hello_Berial Avatar asked Aug 06 '21 01:08

Hello_Berial


People also ask

What is media capabilities API?

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 ...

What is HDR media capabilities?

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.

What is the media capabilities API?

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.

What are the media properties supported by OpenWindows portable devices?

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.

What are the properties of mediacast objects?

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.

What is the WPD_media_description property?

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.


Video Answer


1 Answers

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>
like image 154
Marius Kohmann Avatar answered Oct 24 '22 05:10

Marius Kohmann