title: Multiple responsive video.js players
body: <p>I'm using this solution, <a href="http://daverupert.com/2012/05/making-video-js-fluid-for-rwd/" rel="nofollow">http://daverupert.com/2012/05/making-video-js-fluid-for-rwd/</a>, to make the videojs player fluid.  My problem is when I have multiple videos (each with a unique id), I'm not sure how to make this work.</p>
  
  <p>Here is my dev site I have 3 videos on, <a href="http://tweedee.e-mediaresources.info/" rel="nofollow">http://tweedee.e-mediaresources.info/</a></p>
  
  <p>Here is the code I have for the player (from Dave Rupert's solution above):</p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
      // Once the video is ready
      _V_('#my_video_1').ready(function(){
  
          var myPlayer = this;    // Store the video object
          var aspectRatio = 9/16; // Make up an aspect ratio
  
          function resizeVideoJS(){
              // Get the parent element's actual width
              var width = document.getElementById(myPlayer.id).parentElement.offsetWidth;
              // Set width to fill parent element, Set height
              myPlayer.width(width).height( width * aspectRatio );
          }
  
          resizeVideoJS(); // Initialize the function
          window.onresize = resizeVideoJS; // Call the function on resize
      });
      &lt;/script&gt;
  </code></pre>
  
  <p>This code works fine for one video, but how do I do multiple ids???  As you can see in my dev site, I just replicated the script above three times (each with a different id) and that only causes the last video to be fluid.</p>