Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't see button in MoviePlayer if using FullScreen
    primarykey
    data
    text
    <p>The following is the code I used to play a movie:</p> <pre><code>playerViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:theURL]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMovieFinishedCallback:) name:MPMoviePlayerPlaybackDidFinishNotification object:[playerViewController moviePlayer]]; float screenWidth = self.view.frame.size.width; float screenHeight = self.view.frame.size.height; [playerViewController.view setFrame:CGRectMake(0, 0, screenWidth, screenHeight)]; [self.view addSubview:playerViewController.view]; [self.view setUserInteractionEnabled:YES]; //---play movie--- player = [playerViewController moviePlayer]; [player setControlStyle:MPMovieControlStyleNone]; [player setFullscreen:TRUE]; [player play]; skipButton = [UIButton buttonWithType:UIButtonTypeCustom]; [skipButton setTitle:@"Skip" forState:UIControlStateNormal]; skipButton.frame = CGRectMake(0, 0, 150, 50); [skipButton setCenter:CGPointMake(screenWidth - 30 - skipButton.frame.size.width, 100)]; [skipButton addTarget:self action:@selector(skipMovie) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:skipButton]; </code></pre> <p>But, I have some issue with these on iPad1. If I did not use the <code>setFullScreen</code> method, the movie didn't play in FullScreen mode, even if I set the Rect (1024x768). But if I set these, the movie does play in FullScreen, but my @skipButton is not visible.</p> <p>If i use:</p> <pre><code> [self.view addSubview:playerViewController.view]; </code></pre> <p>after</p> <pre><code>[player play]; </code></pre> <p>the first issue happened. The code works properly in iPad2, even without <code>setFullScreen</code>.</p> <p>Does anyone have any ideas?</p> <pre><code>[playerViewController.view bringSubviewToFront: skipButton] </code></pre> <p>doesn't make any change!!!!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload