---
title: SHMediaItem
framework: shazamkit
role: symbol
role_heading: Class
path: shazamkit/shmediaitem
---

# SHMediaItem

An object that represents the metadata for a reference signature.

## Declaration

```swift
class SHMediaItem
```

## Overview

Overview This class uses subscripting for the data elements of a custom media item that an existing property doesn’t already represent. Add a readable custom property by extending SHMediaItemProperty with a key for that property, and by extending this class with a property that uses the key. The following code shows the extensions for an episode number: // Add an episode number to the list of properties. extension SHMediaItemProperty {     static let episode = SHMediaItemProperty("Episode") }

// Add a property for returning the episode number using a subscript. extension SHMediaItem {     var episode: Int? {         return self[.episode] as? Int     } } Add your custom property when you create the media item as the following code shows: // Create a new media item and set the title, subtitle, and episode properties. let mediaItem = SHMediaItem(properties: [.episode: 42,                                          .title: "Question",                                          .subtitle: "The Answer"]) note: The class of the object that represents a custom object must be one of: Dictionary, Array, URL, Number, String, Date, or Data.

## Topics

### Creating a new media item object

- [init(properties:)](shazamkit/shmediaitem/init(properties:).md)

### Working with media item properties

- [subscript(_:)](shazamkit/shmediaitem/subscript(_:).md)
- [SHMediaItemProperty](shazamkit/shmediaitemproperty.md)
- [timeRanges](shazamkit/shmediaitem/timeranges-8msna.md)
- [frequencySkewRanges](shazamkit/shmediaitem/frequencyskewranges-1j7d3.md)

### Reading general media item properties

- [title](shazamkit/shmediaitem/title.md)
- [subtitle](shazamkit/shmediaitem/subtitle.md)
- [artist](shazamkit/shmediaitem/artist.md)
- [artworkURL](shazamkit/shmediaitem/artworkurl.md)
- [videoURL](shazamkit/shmediaitem/videourl.md)
- [genres](shazamkit/shmediaitem/genres.md)
- [explicitContent](shazamkit/shmediaitem/explicitcontent.md)
- [creationDate](shazamkit/shmediaitem/creationdate.md)
- [isrc](shazamkit/shmediaitem/isrc.md)
- [id](shazamkit/shmediaitem/id.md)

### Reading Apple Music properties

- [songs](shazamkit/shmediaitem/songs.md)
- [appleMusicURL](shazamkit/shmediaitem/applemusicurl.md)
- [appleMusicID](shazamkit/shmediaitem/applemusicid.md)

### Working with Shazam music catalog media items

- [webURL](shazamkit/shmediaitem/weburl.md)
- [shazamID](shazamkit/shmediaitem/shazamid.md)
- [fetch(shazamID:completionHandler:)](shazamkit/shmediaitem/fetch(shazamid:completionhandler:).md)

### Initializers

- [init(coder:)](shazamkit/shmediaitem/init(coder:).md)

### Instance Methods

- [songs()](shazamkit/shmediaitem/songs().md)

### Default Implementations

- [Identifiable Implementations](shazamkit/shmediaitem/identifiable-implementations.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Inherited By

- [SHMatchedMediaItem](shazamkit/shmatchedmediaitem.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [Identifiable](swift/identifiable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Match audio

- [SHSession](shazamkit/shsession.md)
- [SHManagedSession](shazamkit/shmanagedsession.md)
- [SHSessionDelegate](shazamkit/shsessiondelegate.md)
- [SHMatch](shazamkit/shmatch.md)
- [SHMatchedMediaItem](shazamkit/shmatchedmediaitem.md)
