title: How to play audio only from youtube videos using HTML and javascript
body: <p><strong>What I'm trying to do</strong>: Create a list of items which contains a link to play audio from a youtube video beside each item</p>
  
  <p><strong>What I'm currently doing</strong>: I'm able to do this for a single item using the below:</p>
  
  <pre><code>&lt;div data-video="VIDEO_ID"  
       data-autoplay="0"         
       data-loop="1"             
       id="youtube-audio"&gt;
  &lt;/div&gt;
  &lt;script src="https://www.youtube.com/iframe_api"&gt;&lt;/script&gt;
  &lt;script src="https://cdn.rawgit.com/labnol/files/master/yt.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>This creates a play button and works perfectly on a single item, however will not work with multiple items on the same page presumably since they all use the same ID. Creating a different ID causes the player to not function. Creating two different data-video's with the same ID will only allow the first one to play, the other will appear correctly but not operate when pressing play.</p>
  
  <p><strong>Looking for solution</strong>: Preferably how to use the existing script for multiple videos on the same page. Otherwise an alternative solution for playing audio only on youtube videos with a custom play button would be great. </p>
  
  <p>Thanks!</p>