Playing Multiple Videos on iPAD

后端 未结 4 1513
青春惊慌失措
青春惊慌失措 2020-12-17 06:21

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,

4条回答
  •  心在旅途
    2020-12-17 06:24

    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];
    

提交回复
热议问题