1

我在 MPMediaItem 上看不到任何可以被视为全局唯一标识符的元数据(换句话说,同一个媒体将具有跨多个设备和用户帐户的相同、唯一的值组合)。是否有可以以这种方式使用的推荐元数据(或一组复合元数据)?

4

1 回答 1

2

所有MPMediaItems 和其他一些MediaPlayer.framework类都有一个唯一标识符,称为持久 ID。它是一个uint64_t包裹在一个NSNumber. 以下是您可以从MPMediaItemusing中检索的持久 IDvalueForProperty:

NSString *const MPMediaItemPropertyPersistentID;            // filterable
NSString *const MPMediaItemPropertyAlbumPersistentID;       // filterable
NSString *const MPMediaItemPropertyArtistPersistentID;      // filterable
NSString *const MPMediaItemPropertyAlbumArtistPersistentID; // filterable
NSString *const MPMediaItemPropertyGenrePersistentID;       // filterable
NSString *const MPMediaItemPropertyComposerPersistentID;    // filterable
NSString *const MPMediaItemPropertyPodcastPersistentID;     // filterable
于 2013-03-04T08:21:52.003 回答