Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to play videos, from array, in MPMoviePlayerController for iOS 6, using NSThreads or NSOperation

surajkumar_midgaysurajkumar_midgay Posts: 1New Users
edited May 2013 in iOS SDK Development
//This MutableArray, has the file name, which the app will pick, from the Bundle.
arrayFileName=[[NSMutableArray alloc]initWithObjects:@titanic, @DummyName, @Dinosaur,@DummyName,@titanic, nil];

I want to play the files : "titanic" and "Dinosaur"; and call camera, instead of "DummyName". While playing the video, I want to get their AVURLAssets and store the assets, in an array. And later on, want to merge the AVURLAssets, from the array, into a single video.

I am able to merge, all the files( both Videos and Camera recording), however, before merging, I want to play all the videos and also call camera to record video as below :

First Play "titanic", from Bundle.

Second, call Camera interface where the name "DummyName" appears.

Third, Play the video "Dinosaur", from Bundle.

Fourth, again call camera, to record a video, where the name "DummyName" appears.

Finally, again play "titanic".

During each of these stages, my code would get the AVURLAsset, for each of video or Camera recording. And finally merge them, into a single video.

I am able to perform Phase 2, i.e. Merge the AVURLAssets,stored in an array, into a single video.

The problem lies, in Phase 1, where I need, to play all the videos, in MPMoviePlayer. I am using NSThread and used main thread,for UI (playing movies, recording camera video, activity indicator, etc). But I am able to play only 1st video from the bundle, The videos, other than the first one, are not being played or even if they are being played( in background), there is no display, only the video's audio is heard. Instead of the video, I see my earlier UI.

//This MutableArray, has the file name, which the app will pick, from the Bundle.
arrayFileName=[[NSMutableArray alloc]initWithObjects:@titanic, @DummyName, @Dinosaur,@DummyName,@titanic, nil];

Any sort of help, either in the form of solution or at least a rough lead, would be highly appreciated. Thank you..

Replies

Sign In or Register to comment.