mpmediaitem

Iphone - Writing a media player with lyrics

回眸只為那壹抹淺笑 提交于 2019-12-21 05:42:09
问题 I want to write a simple media player which displays lyrics that are retrieved from the web. I know once LyricWiki was such a source, but now no longer exists. Does a new API or source for lyrics exist that I can use ? When I do get the lyrics, how do I sync them with song ? I know the MPMediaItem class has the MPMediaItemPropertyLyrics but this is cleary not enough for me cause this is only for songs from Itunes and not all of them have lyrics available. I would appreciate any help or links

URL to MPMediaItem

帅比萌擦擦* 提交于 2019-12-20 10:53:46
问题 I have a simple question but i can't found a right answer. I have a song url saved to my database. An path Like this. aSound.path = [[item valueForProperty: MPMediaItemPropertyAssetURL] absoluteString]; How to convert back to a MPMediaItem object wich has songname artist and artwork? Is it possible? Thanks the answers. 回答1: Saving: NSNumber* persistentID = [mediaItem valueForProperty:MPMediaItemPropertyPersistentID]; Loading: MPMediaPropertyPredicate * predicate = [MPMediaPropertyPredicate

iOS 6 issue Convert MPMediaItem to NSData

一笑奈何 提交于 2019-12-20 10:48:13
问题 i had tried the below code. -(void)mediaItemToData : (MPMediaItem * ) curItem { NSURL *url = [curItem valueForProperty: MPMediaItemPropertyAssetURL]; AVURLAsset *songAsset = [AVURLAsset URLAssetWithURL: url options:nil]; AVAssetExportSession *exporter = [[AVAssetExportSession alloc] initWithAsset: songAsset presetName:AVAssetExportPresetPassthrough]; exporter.outputFileType = @"public.mpeg-4"; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

Play/Pause and Elapsed Time not updating in iOS command center properly

可紊 提交于 2019-12-19 12:54:05
问题 I have a video player that can play from the iOS command center and lock screen. When I toggle a play/pause button in my app, it should update the play/pause button in the command center ( MPRemoteCommandCenter ) by updating the nowPlayingInfo ( MPNowPlayingInfoCenter ). I'm not sure why it's not updating. For example, if I pause the video with a custom button in my app, the command center still shows the pause button (meaning the video is still playing which is wrong.) This is how I update

Play/Pause and Elapsed Time not updating in iOS command center properly

依然范特西╮ 提交于 2019-12-19 12:53:45
问题 I have a video player that can play from the iOS command center and lock screen. When I toggle a play/pause button in my app, it should update the play/pause button in the command center ( MPRemoteCommandCenter ) by updating the nowPlayingInfo ( MPNowPlayingInfoCenter ). I'm not sure why it's not updating. For example, if I pause the video with a custom button in my app, the command center still shows the pause button (meaning the video is still playing which is wrong.) This is how I update

Play/Pause and Elapsed Time not updating in iOS command center properly

爷,独闯天下 提交于 2019-12-19 12:53:07
问题 I have a video player that can play from the iOS command center and lock screen. When I toggle a play/pause button in my app, it should update the play/pause button in the command center ( MPRemoteCommandCenter ) by updating the nowPlayingInfo ( MPNowPlayingInfoCenter ). I'm not sure why it's not updating. For example, if I pause the video with a custom button in my app, the command center still shows the pause button (meaning the video is still playing which is wrong.) This is how I update

MPMediaItemArtwork is null while cover is available in iTunes

旧街凉风 提交于 2019-12-18 04:56:07
问题 The UIImage "image" is always empty ("null") though the cover is shown in the music app by apple. in iOS 7 it works fine, but with iOS 8 I get no cover. Whats wrong with my code, or what has changed in iOS 8? -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { AlbumCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AlbumCell"]; MPMediaItemCollection *song = self.songsList[indexPath.row]; cell.albumName.text = [[song

MPMediaQuery search for Artists, Albums, and Songs

梦想的初衷 提交于 2019-12-18 02:51:21
问题 How can I search the iPod Library in the same manner as the iOS Music application? I want to make general queries that return results for each Artists, Albums, and Songs. For instance, if I search Kenny Chesney I want the songs query to return all Kenny Chesney songs (and any songs titles or albums that contain Kenny Chesney in them.) When I make this query and a predicate for each property (song title, album title, artist name), an empty array returns. Here is a bit of code that may give you

MPMediaItems raw song data

孤人 提交于 2019-12-17 07:03:36
问题 I was wondering how to access an MPMediaItem's raw data. Any ideas? 回答1: you can obtain the media item's data in such way: -(void)mediaItemToData { // Implement in your project the media item picker MPMediaItem *curItem = musicPlayer.nowPlayingItem; NSURL *url = [curItem valueForProperty: MPMediaItemPropertyAssetURL]; AVURLAsset *songAsset = [AVURLAsset URLAssetWithURL: url options:nil]; AVAssetExportSession *exporter = [[AVAssetExportSession alloc] initWithAsset: songAsset presetName:

Is it possible to get video-related meta info for an MPMediaItem?

ε祈祈猫儿з 提交于 2019-12-13 08:27:59
问题 I'm doing some work with MPMediaItems, and specifically I'm trying to get a list of the videos on a user's device. Now, videos from iTunes will be locked so they can't be played from a third-party app, but user-added videos like home movies are playable, and even those from iTunes can have their meta information queried and displayed. But here's where I'm getting tripped up: I can't seem to find any video-specific meta info for these files? The MPMediaItem class reference has a long list of