React JW player how to get current duration of video?


I am using React JW player.

My component

                      playlist={{"My JSON"}}

This is working well. I need to get the current duration of the playing video. How can I do that in reactjs?


You can access "raw" JW player by doing

<ReactJWPlayer playerId="id" ...

let playerInstance = window.jwplayer('id');

To get current position of JW Player do


Expose JW Player instance | JW Player .getPosition()

Answered By – Justinas

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published