tags:

views:

38

answers:

1

Hello,

I am using MPMoviePlayerController class for playing the video in built-in media player on iPhone. The project works fine on iPhone 3.0 simulator or device, but it doesn't show the video view on iPhone 4.0 simulator or device, rather than i could able to hear the sound, no built-in player video display.

Does anyone come across this issue and how to resolve it?

UPDATED: I placed my code below: Now the problem is, i call the code playing the video when clicking on a row in the TableView. When i click on a row, it started playing the video but the TableView is not being completely hidden. So i could see Tableview and Video, both screens have overwritten. How do i push back the TableView completely when video is playing and come back to the TableView after video view is done?

NSURL *url = [NSURL URLWithString:strUrl];

    mP = [ [MPMoviePlayerController alloc] initWithContentURL:url ];
    [mP setControlStyle:MPMovieControlStyleFullscreen];
    [mP setFullscreen:YES];
    [mP play];

    [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
    // Rotate the view for landscape playback
    [[self view] setBounds:CGRectMake(0, 0, 480, 320)];
    [[self view] setCenter:CGPointMake(160, 240)];
    [[self view] setTransform:CGAffineTransformMakeRotation(M_PI / 2)];
    [[mP view] setFrame:CGRectMake(0, 0, 480, 320)];

    // Add movie player as subview
    [[self view] addSubview:[mP view]];
A: 

You have to remember that in iOS4 MPMoviePlayerController is not playing in fullscreen by default. You have to add your moviePlayer.view on the superview.

If you want to play the video on fullscreen you should look at the MPMoviePlayerViewController reference

F.Santoni
I updated comment above.
I have still not fixed as i mentioned in my actual updated query.
Use a MPMoviePlayerViewController instead of MPMoviePlayerController and then just call presentMoviePlayerViewControllerAnimated: on your viewController..
F.Santoni
Thank you Santoni.