title: How to resolve Jwplayer throwing error on seek and will allow the player to load from stored local time
body: <p>We are trying to get our player load from stored time in local storage.</p>
  <p>We keep getting this error</p>
  <blockquote>
  <p>Error in &quot;beforePlay&quot; event handler: TypeError: can't access property &quot;seekRange&quot;, m is null</p>
  </blockquote>
  <p>The code that loads is the following:</p>
  <pre><code>let time = parseFloat(this.stored_time);
  jwplayer().on('ready', function(e) {
     jwplayer().on('beforePlay', function(e) {
        jwplayer().seek(time);
     })
  })
  </code></pre>
  <p>in the on ready function the player should be ready.</p>
  <p>in the play() on beforePlay block works, so the global jwplayer function is avaialbe</p>
  <pre><code>jwplayer().on('beforePlay', function(e) {
        jwplayer().play();
  })
  </code></pre>
  <p>In the this.stored_time it has values like 1743.616545. I've tried typecasting to Int but no difference the jwplayer().seek(time) throws the error above.</p>
  <p>Originally I tried just using the on ready handler; with this the player crashed when jwplayer().seek(time) runs.</p>
  <p>Any ideas on how to resolve this?</p>
  <p>Regards,
  Steve</p>