title: How to play embedded you tube video in iOS5
body: <p>I am in trouble to sort the issue of playing the you tube video on my iphone 5...
  I am using this code for this:</p>
  
  <pre><code> urls = [urls stringByAppendingString:@"&amp;autoplay=1"];
   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=\"212\" height=\"212\"&gt;&lt;param name=\"movie\" value=\"%@\"&gt;",urls];
  
  NSString *htm2=[NSString stringWithFormat:@"&lt;/param&gt;&lt;param name=\"wmode\" value=\"transparent\"&gt;&lt;/param&gt;    &lt;embed src=\"%@\"type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"212\" height=\"212\"&gt;&lt;/embed&gt;    &lt;/object&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;",urls];
  //    NSString* embedHTML = @"&lt;html&gt;&lt;head&gt; &lt;/head&gt;&lt;body style=\"margin:0\"&gt; &lt;iframe title=\"YouTube video player\" class=\"youtube-player\" type=\"text/html\" width=\"%d\" height=\"%d\" src=\"%@\" frameborder=\"0\" allowFullScreen&gt;&lt;/iframe&gt; &lt;/body&gt;&lt;/html&gt;";  
  
  NSString* html = [NSString stringWithFormat:@"%@%@",htmlString,htm2];
  NSLog(@"Html - %@",urls);
  float version = [[[UIDevice currentDevice] systemVersion] floatValue];
  
  
  if(version &lt;= 5.0)
  { 
  
      NSRange r=[urls rangeOfString:@"v="];
      NSRange ran=NSMakeRange(r.location+2, [urls length]-r.location-2);
      NSString *vid=[urls substringWithRange:ran];
      html=[NSString stringWithFormat:@"&lt;embed id=\"yt\" src=\"http://www.youtube.com/watch?v=%@&amp;fs=0\" type=\"application/x-shockwave-flash\" width=\"300\" height=\"300\"&gt;&lt;/embed&gt;", vid];
  }
  //NSLog(html);
  
  [videoView loadHTMLString:html baseURL:nil]; 
  </code></pre>
  
  <p>Can anybody please help to me to sort out with this issue?
  Your help will be highly appreciated.</p>