title: how to set iFrame height and width same as WKWebView frame?
body: <p>I have given size of <code>WKWebView("myPlayer" in below code)</code> frame dynamically for the <code>iFrame</code> embedded in it but the youtube video view displays 1/3 of <code>WKWebView</code>. Below is my code and reference image.</p>
  
  <p><a href="https://i.stack.imgur.com/SPzWH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SPzWH.png" alt="small video in WKWebView"></a></p>
  
  <pre><code>let videoURL:URL = URL(string: "https://www.youtube.com/embed/695PN9xaEhs")!
  @IBOutlet weak var myPlayer: WKWebView!
  var didLoadVideo = false
  var embedVideoHtml:String?
  override func viewDidLoad() {
      super.viewDidLoad()
      embedVideoHtml = {
      return """
      &lt;!DOCTYPE html&gt;
      &lt;html&gt;
      &lt;body&gt;
      &lt;!-- 1. The &lt;iframe&gt; (and video player) will replace this &lt;div&gt; tag. --&gt;
      &lt;div id="player"&gt;&lt;/div&gt;
  
      &lt;script&gt;
      var tag = document.createElement('script');
  
      tag.src = "https://www.youtube.com/player_api";
      var firstScriptTag = document.getElementsByTagName('script')[0];
      firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
  
      var player;
      function onYouTubeIframeAPIReady() {
      player = new YT.Player('player', {
      playerVars: { 'autoplay': 1, 'controls': 0, 'playsinline': 1 },
      height: '\(myPlayer.frame.height)',
      width: '\(myPlayer.frame.width)',
      videoId: '\(videoURL.lastPathComponent)',
      events: {
      'onReady': onPlayerReady
      }
      });
      }
  
      function onPlayerReady(event) {
      event.target.playVideo();
      }
      &lt;/script&gt;
      &lt;/body&gt;
      &lt;/html&gt;
      """
  }()
  
  
  }
  </code></pre>
  
  <p>So any one have idea how to fit the youtube video view in myPlayer frame?</p>