title: Changing songs on jPlayer by clicking a link, hosted on Amazon S3
body: <p>Hello all and thanks for any help in advance.</p>
  
  <p>I have a ruby on rails application in which I am attempting to stream audio through jPlayer, which is hosted on S3.  So far I have no problem uploading files or using the browsers built in player to play audio files, or even getting jPlayer to initialize with a song that is on S3.  The issue comes when I get into changing songs.</p>
  
  <p>I initialize jPlayer like this:</p>
  
  <pre><code>$('a.html5').click(function() { 
  
      var url = $(this).attr('href');  
  
      $("#jquery_jplayer_1").jPlayer({
          ready: function (event) {
              $(this).jPlayer("setMedia", {
                  mp3: url
              });
          },
          swfPath: "javascripts",
          supplied: "mp3",
          wmode: "window"
      });
      return false;  
  });  
  </code></pre>
  
  <p>where the mp3: url points to the S3 URL (this all works just fine).</p>
  
  <p>This allows me to select a song from a list of links, and it loads up and starts playing no problem.</p>
  
  <p>The issue is that when I try to change songs, I get an access-control-allow-origin error.  So I tried the following:</p>
  
  <pre><code>$('a.html5').click(function() {
  
      var url = $(this).attr('href');  
  
      $("#jquery_jplayer_1").jPlayer("setMedia", mp3: url).jPlayer("play");
  
      return false;  
    });
  </code></pre>
  
  <p>This still gives me an access-control-allow-origin error.  I have been pounding my head against the wall for hours trying to figure this out and nothing.  </p>
  
  <p>So basically a summary is that I can initialize jPlayer and play a song just fine, but when I want to go change a song, access-control-allow-origin errors ruin my day.</p>
  
  <p>Any ideas?</p>