title: Angular2 Observable with interval
body: <p>I have a function that needs to be called about every 500ms. The way I am looking at doing it with angular2 is using intervals and observables. I have tried this function to create the observable:</p>
  
  <pre><code>counter() {
    return Observable.create(observer =&gt; {
      setInterval(() =&gt; {
        return this.media.getCurrentPosition();
      }, 500)
    })
  }
  </code></pre>
  
  <p>With this code for the subscriber:</p>
  
  <pre><code>test() {
    this.playerService.initUrl(xxxx) // This works
    this.playerService.counter().subscribe(data =&gt; {
      res =&gt; {
        console.log(data);
      }
    })
  }
  </code></pre>
  
  <p>I am very new to observables and angular2 so I might be taking the wrong approach completely. Any help is appreciated.</p>