Skip to content
Titanium SDK
unreleased
Versionmainunreleased

Titanium.Media.Item

proxyiPhoneiPadmacOSsince 1.4.0

Extends Titanium.Proxy

A representation of a media item returned by openMusicLibrary or queryMusicLibrary.

This is a read-only object that describes a single media item, not a playlist. Titanium does not support access to playlists.

Item objects cannot be created explicitly. The openMusicLibrary returns Item objects in its success callback function, while queryMusicLibrary returns an array of Item objects.

Properties 38

albumArtist

Stringread-only

Artist credited for the album containing this item.

albumPersistentID

Numbersince 6.1.0read-only

The key for the persistent identifier for an album.

albumTitle

Stringread-only

Title of the album containing this item.

albumTrackCount

Numberread-only

Number of tracks for the album containing this item.

apiName

Stringsince Android 3.2.0, iPhone 3.2.0, iPad 3.2.0, macOS 9.2.0read-only

Inherited from Titanium.Proxy

The name of the API that this proxy corresponds to.

artist

Stringread-only

Artist credited for this item.

Image for the item's artwork as a Blob object, or null if no artwork is available.

assetURL

Stringsince 6.1.0read-only

A URL pointing to the media item.

beatsPerMinute

Numbersince 6.1.0read-only

The number of musical beats per minute for the media item.

bookmarkTime

Stringsince 6.1.0read-only

The user's place in the media item the most recent time it was played.

bubbleParent

Booleansince Android 3.0.0, iPhone 3.0.0, iPad 3.0.0, macOS 9.2.0

Inherited from Titanium.Proxy

Indicates if the proxy will bubble an event to its parent.

Default: true

comments

Stringsince 6.1.0read-only

Textual information about the media item.

composer

Stringread-only

Composer of this item.

dateAdded

Datesince 6.1.0read-only

Date when the item was added to the music library.

discCount

Numberread-only

Total number of discs for the album containing this item.

discNumber

Numberread-only

Disc number for this item in the album.

genre

Stringread-only

Genre of this item.

hasProtectedAsset

Booleansince 6.1.0read-only

True if the item represents a protected asset.

isCloudItem

Booleansince 6.1.0read-only

True if the media item is an iCloud item.

isCompilation

Booleanread-only

True if this item is part of a compilation album.

isExplicit

Booleansince 6.1.0read-only

True if this item is marked as "Explicit".

lastPlayedDate

Datesince 6.1.0read-only

The most recent calendar date on which the user played the media item.

lyrics

Stringread-only

Lyrics for this item.

persistentID

Stringsince 6.1.0read-only

The key for the persistent identifier for the media item.

playbackStoreID

Numbersince 6.1.0read-onlyiOS 10.3+

Used to enqueue store tracks by their ID.

playCount

Numberread-only

Number of times the item has been played.

rating

Numberread-only

Rating for this item.

releaseDate

Datesince 6.1.0read-only

Date when this this item was released.

skipCount

Numberread-only

Number of times this item has been skipped.

title

Stringread-only

Title of this item.

userGrouping

Stringsince 6.1.0read-only

Grouping information for the media item.

Methods 4

Inherited from Titanium.Proxy

Adds the specified callback as an event listener for the named event.

Parameters
ParametersTypeDescription
nameString

Name of the event.

callbackCallback<Titanium.Event>

Callback function to invoke when the event is fired.

4 fields
bubbles Boolean

True if the event will try to bubble up if possible.

cancelBubble Boolean

Set to true to stop the event from bubbling.

source Object

Source object that fired the event.

type String

Name of the event fired.

Inherited from Titanium.Proxy

Fires a synthesized event to any registered listeners.

Parameters
ParametersTypeDescription
nameString

Name of the event.

event?Dictionary

A dictionary of keys and values to add to the Titanium.Event object sent to the listeners.

Inherited from Titanium.Proxy

Removes the specified callback as an event listener for the named event.

Parameters
ParametersTypeDescription
nameString

Name of the event.

callbackCallback<Titanium.Event>

Callback function to remove. Must be the same function passed to addEventListener.

4 fields
bubbles Boolean

True if the event will try to bubble up if possible.

cancelBubble Boolean

Set to true to stop the event from bubbling.

source Object

Source object that fired the event.

type String

Name of the event fired.