title: html5 audio setting currentTime
body: <p>I built a player for HTML5 that download the music from my server, the player works just fine if i play the song from the begining but when i try to play a song from a specific time using the currentTime attribute nothing happen and the song start from the begining</p>
  
  <p>my server side is Java spring mvc, and my client is angularJS.</p>
  
  <p>cleint part:</p>
  
  <p>audio factory:</p>
  
  <pre><code>tunesApp.factory('audio', function($document) {
      var audio = $document[0].createElement('audio');
      return audio;
  });
  </code></pre>
  
  <p>player factory:</p>
  
  <pre><code>tunesApp.factory('player', function(audio, $rootScope) {
      var player,
          playlist = [],
          current = {
            track: 0
          };
  
      player = {
        playlist:playlist,
        play: function(track) {
          if (!playlist.length) return;
  
          if (angular.isDefined(track)) current.track = track;
  
          audio.src = playlist[current.track].url;
          audio.currentTime = playlist[current.track].startFrom; // also try with .toString()
          audio.play();
        }
      };
  
      playlist.add = function(album) {
        if (playlist.indexOf(album) != -1) return;
        playlist.push(album);
      };
  
      playlist.remove = function(album) {
        var index = playlist.indexOf(album);
        if (index == current.album) player.reset();
        playlist.splice(index, 1);
      };
  
      return player;
  });
  </code></pre>
  
  <p>and when i add song:</p>
  
  <pre><code>tunesApp.controller('myController', function(player) {
      player.playlist.add({
          url: "/path/to/server",
          startFrom: 65 // in seconds
      });
  
      player.play();
  });
  </code></pre>
  
  <p>and the server controller to get the song:</p>
  
  <pre><code>@RequestMapping(path="/song/{file_id}", method=RequestMethod.GET)
  public void getFile(@PathVariable("file_id") String fileId, HttpServletResponse response){
      try{
          // get the song from the DB
          String songName = DB.getSong(fileId);
          File file = new File(fullPath + songName);
          response.setContentType("audio/mpeg"); // i use only mp3 files
          Long length = file.length();
          response.addHeader("Content-Range", "bytes 0-" + new Long(length-1).toString()+"/"+length);
          response.setContentLength((int)length);
          InputStream inputStream = new BufferInputStream(new FileInputStream(file));
          FileCopyUtils.copy(inputStream,response.getOutputStream());
  
          response.flushBuffer();
      }catch(Exception ex){}
  }
  </code></pre>
  
  <p>this code worked for a while and then stop working :(</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>the code works perfectly in edge but the bug is in chrome 44 and 48</p>
  
  <p>any help?</p>