title: JW Player Version 5 Audtio Only
body: <p>I have JW Player version 5 embedded into a webpage.  I am using it for AUDIO only.  Everything works fine in browsers and on android devices.  However, when on an iPad surfing with Safari the audio will not play.  It is set up so that the user has to click the play button in order for the file to start playing.  When you click the button it says something like "Download not available".  I can't provide a link as it is on an internal development server, but this the code that I am using (if it helps).  Any suggestions would be greatly appreciated.</p>
  
  <pre><code>var secondsPlayed, myDuration, pctViewed, isComplete, lastTimeStamp;
  
  window.onload = function () 
  {
  
      myDuration = &lt;%=intTotalLength %&gt;;
      isComplete = false
      lastTimeStamp = 0
      jwplayer("container").setup({
          flashplayer: "js/jwplayer/player.swf",
          file: "&lt;%=strAudioFileName%&gt;",
          controlbar: "bottom",
          height: 20,
          width: 350,
          Duration:&lt;%=intTotalLength %&gt;,
          events: {
              onTime: function (event) {
                  secondsPlayed = event.position;
                  pctViewed = secondsPlayed / myDuration * 100;
                  if (pctViewed &gt; 99.99) {
                      isComplete = true;
                  }
              },
              onMeta: function (evt) {
                  if ((typeof evt.metadata.duration != "undefined") &amp;&amp; (evt.metadata.duration &gt; 0)) {
                      myDuration = evt.metadata.duration;
                  }
              },
              onPlay: function () {
                   startTracking();
              },
              onComplete: function () {
                   stopTracking()
              }
          }
  
      });
  
  }
  
  function startTracking() {
      setTimeout("updateViewData()", 20000);
  }
  
  function stopTracking() {
      isComplete = true;
      updateViewData();
  }
  
  function updateViewData() {
      if (secondsPlayed != lastTimeStamp) {
          lastTimeStamp = secondsPlayed;
  
          $.ajax({
              url: "mediatimetracker.asp",
              type: "post",
              data: "ViewId=&lt;%=strViewID %&gt;&amp;SecondsPlayed=" + secondsPlayed + "&amp;IsComplete=" + isComplete,
              success: function (res) {
                  if (isComplete == false) setTimeout("updateViewData()", 20000);
              }
          });
      }
  }
  </code></pre>