title: How to provide infinite animations through AnimationPlayer or AnimationReferenceMetadata (alternatives wanted)
body: <p>I have a <code>AnimationPlayer</code> defined animation according a specified <code>AnimationReferenceMetadata</code> definition.</p>
  
  <p>Some thing like this :</p>
  
  <pre><code>const base: AnimationMetadata[] = [
    style({
      opacity: `{{startOpacity}}`
    }),
    animate(
      `{{duration}} {{delay}} {{easing}}`,
      style({
        opacity: `{{endOpacity}}`
      })
    )
  ];
  
  const fadeIn: AnimationReferenceMetadata = animation(base, {
    params: {
      delay: "0s",
      duration: "350ms",
      easing: EaseOut.sine,
      endOpacity: 1,
      startOpacity: 0
    }
  });
  </code></pre>
  
  <p>I have a <code>directive</code> to play a animation upon interaction.
  This <code>directive</code>is using a <code>Animation</code> class to build and play the animation according the specified <code>AnimationReferenceMetadata</code>.</p>
  
  <pre><code>export class Animation extends BehaviorManager {
  
    private _player: AnimationPlayer;
    private _isInfinite: boolean = false;
  
    constructor(meta: AnimationReferenceMetadata, infinte:boolean = false, public _el: ElementRef,private _builder: AnimationBuilder) {
      super();
  
      const animation: AnimationFactory = this._builder.build(meta);
      this._isInfinite = infinte;
      this._player = animation.create(this._el.nativeElement);
    }
  
    public play() {
      this._player.onDone(() =&gt; {
        if(this._isInfinite){
          this.reset();
          this.play();
        }
      });
      this._player.play();
    }
  
    public reset() {
      this._player.reset();
    }
  }
  </code></pre>
  
  <p>I want to infinite play the animation.</p>
  
  <p>It seems the <code>animation-iteration-count</code> (infinite) is not supported. Or maybe I'm using it wrong.</p>
  
  <p>Using the <code>onDone</code> callback I can reset and replay the <code>AnimationPlayer</code>.</p>
  
  <p><strong>The infinite animation loop works.</strong></p>
  
  <p><strong>I'm looking for a better way to infinite this animation. 
  Any suggestions or help?</strong></p>