Android Guides | Samples

Android.Media.MediaMetadataRetriever Class

MediaMetadataRetriever class provides a unified interface for retrieving frame and meta data from an input media file.

See Also: MediaMetadataRetriever

Syntax

[Android.Runtime.Register("android/media/MediaMetadataRetriever", DoNotGenerateAcw=true)]
public class MediaMetadataRetriever : Object

Remarks

MediaMetadataRetriever class provides a unified interface for retrieving frame and meta data from an input media file.

[Android Documentation]

Requirements

Namespace: Android.Media
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 10

The members of Android.Media.MediaMetadataRetriever are listed below.

See Also: Object

Public Constructors

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Fields

const
MetadataKeyAlbumMetadataKey (1). The metadata key to retrieve the information about the album title of the data source.
const
MetadataKeyAlbumartistMetadataKey (13). The metadata key to retrieve the information about the performers or artist associated with the data source.
const
MetadataKeyArtistMetadataKey (2). The metadata key to retrieve the information about the artist of the data source.
const
MetadataKeyAuthorMetadataKey (3). The metadata key to retrieve the information about the author of the data source.
const
MetadataKeyBitrateMetadataKey (20). This key retrieves the average bitrate (in bits/sec), if available.
const
MetadataKeyCdTrackNumberMetadataKey (0). The metadata key to retrieve the numeric string describing the order of the audio data source on its original recording.
const
MetadataKeyCompilationMetadataKey (15). The metadata key to retrieve the music album compilation status.
const
MetadataKeyComposerMetadataKey (4). The metadata key to retrieve the information about the composer of the data source.
const
MetadataKeyDateMetadataKey (5). The metadata key to retrieve the date when the data source was created or modified.
const
MetadataKeyDiscNumberMetadataKey (14). The metadata key to retrieve the numberic string that describes which part of a set the audio data source comes from.
const
MetadataKeyDurationMetadataKey (9). The metadata key to retrieve the playback duration of the data source.
const
MetadataKeyGenreMetadataKey (6). The metadata key to retrieve the content type or genre of the data source.
const
MetadataKeyHasAudioMetadataKey (16). If this key exists the media contains audio content.
const
MetadataKeyHasVideoMetadataKey (17). If this key exists the media contains video content.
const
MetadataKeyLocationMetadataKey (23). This key retrieves the location information, if available.
const
MetadataKeyMimetypeMetadataKey (12). The metadata key to retrieve the mime type of the data source.
const
MetadataKeyNumTracksMetadataKey (10). The metadata key to retrieve the number of tracks, such as audio, video, text, in the data source, such as a mp4 or 3gpp file.
const
MetadataKeyTitleMetadataKey (7). The metadata key to retrieve the data source title.
const
MetadataKeyVideoHeightMetadataKey (19). If the media contains video, this key retrieves its height.
const
MetadataKeyVideoRotationMetadataKey (24). This key retrieves the video rotation angle in degrees, if available.
const
MetadataKeyVideoWidthMetadataKey (18). If the media contains video, this key retrieves its width.
const
MetadataKeyWriterMetadataKey (11). The metadata key to retrieve the information of the writer (such as lyricist) of the data source.
const
MetadataKeyYearMetadataKey (8). The metadata key to retrieve the year when the data source was created or modified.
const
OptionClosestOption (3). This option is used with MediaMetadataRetriever.GetFrameAtTime(Int64,Option) to retrieve a frame (not necessarily a key frame) associated with a data source that is located closest to or at the given time.
const
OptionClosestSyncOption (2). This option is used with MediaMetadataRetriever.GetFrameAtTime(Int64,Option) to retrieve a sync (or key) frame associated with a data source that is located closest to (in time) or at the given time.
const
OptionNextSyncOption (1). This option is used with MediaMetadataRetriever.GetFrameAtTime(Int64,Option) to retrieve a sync (or key) frame associated with a data source that is located right after or at the given time.
const
OptionPreviousSyncOption (0). This option is used with MediaMetadataRetriever.GetFrameAtTime(Int64,Option) to retrieve a sync (or key) frame associated with a data source that is located right before or at the given time.

Public Properties

[read-only]
FrameAtTimeBitmap. Call this method after setDataSource().

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

ExtractMetadata(MetadataKey) : String
Call this method after setDataSource().
ExtractMetadata(Int32) : String
GetEmbeddedPicture() : Byte[]
Call this method after setDataSource().
GetFrameAtTime(Int64) : Bitmap
Call this method after setDataSource().
GetFrameAtTime(Int64, Option) : Bitmap
Call this method after setDataSource().
GetFrameAtTime(Int64, Int32) : Bitmap
Release()
Call it when one is done with the object.
SetDataSource(FileDescriptor)
Sets the data source (FileDescriptor) to use.
SetDataSource(String)
Sets the data source (file pathname) to use.
SetDataSource(Context, Uri)
Sets the data source as a content Uri.
SetDataSource(String, IDictionary<string, string>)
SetDataSource(FileDescriptor, Int64, Int64)
Sets the data source (FileDescriptor) to use.
SetDataSourceAsync(FileDescriptor) : Task
SetDataSourceAsync(String) : Task
SetDataSourceAsync(Context, Uri) : Task
SetDataSourceAsync(String, IDictionary<string, string>) : Task
SetDataSourceAsync(FileDescriptor, Int64, Int64) : Task