Audio controls in lock screen iPhone, iPad - iphone

I use AVFoundation to play audio. When i lock my device with playing music, and press Home button twice, I can see audio controls: forward, rewind, pause/play and volume slider
How to use them? When i press they don't do anything. Onlu volume slider works good.

Related

How to get AirPlay from UIWebView to continue playback when app is backgrounded *without* setting AVAudioSession category to Playback?

I've been attempting to make this work for quite a while now:
My app has the potential to play videos of Youtube from within UIWebView. The user could want to use AirPlay for this. When AirPlay is on, the device could go to sleep and normally video stops playing moments after that happens. As advised in other posts, I set the AVAudioSession category to the Playback one and it works - AirPlay continues even when the device display goes to sleep.
However, this has a side-effect; if the user has activated the app while music playback is on in the background, setting the app's audio session category to Playback causes the playing music to stop and this is definitely annoying.
Ideally, I want to set the AVAudioSession category when playback of Video starts, not when my App is activated - but I've not seen any central or UIWebview notification / delegate method to determine this.
I've got a hackish workaround for iPhone where the UIWebview hosted video player always loads full screen modal and thus can be determined. But my app is Universal and on iPad the video starts inline; I can't figure out a way to know when Video playback is going to happen. This is exactly the point when the audio category should be switched to Playback - it will actually help users who want background music playing only until video starts up.
I don't want to fool around with adding Javascript events on to Video tags inside the UIWebView - that seems too fragile to me.
Is it possible to observe any AVFoundation notifications that trigger for the UIWebView video playback? Or anyone know of any other way to determine if video playback will start / has started?

When playing a movie through a UIWebView, and then outputting to AppleTV via Airplay, turning off iPhone screen stops playback. Why?

When playing a movie through a UIWebView, and then outputting to AppleTV via Airplay, turning off iPhone screen stops playback. Why?
Anyone know how to solve this so AirPlay continues when the screen is off with my app?
Doing these two things solved it for me:
Airplay of audio using AVPlayer does not work in the background (Put the key "audio" as the key in the XML of the property list)
UIWebView: HTML5 audio pauses in iOS 6 when app enters background
Looks like it works for video too!

How to make a media player application for iPhone?

I don't have good idea about where to start. Any way, most of us have use a DVD player, what we do is to put an disc in that and it plays video(or Audio, but my concern is video). All controls like play pause, forward, rewind can be handled at DVD player end. With remote or buttons on the player. These effect reflect on TV screen.
Now, what I need to do is create a same application for iPhone. In that iPhone will be the DVD player and system monitor connected to that will behave like TV screen, all controls on iPhone screen will be equally effective on playing monitor. But my point is video content should be stream, not screen, of playing iPhone.
Please tell me from where should I start?
You can do this with Airplay and an AppleTV as secondDisplay (DVD playingScreen) and specifying another external screen (video) than your internal one (control)
http://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/AirPlayGuide/EnrichYourAppforAirPlay/EnrichYourAppforAirPlay.html

Playing Audio in Locking Mode

I am working on Audio related project. I am playing audio, in both case, either my app is active or suspended. I am stuck here, when I play audio and lock my iphone, when I double click on home button, there appears the player controls. I try to play/pause may audio, without unlocking the iphone same as in default ipone/ipod application. Is it possible? If yes then feel free to help. Thanks in advance.
Use Remote Control events
Remote control events are any event received for the purpose of controlling media. eg iTunes pause/play/next/previous buttons available from double-tapping the home screen button, or remote-control events from play/pause buttons on headphones.
http://www.sagorin.org/2011/11/29/ios-playing-audio-in-background-audio/

LocalPushNotification sound and iPhone's volume buttons

I implement UILocalNotification in my app which will play 16-seconds-length sound.
I notice that while the sound is being played,
if I press the side Volume buttons (on iPhone/ iPod) to increase or decrease the volume,
the sound is stopped immediately.
Do you know how to not stopped the Local Notification sound when user presses the side Volume buttons on iPhone/ iPod?
Thank you.
EDIT:
I like to do the same like this i-iQ Timer app, when UILocalNotification sound is playing, if user adjust the side volume buttons, the sound keeps playing.
No, the standard APIs give you no control over what happens when the volume buttons are pressed. The only sound-related thing about a UILocalNotification that you can control is to choose which sound plays.}