Stay organized with collections Save and categorize content based on your preferences.
A container for media metadata.
Metadata has a media type, an optional list of images, and a collection of metadata fields. Keys for common metadata fields are predefined as constants, but the application is free to define and use additional fields of its own.
The values of the predefined fields have predefined types. For example, a track number is an NSInteger
and a creation date is an NSString containing an ISO-8601 representation of a date and time. Attempting to store a value of an incorrect type in a field will raise an NSInvalidArgumentException.
Note that the Cast protocol limits which metadata fields can be used for a given media type. When a MediaMetadata object is serialized to JSON for delivery to a Cast receiver, any predefined fields which are not supported for a given media type will not be included in the serialized form, but any application-defined fields will always be included. The complete list of predefined fields is as follows:
Field Value Type Valid Metadata Types kGCKMetadataKeyCreationDate NSDate GCKMediaMetadataTypePhoto kGCKMetadataKeyReleaseDate NSDate GCKMediaMetadataTypeGeneric, GCKMediaMetadataTypeMovie, GCKMediaMetadataTypeTVShow, GCKMediaMetadataTypeMusicTrack kGCKMetadataKeyBroadcastDate NSDate GCKMediaMetadataTypeTVShow kGCKMetadataKeyTitle NSString GCKMediaMetadataTypeGeneric, GCKMediaMetadataTypeMovie, GCKMediaMetadataTypeTVShow, GCKMediaMetadataTypeMusicTrack, GCKMediaMetadataTypePhoto kGCKMetadataKeySubtitle NSString GCKMediaMetadataTypeGeneric, GCKMediaMetadataTypeMovie kGCKMetadataKeyArtist NSString GCKMediaMetadataTypeGeneric, GCKMediaMetadataTypeMusicTrack, GCKMediaMetadataTypePhoto kGCKMetadataKeyAlbumArtist NSString GCKMediaMetadataTypeMusicTrack kGCKMetadataKeyAlbumTitle NSString GCKMediaMetadataTypeMusicTrack kGCKMetadataKeyComposer NSString GCKMediaMetadataTypeMusicTrack kGCKMetadataKeyDiscNumber NSInteger GCKMediaMetadataTypeMusicTrack kGCKMetadataKeyTrackNumber NSInteger GCKMediaMetadataTypeMusicTrack kGCKMetadataKeySeasonNumber NSInteger GCKMediaMetadataTypeTVShow kGCKMetadataKeyEpisodeNumber NSInteger GCKMediaMetadataTypeTVShow kGCKMetadataKeySeriesTitle NSString GCKMediaMetadataTypeTVShow kGCKMetadataKeyStudio NSString GCKMediaMetadataTypeMovie kGCKMetadataKeyWidth NSInteger GCKMediaMetadataTypePhoto kGCKMetadataKeyHeight NSInteger GCKMediaMetadataTypePhoto kGCKMetadataKeyLocationName NSString GCKMediaMetadataTypePhoto kGCKMetadataKeyLocationLatitude double GCKMediaMetadataTypePhoto kGCKMetadataKeyLocationLongitude double GCKMediaMetadataTypePhotoInherits NSObject, <NSCopying>, and <NSSecureCoding>.
Initializes a new, empty, MediaMetadata with the given media type.
Designated initializer.
Initialize with the generic metadata type.
- (void) removeAllMediaImagesRemoves all the current images.
Adds an image to the list of images.
Tests if the object contains a field with the given key.
YES
if the field exists, NO
otherwise.
Returns a set of keys for all fields that are present in the object.
- (nullable id) objectForKey: (NSString *) keyReads the value of a field.
nil
if the field has not been set.
Stores a value in a string field.
Reads the value of a string field.
nil
if the field has not been set.
Stores a value in an integer field.
Reads the value of an integer field.
Reads the value of an integer field.
Stores a value in a double field.
Reads the value of a double field.
Reads the value of a double field.
Stores a value in a date field as a restricted ISO-8601 representation of the date.
Reads the value of a date field from the restricted ISO-8601 representation of the date.
nil
if this field has not been set.
Reads the value of a date field, as a string.
nil
if this field has not been set.
String key: Creation date.
The value is the date and/or time at which the media was created, in ISO-8601 format. For example, this could be the date and time at which a photograph was taken or a piece of music was recorded.
- (NSString* const) kGCKMetadataKeyReleaseDateString key: Release date.
The value is the date and/or time at which the media was released, in ISO-8601 format. For example, this could be the date that a movie or music album was released.
- (NSString* const) kGCKMetadataKeyBroadcastDateString key: Broadcast date.
The value is the date and/or time at which the media was first broadcast, in ISO-8601 format. For example, this could be the date that a TV show episode was first aired.
- (NSString* const) kGCKMetadataKeyTitleString key: Title.
The title of the media. For example, this could be the title of a song, movie, or TV show episode. This value is suitable for display purposes.
- (NSString* const) kGCKMetadataKeySubtitleString key: Subtitle.
The subtitle of the media. This value is suitable for display purposes.
- (NSString* const) kGCKMetadataKeyArtistString key: Artist.
The name of the artist who created the media. For example, this could be the name of a musician, performer, or photographer. This value is suitable for display purposes.
- (NSString* const) kGCKMetadataKeyAlbumArtistString key: Album artist.
The name of the artist who produced an album. For example, in compilation albums such as DJ mixes, the album artist is not necessarily the same as the artist(s) of the individual songs on the album. This value is suitable for display purposes.
- (NSString* const) kGCKMetadataKeyAlbumTitleString key: Album title.
The title of the album that a music track belongs to. This value is suitable for display purposes.
- (NSString* const) kGCKMetadataKeyComposerString key: Composer.
The name of the composer of a music track. This value is suitable for display purposes.
- (NSString* const) kGCKMetadataKeyDiscNumberInteger key: Disc number.
The disc number (counting from 1) that a music track belongs to in a multi-disc album.
- (NSString* const) kGCKMetadataKeyTrackNumberInteger key: Track number.
The track number of a music track on an album disc. Typically track numbers are counted starting from 1, however this value may be 0 if it is a "hidden track" at the beginning of an album.
- (NSString* const) kGCKMetadataKeySeasonNumberInteger key: Season number.
The season number that a TV show episode belongs to. Typically season numbers are counted starting from 1, however this value may be 0 if it is a "pilot" episode that predates the official start of a TV series.
- (NSString* const) kGCKMetadataKeyEpisodeNumberInteger key: Episode number.
The number of an episode in a given season of a TV show. Typically episode numbers are counted starting from 1, however this value may be 0 if it is a "pilot" episode that is not considered to be an official episode of the first season.
- (NSString* const) kGCKMetadataKeySeriesTitleString key: Series title.
The name of a series. For example, this could be the name of a TV show or series of related music albums. This value is suitable for display purposes.
- (NSString* const) kGCKMetadataKeyStudioString key: Studio.
The name of a recording studio that produced a piece of media. For example, this could be the name of a movie studio or music label. This value is suitable for display purposes.
- (NSString* const) kGCKMetadataKeyWidthInteger key: Width.
The width of a piece of media, in pixels. This would typically be used for providing the dimensions of a photograph.
- (NSString* const) kGCKMetadataKeyHeightInteger key: Height.
The height of a piece of media, in pixels. This would typically be used for providing the dimensions of a photograph.
- (NSString* const) kGCKMetadataKeyLocationNameString key: Location name.
The name of a location where a piece of media was created. For example, this could be the location of a photograph or the principal filming location of a movie. This value is suitable for display purposes.
- (NSString* const) kGCKMetadataKeyLocationLatitudeDouble key: Location latitude.
The latitude component of the geographical location where a piece of media was created. For example, this could be the location of a photograph or the principal filming location of a movie.
- (NSString* const) kGCKMetadataKeyLocationLongitudeDouble key: Location longitude.
The longitude component of the geographical location where a piece of media was created. For example, this could be the location of a photograph or the principal filming location of a movie.
- (NSString* const) kGCKMetadataKeyBookTitleString key: Book title.
The title of an audio book.
Integer key: Chapter number.
The number of a chapter in an audio book.
String key: Chapter title.
The title of a chapter in a audio book.
Double key: Section Duration.
The section duration in seconds. Used for queue metadata. For example, this could be a duration of one TV show in a queue, or a chapter duration of an audio book, or a program of a long live stream.
Double key: Section Start Time in Media.
The offset of section start time from the start of the media item in seconds. Used for queue metadata.
Double key: Section Absolute Start Time.
The absolute time of section start, in epoch time in seconds. Used for queue metadata.
Double key: Section Start Time in Container.
The offset of section start time within the full container. Used for queue metadata.
Double key: Queue Item ID.
The id of the queue item that includes the section start time. Used for queue metadata.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["`GCKMediaMetadata` stores media information like title, artist, album, and images for use with Google Cast."],["It supports predefined and custom metadata fields with specific data types (string, integer, double, date)."],["Developers can manage metadata using provided methods for adding, retrieving, and modifying values."],["The Cast protocol has limitations on supported fields, which are outlined in the documentation."],["Metadata type (movie, music, etc.) is crucial and dictates which fields are applicable."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3