code: function (to, duration, direction) {
      var from = this._currentTime;
      if (to===from) return;
      if (this._loop && !this._feeded) {
        var loopDuration = this.duration;
        var cur = Math.abs(to - from);
        var aft = Math.abs(to + loopDuration - from);
        var bef = Math.abs(to - loopDuration - from);
        if (direction === undefined) {
          // Find the closest 'to' assuming loop is enabled
          if (aft < cur || bef < cur) {
            if (aft < bef)
              to += loopDuration;
            else
              to -= loopDuration;
          }
        }
        else {
          if (direction) {
            if (aft < cur)
              to += loopDuration;
          }
          else {
            if (bef < cur)
              to -= loopDuration;
          }
        }
      }
      if (this.paused || !duration) {
        this._currentTime = to;
        this._requestRender();
      }
      else {
        var playbackRate = this._playbackRate;
        this._slidingTarget = {
          from: from,
          to: to,
          startTime: null, // will be set in the render loop
          duration: duration,
          initialPlaybackRate: (to>from) === (playbackRate>0) ? playbackRate : 0
        };
      }
    }
docs: direction: undefined mean no direction. true: right, false: left