Play video's audio track when enter background? - iphone

I'm using mpmovieplayer to play video on ios 4, and I want to keep the audio playing when my app enter background, but it doesn't work. I thing it's because video player use GPU to render video on screen and this is not allowed by apple when app enter background.
So, is there any way to do that? There are some apps have this feature, and they seems just use the mpmovieplayer, is it work by detach the video layer of mpmovieplayer?
Thanks for your answer!

You'll need to have separate audio file and video file for this. Play both when you need to play video and just the audio when app gets into background.

Related

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!

play audio with controls in iOS

I'm building an App that plays a mp3 file (hosted on http://<somewhere>/<audio>.mp3) while the user is watching some changing labels (think about a lyrics app, which write the lyrics synchronised with the song).
In the bottom side of the screen I'd like to show the audio controls (play/pause, ff, rew), and a bar for indicating the downloaded part of the file and the playing point.
How is the easiest way to do it? I've already tried with AVAudioPlayer, AVplayer and MPMoviePlayerController, but none of them solved my problem.
You can use MPVolumeView Class.Read the documentation here http://developer.apple.com/library/ios/#documentation/mediaplayer/reference/MPVolumeView_Class/Reference/Reference.html

Replay option not displaying youtube video in UIWebView?

Currently i am trying to play one youtube video in my application UIWebView. On first time playing, the video is playing perfectly and i can able to see and listen both video & audio, but when the video played completely and i select replay option present in video screen,the video is not displaying anything(its just displaying black screen) but i can able to hear audio.
Where i am going wrong, How to fix this problem ?
Tools used : XCode: 4.3.2, iOS :5.1

Play audio in background

I want my app will play music when she is in the background too,
there is any way to do it? i try to use apple documentation but it didn't work.
it is possible that because i am now using the avplayer i cant play audio in background?
i play the music with
ExtAudioFileSeek(mExtAFRef, finalFrames);
I think playing audio in background is possible only for streaming audio. For normal audio we can only play when screen is locked.
You should look at documentation of using background tasks like:
http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html
and specially the:
http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH5-SW14

Playing video on iPad in native app and webview

I have a native iPad app that plays video. The app also uses a webview for some content and I would like to play a video in the webview as well.
Is it possible to play video natively as well as in a webview at the same time? I've read that only one video can play natively at the same time but does this apply if one video is native and the other is in a webview?
If a video is playing natively and a webview is loaded that includes a video, would initiating playback of the video in the webview automatically stop the native video or does there need to be communication from the webview to the native code to stop the video, and vice versa?
Thanks for your time.
I would say it isn't possible, in my experience when playing video in a webview the video is able to go fullscreen and when this happens it uses the same video player/controls that playing a video natively uses. I can't see how two videos would be able to use this player/controls at the same time.
You will also encounter memory issues, at least on the first iPad.