Note that there are some explanatory texts on larger screens.

plurals
  1. POios, Youtube full screen in a webview is rotating
    text
    copied!<p>I am developing and app which i want a youtube video in a page. It works fine withe the code below:</p> <pre><code>-(void)viewDidLoad{ [super viewDidLoad]; } - (void) viewWillAppear:(BOOL)animated { [self.navigationController setNavigationBarHidden:NO animated:YES]; self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:.47 green:.43 blue:.4 alpha:1]; } // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations //return (interfaceOrientation == UIInterfaceOrientationPortrait); NSString *htmlString; if(interfaceOrientation == UIInterfaceOrientationPortrait){ htmlString = [NSString stringWithFormat:@"&lt;html&gt;&lt;head&gt;&lt;meta name = \"viewport\" content = \"initial-scale = 1.0, user-scalable = no, width = 20\"/&gt;&lt;/head&gt;&lt;body style=\"background:#F00;margin-top:0px;margin-left:0px\"&gt;&lt;div&gt;&lt;object width=\"768\" height=\"960\"&gt;&lt;param name=\"movie\" value=\"%@\"&gt;&lt;/param&gt;&lt;param name=\"wmode\" value=\"transparent\"&gt;&lt;/param&gt;&lt;embed src=\"%@\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"768\" height=\"960\"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;",urlToOpen,urlToOpen]; }else{ htmlString = [NSString stringWithFormat:@"&lt;html&gt;&lt;head&gt;&lt;meta name = \"viewport\" content = \"initial-scale = 1.0, user-scalable = no, width = 212\"/&gt;&lt;/head&gt;&lt;body style=\"background:#F00;margin-top:0px;margin-left:0px\"&gt;&lt;div&gt;&lt;object width=\"1024\" height=\"704\"&gt;&lt;param name=\"movie\" value=\"%@\"&gt;&lt;/param&gt;&lt;param name=\"wmode\" value=\"transparent\"&gt;&lt;/param&gt;&lt;embed src=\"%@\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"1024\" height=\"704\"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;",urlToOpen,urlToOpen]; } [self.webView loadHTMLString:htmlString baseURL:[NSURL URLWithString:@"http://www.youtube.com"]]; return YES; } </code></pre> <p>The view is working fine in portrait and in landscape. The problem is when i see the video with the full Screen and i Rotate. Whe i finish the full screen, the webview didn't detect the rotation and print the webview as the wrong way.</p> <p>How could i detect the Youtube full screen is rotating for rotate my view?</p> <p>Thankyou</p>
 

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