We are trying to get our player load from stored time in local storage.
We keep getting this error
Error in "beforePlay" event handler: TypeError: can't access property "seekRange", m is null
The code that loads is the following:
let time = parseFloat(this.stored_time);
jwplayer().on('ready', function(e) {
jwplayer().on('beforePlay', function(e) {
jwplayer().seek(time);
})
})
in the on ready function the player should be ready.
in the play() on beforePlay block works, so the global jwplayer function is avaialbe
jwplayer().on('beforePlay', function(e) {
jwplayer().play();
})
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.
Originally I tried just using the on ready handler; with this the player crashed when jwplayer().seek(time) runs.
Any ideas on how to resolve this?
Regards, Steve