title: Play Embeded YouTube video using UIWebview
body: <p>Embeded Youtube video in UIWebview. How can i play this you tube video using UIWebview when UIButton is pressed.</p>
  
  <pre><code>- (void)viewDidLoad
   {
  CGRect rect = [[UIScreen mainScreen] bounds];
  CGSize screenSize = rect.size;
  
  UIWebView *webView = [[UIWebView alloc]initWithFrame:CGRectMake(0,0,screenSize.width,screenSize.height)];
  webView.autoresizesSubviews = YES;
  webView.autoresizingMask=(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth);
  
  NSString *videoUrl = @"http://http://www.youtube.com/v/oHg5SJYRHA0";
  NSString *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=\"320\" height=\"480\"&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=\"320\" height=\"480\"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;",videoUrl,videoUrl]    ;
  
  [webView loadHTMLString:htmlString baseURL:[NSURL URLWithString:@"http://www.youtube.com"]];
  
  //[window addSubview:webView];
  [webView release]; 
  
  [super viewDidLoad];
  // Do any additional setup after loading the view.
  } 
  </code></pre>
  
  <p>When user presses this UIButton it should start playing embedded youtube video</p>
  
  <pre><code>UIButton *videoButton = [UIButton buttonWithType:UIButtonTypeCustom];
   [videoButton addTarget:self action:@selector(VideoAction:) forControlEvents:UIControlEventTouchUpInside];
  videoButton.frame = CGRectMake(0, 0, 40, 40);
  UIImage *icn = [UIImage imageNamed:@"Video_icon.png"];
  [videoButton setImage:icn forState:UIControlStateNormal];
  UIBarButtonItem *video = [[UIBarButtonItem alloc] initWithCustomView:videoButton];
  </code></pre>
  
  <p>How can i play youtube video.</p>
  
  <p>Thanks for help.</p>