makboney
makboney

Reputation: 1824

Playing Multiple Videos on iPAD

I am facing some problem in playing multiple videos on iPAD. I am trying to play multiple thumbnail videos on the same view. You can say its much like the CCTV camera.Well, i have no clue. Please help me. Thanks in advance...

Upvotes: 3

Views: 11974

Answers (4)

Sam Keene
Sam Keene

Reputation: 297

You can't use the MKMediaFramework to play multiple videos. You can however do this with the lower level AVFoundation Framework. It's not as hard as you might think and I've made a tutorial that goes over it here: http://www.sdkboy.com/?p=66

Essentially what you need to do is extend UIView so it contains an AVPlayerLayer to which the output of an AVPlayer object is directed, then you can create multiple instances of this UIView that you feed video using AVPlayer instances.

Upvotes: 3

Khaldoun
Khaldoun

Reputation: 487

May be When Creating a WebView and using a HTML5 Video instance you can run multiple videos at the same time

Upvotes: -1

Stefan H
Stefan H

Reputation: 6683

MPMoviePlayerController will allow multiple instances, but only one of them can be playing their movie at any given time.

It mentions it here: http://developer.apple.com/library/ios/#documentation/mediaplayer/reference/MPMoviePlayerController_Class/MPMoviePlayerController/MPMoviePlayerController.html

From the article:

Note: Although you may create multiple MPMoviePlayerController objects and present their views in your interface, only one movie player at a time may play its movie.

Upvotes: 6

Zebs
Zebs

Reputation: 5438

This is actually pretty simple to do on the iPad.

You basically need multiple MPMoviePlayerController objects.

Each MPMoviePlayerController object has a view property, you just need to set the frames of the views on the different MPMoviePlayerController objects to match what you want it to look like.

Here is a simple example using two MPMoviePlayerController objects ans 2 different frames:

MPMoviePlayerController *player =
        [[MPMoviePlayerController alloc] initWithContentURL: myURL];
[[player view] setFrame: yourFrame1];
[myView addSubview: [player view]];
// ...
[player play];

MPMoviePlayerController *player2 =
            [[MPMoviePlayerController alloc] initWithContentURL: myURL2];
[[player2 view] setFrame: yourFrame2];
[myView addSubview: [player2 view]];
// ...
[player2 play];

Upvotes: 0

Related Questions