mpnowplayinginfocenter

AVAudioPlayer on Lock Screen

跟風遠走 提交于 2019-11-29 03:28:14
问题 I've implemented an audio player using AVAudioPlayer (not AVPlayer ). I'm able to handle the remote control events with the following method. It works quite alright so far, however I see two more subtypes for these events: UIEventSubtypeRemoteControlEndSeekingForward and UIEventSubtypeRemoteControlEndSeekingBackward . - (void)remoteControlReceivedWithEvent:(UIEvent *)event { //if it is a remote control event handle it correctly if (event.type == UIEventTypeRemoteControl) { if (event.subtype =

Change lock screen background audio controls text?

随声附和 提交于 2019-11-28 20:00:48
问题 I have an iOS app that streams background audio using AVAudioSession. It is working correctly, but I am curious, is there any way to change the text on the lock screen audio controls? Right now it simply displays the name of my app, but I would like to change it to the name of the track. Additionally, the multi-tasking bar has no text under the controls- is there a way to add the track name there, as the iPod app does? 回答1: iOS 5 now supports setting the track title as well as an album art

How to set an title of the currently playing audio in iPhone lock screen?

微笑、不失礼 提交于 2019-11-27 18:38:11
When you play a music, the music title is shown below the time in the lock screen. I have also seen how TuneIn radio does that by showing the name of the currently playing radio station. How do you do that? Read the documentation: MPNowPlayingInfoCenter And here is an example code that will work on iOS 5 and it will not crash on older versions of iOS. Class playingInfoCenter = NSClassFromString(@"MPNowPlayingInfoCenter"); if (playingInfoCenter) { MPNowPlayingInfoCenter *center = [MPNowPlayingInfoCenter defaultCenter]; NSDictionary *songInfo = [NSDictionary dictionaryWithObjectsAndKeys: @"Some

Reading MP3 information using objective c

无人久伴 提交于 2019-11-27 12:13:50
I have mp3 files stored on the iPhone and I my application should to be able to read the ID3 information, i.e length in seconds, artist, etc. Does anyone know how to do this or what library to use in Objective-C? Your thoughts are much appreciated. ID3 information can be read retrieving the kAudioFilePropertyInfoDictionary property of an audio file using the AudioFileGetProperty function of the AudioToolbox framework. A detailed explanation is available at iphonedevbook.com edit: Original link is now down. InformIT has some similar sample code, but it's not as complete. Look into the Media

Is there a public way to force MPNowPlayingInfoCenter to show podcast controls?

半世苍凉 提交于 2019-11-27 05:58:21
I would like Control Center (via MPNowPlayingInfoCenter) to show the forward 15 seconds / back 15 seconds controls that Apple shows with podcasts, like so: The utter lack of documentation tells me that there's no obvious way to do this, but has anyone out there found any non-obvious way to force this without resorting to a private method? I've already got my handling for the forward/back button set up to advance appropriately, I'd just like to use the more appropriate UI. Any help would be greatly appreciated. OK so I had a bit of time on my hands and so I followed the breadcrumb.… This is

How to set an title of the currently playing audio in iPhone lock screen?

蹲街弑〆低调 提交于 2019-11-26 22:42:24
问题 When you play a music, the music title is shown below the time in the lock screen. I have also seen how TuneIn radio does that by showing the name of the currently playing radio station. How do you do that? 回答1: Read the documentation: MPNowPlayingInfoCenter And here is an example code that will work on iOS 5 and it will not crash on older versions of iOS. Class playingInfoCenter = NSClassFromString(@"MPNowPlayingInfoCenter"); if (playingInfoCenter) { MPNowPlayingInfoCenter *center =

Reading MP3 information using objective c

柔情痞子 提交于 2019-11-26 15:56:52
问题 I have mp3 files stored on the iPhone and I my application should to be able to read the ID3 information, i.e length in seconds, artist, etc. Does anyone know how to do this or what library to use in Objective-C? Your thoughts are much appreciated. 回答1: ID3 information can be read retrieving the kAudioFilePropertyInfoDictionary property of an audio file using the AudioFileGetProperty function of the AudioToolbox framework. A detailed explanation is available at iphonedevbook.com edit:

Is there a public way to force MPNowPlayingInfoCenter to show podcast controls?

主宰稳场 提交于 2019-11-26 11:48:30
问题 I would like Control Center (via MPNowPlayingInfoCenter) to show the forward 15 seconds / back 15 seconds controls that Apple shows with podcasts, like so: The utter lack of documentation tells me that there\'s no obvious way to do this, but has anyone out there found any non-obvious way to force this without resorting to a private method? I\'ve already got my handling for the forward/back button set up to advance appropriately, I\'d just like to use the more appropriate UI. Any help would be