How to sync audio and video in iphone app - iphone

In my app i have to play some video files.I also have to play audio files along with these video files.
It is working fine.But the problem is audio and video file is not syncing properly.
Also when the the pause button is pressed the video is stop playing not the audio.Im playing the video in MPMOvieplayer controller.
How to solve this issue.Please help.

You can try using an AVMutableComposition. Try taking a look at this thing and if you need any help with it let me know. I would gladly help.

Related

How can i record video without opening video camera?

How can i record video without opening any camera? My requirement is when a person is in problem his video is recorded but not by opening camera it should work in background.
Thanks
Use AVFoundation Framework for video capturing.
Don't add AVCaptureVideoPreviewLayer to see whats been recorded in current UIView

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

Only Youtube audio Playing but not Video in Iphone WebView

I am trying to play youtube videos after loading the webview. But Only Audio is being played, not video. Although I get play button in status bar, the Media Player does not become active. The Same piece of code works in iTouch 4.1 and simulator but not on iPhone 4.1/4.0. What am I missing here???
Is the default youtube application playing video? If yes, You might want to try removing the frameworks, add them again and clean build your project.

Recording Video while playing a video on iPhone?

i am trying to record a video from front camera of iPhone using AVFoundation class while user watches a video...with the help of WWDC 2010 samples i am able to record the video using front camera when the video is not playing but when i try to record it while user plays a video in MPMovieViewController the video does not get recorded..When i use MPMovieViewController does it starts on a different thread due to which i am not able to record the video in the background?? is playing the video in a UIWebview will be a better option??
Try using NSThreads. You should find some info about them in tutorials.

Play video's audio track when enter background?

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.