title: iPad HTML5 Audio Tracks Not Resetting
body: <p>For some odd reason the HTML5 Audio API won't give me access to currentTime in iOS 4 and 5 for iPads and iPods. I need to adjust currentTime whenever an audio element is played, but it acts like the current time isn't accessible. Looked everywhere for an answer on this and I can't figure it out. My code below works fine in all modern browsers, so I'm a bit stumped.</p>
  
  <p>My HTML markup</p>
  
  <pre><code>&lt;p&gt;
      &lt;a class="audio" href="assets/audio/ambient-sounds-1.mp3" data-flash="http://athens.sierrabravo.net/~ablue/plato/videoplayer/assets/audio/niftyplayer.swf" data-mp3="http://athens.sierrabravo.net/~ablue/plato/videoplayer/assets/audio/ambient-sounds-1.mp3" data-ogg="http://athens.sierrabravo.net/~ablue/plato/videoplayer/assets/audio/ambient-sounds-1.ogg"&gt;
          Ambient Sounds
          &lt;span class="audio-play"&gt;Play&lt;/span&gt;
          &lt;audio preload=""&gt;
              &lt;source preload="" src="http://athens.sierrabravo.net/~ablue/plato/videoplayer/assets/audio/ambient-sounds-1.mp3" type="audio/mpeg"&gt;
              &lt;source preload="" src="http://athens.sierrabravo.net/~ablue/plato/videoplayer/assets/audio/ambient-sounds-1.ogg" type="audio/ogg"&gt;
          &lt;/audio&gt;
      &lt;/a&gt;
  &lt;/p&gt;
  
  &lt;p&gt;
      &lt;a class="audio" href="assets/audio/city_street.mp3" data-flash="http://athens.sierrabravo.net/~ablue/plato/videoplayer/assets/audio/niftyplayer.swf" data-mp3="http://athens.sierrabravo.net/~ablue/plato/videoplayer/assets/audio/city_street.mp3" data-ogg="http://athens.sierrabravo.net/~ablue/plato/videoplayer/assets/audio/city_street.ogg"&gt;
          City Street Sounds
          &lt;span class="audio-play"&gt;Play&lt;/span&gt;
          &lt;audio preload=""&gt;
              &lt;source preload="" src="http://athens.sierrabravo.net/~ablue/plato/videoplayer/assets/audio/city_street.mp3" type="audio/mpeg"&gt;
              &lt;source preload="" src="http://athens.sierrabravo.net/~ablue/plato/videoplayer/assets/audio/city_street.ogg" type="audio/ogg"&gt;
          &lt;/audio&gt;
      &lt;/a&gt;
  &lt;/p&gt;
  
  &lt;p&gt;
      &lt;a class="audio" href="#" data-flash="http://athens.sierrabravo.net/~ablue/plato/videoplayer/assets/audio/niftyplayer.swf" data-mp3="http://athens.sierrabravo.net/~ablue/plato/videoplayer/assets/audio/crash.mp3" data-ogg="http://athens.sierrabravo.net/~ablue/plato/videoplayer/assets/audio/crash.ogg"&gt;
          Loud Crash
          &lt;span class="audio-play"&gt;Play&lt;/span&gt;
          &lt;audio preload=""&gt;
              &lt;source preload="" src="http://athens.sierrabravo.net/~ablue/plato/videoplayer/assets/audio/crash.mp3" type="audio/mpeg"&gt;
              &lt;source preload="" src="http://athens.sierrabravo.net/~ablue/plato/videoplayer/assets/audio/crash.ogg" type="audio/ogg"&gt;
          &lt;/audio&gt;
      &lt;/a&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>My JavaScript</p>
  
  <pre><code>AudioPlayer = {
      init: function () {
          var player = this;
          this.audio = $('.audio'); // Save and cache all audio elements so they can be targeted by mass stop()
  
          player.audio.each( function() {
              // Bind each audio element
              player.bind($(this));
          });
      },
  
      bind: function (object) {
          var player = this;
  
          object.bind('touchstart click', function() {
  
              // get the real DOM element, not the jQuery array
              var audio = $(this).find('audio').get(0);
  
              if(audio.paused) { // Check if its playing
                  player.play(audio);
              }
              else {
                  player.stop(audio);
              }
  
              return false;
          });
      },
  
      play: function(audio) {
          // Stop all existing audio elements and set them to 0
          this.audio.each( function() {
              var audioOther = $(this).find('audio').get(0);
              audioOther.pause();
          });
  
          // Play the audio element
          if(audio.currentTime) audio.currentTime = 0;
          audio.play();
      },
  
      stop: function(audio) {       
          if(audio.currentTime) audio.currentTime = 0;
          audio.play();
      }
  
  };
  </code></pre>