Reputation: 23685
I want to play a video (with sound) and record video from the front-facing camera at the same time. The view finder for the camera should appear as a small "picture-in-picture" in the bottom right hand corner of the screen while the movie plays full screen behind it. Is this possible? Is layering the appropriate classes on top of each other possible?
Upvotes: 1
Views: 8388
Reputation: 2925
Check out the AVFoundation
framework, which is used for much of the audio and video programming in iOS.
In your case you could use an AVPlayer
and AVPlayerLayer
to play your movie, and an AVCaptureSession
, an AVCaptureVideoPreviewLayer
, and an AVCaptureMovieFileOutput
to record.
If you are familiar with Core Animation, you can set the bounds and add sublayers to AVPlayerLayer
and AVCaptureVideoPreviewLayer
to achieve you desired interface layout.
These classes are very well documented, and the AVFoundation Programming Guide clearly explains their interaction.
Feel free to comment with any questions.
Upvotes: 5