title: Is it possible to make a *portrait* <video> tag responsive in Wordpress?
body: <p>[important note: this only affects self-hosted <code>&lt;video&gt;</code> tags, not youtube or vimeo iframes]</p>
  
  <p>So I'm embedding in the page cellphone videos with a <strong>vertical ratio</strong> (portrait) (typically 720px width and 1280px height).</p>
  
  <p>Everything works, except the videos will not adapt to the page. The width will fit, but the user needs to scroll up and down while the video plays to appreciate what is being shown.</p>
  
  <p>I've tried all the CSS tricks to make the video div responsive, but it won't work.</p>
  
  <p>The videos are wrapped into a div which reads as so:</p>
  
  <pre><code>.wp-video-shortcode, video, .mejs-mediaelement {
      max-width: 100% !important;
      max-height:100% !important;
  }
  </code></pre>
  
  <p>But to no effect (only the width appears to adapt as the page changes size!).</p>
  
  <p>IF I manually alter the width and hight in the shortcode, as so:</p>
  
  <pre><code>[video width="720" height="1280" mp4="http://url.mp4" autoplay="true" poster="http://url.jpg"][/video]
  </code></pre>
  
  <p>becoming</p>
  
  <pre><code>[video width="340" height="680" mp4="http://url.mp4" autoplay="true" poster="http://url.jpg"][/video]
  </code></pre>
  
  <p>The video gets smaller, <strong>but still will not adapt to the page.</strong></p>
  
  <p>I think I've figured why...? Tell me if I am off track:</p>
  
  <p>The whole premise of how the <code>&lt;video&gt;</code> embed in Wordpress is sized, seems to be based on <code>width</code>: there is even a global variable called <code>$content_width</code> for this purpose, while there is no <code>$content_height</code>.</p>
  
  <p>Specifically, this is what happens in the <code>wp_video_shortcode</code> function:</p>
  
  <pre><code>global $content_width;
  
  // if the video is bigger than the theme
          if ( ! empty( $content_width ) &amp;&amp; $atts['width'] &gt; $content_width ) {
              $atts['height'] = round( ( $atts['height'] * $content_width ) / $atts['width'] );
              $atts['width'] = $content_width;
          }
  </code></pre>
  
  <p>as you can see above, wp only seems to be checking the video only against the width of the page.</p>
  
  <p>How can this be worked out?</p>