title: Issue while playing video in webview
body: <p>I m having video on server and i am using webview to play video but every first when i click done(in webview) it goes up while it works fine second time please suggest me how can i resolve this...</p>
  
  <pre><code>-(void)showPopViewWithUrl:(NSString*)url {
      self.navigationController.navigationBar.hidden = YES;
      float diff = [UIScreen mainScreen].bounds.size.height - self.view.frame.size.height;
      UIView* popView = [[UIView alloc] init];
      popView.frame = CGRectMake(0, -diff, self.view.frame.size.width, self.view.frame.size.height+diff);
      [popView setBackgroundColor:[UIColor yellowColor]];
  
      UIWebView* webview = [[UIWebView alloc] init];
      webview.backgroundColor = [UIColor clearColor];
      [webview setFrame:CGRectMake(0, 0, 300, 250)];
  
       UIButton* crossBtn = [UIButton buttonWithType:UIButtonTypeCustom];
       crossBtn.backgroundColor = [UIColor clearColor];
       [crossBtn addTarget:self action:@selector(crossBtnClicked:) forControlEvents:UIControlEventTouchUpInside];
       [crossBtn setImage:[UIImage imageNamed:@"close_pop.png"] forState:UIControlStateNormal];
       [crossBtn setFrame:CGRectMake(popView.frame.size.width-30, popView.frame.size.height-40, 30, 30)];
  
      [popView addSubview:webview];
      [webview addSubview:crossBtn];
  
      [self.view addSubview:popView];
      [self playVideo:url webview:webview];
  }
  
  - (void)playVideo:(NSString *)urlString webview:(UIWebView*)videoView {
      NSString *embedHTML = @"\
      &lt;html&gt;&lt;head&gt;\
      &lt;style type=\"text/css\"&gt;\
      body {\
      background-color: transparent;\
      color: white;\
      }\
      &lt;/style&gt;\
      &lt;script&gt;\
      function load(){document.getElementById(\"yt\").play();}\
      &lt;/script&gt;\
      &lt;/head&gt;&lt;body onload=\"load()\"style=\"margin:0\"&gt;\
      &lt;video id=\"yt\" src=\"%@\" \
      width=\"%0.0f\" height=\"%0.0f\" autoplay controls&gt;&lt;/video&gt;\
      &lt;/body&gt;&lt;/html&gt;";
      NSString *html = [NSString stringWithFormat:embedHTML, urlString,videoView.frame.size.width, videoView.frame.size.height];
  
      [videoView loadHTMLString:html baseURL:nil];
     // [self.view addSubview:videoView];
  
      NSLog(@"%@",html);
  }
  </code></pre>