title: stop youtube videos opening youtube app in xcode/cordova 1.6.1
body: <p>I am building an app in xcode using the Cordova/phonegap framework for ios which displays some html that has some embeded youtube player code in it. iOS seems to redirect the user to the youtube app when it hits this youtube player. In cordova 1.5.0 the following code worked, but in 1.6.1 it doesn't seem to. Any ideas why or what needs changing to get it to work?</p>
  
  <p>code to stop youtube opening up and links to behave selves </p>
  
  <pre><code>- (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
  {
      NSURL *url = [request URL];
  
      // Intercept the external http requests and forward to Safari.app
      // Otherwise forward to the PhoneGap WebView
  
      NSString* urlString = [url absoluteString];
      if([urlString rangeOfString:@"http://www.youtube.com/embed"].location != NSNotFound) {
          return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ];
      }
      else if (([[url scheme] isEqualToString:@"http"] || [[url scheme] isEqualToString:@"https"])) {
          [[UIApplication sharedApplication] openURL:url];
          return NO;
      }
      else {
          return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ];
      }
  }
  </code></pre>