UIWebView streaming youtube does not go full screen on iPad

I have a button that displays a UIWebView and then broadcasts a video from YouTube. On the iphone, it works fine, and pressing the play button goes directly to full screen mode, and then when it is finished pressing this button hides the UIWebView and returns control to the application.

However, when I try to do the same on the iPad, clicking on playback does not automatically go into full screen mode (you can get into full screen mode, but I don’t want users to have this option) - is there a way to do this, please?

The code I have is:

- (IBAction)topButton:(id)sender { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeFinished:) name:@"UIMoviePlayerControllerWillExitFullscreenNotification" object:nil]; videoWebView.hidden=NO; NSString *embedcode = [self.detailItem objectForKey:@"youtubeEmbedCodeBeginner"]; [[self videoWebView]loadHTMLString:embedcode baseURL:nil]; } 

and

 -(void)youTubeFinished:(NSNotification *)notification{ // your code here videoWebView.hidden=YES; } 

Any help would be appreciated

+6
source share
1 answer

try it

Selector

: name @selector (someSelector): @ Object UIMoviePlayerControllerDidEnterFullcreenNotification: nil]

// For iOS 4.3 and higher: UIMoviePlayerControllerDidEnterFullscreenNotification UIMoviePlayerControllerDidExitFullscreenNotification

// For iOS 4.2 and below: UIMoviePlayerControllerDidEnterFullcreenNotification UIMoviePlayerControllerDidExitFullcreenNotification

thanks

0
source

All Articles