Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

React JW player how to get current duration of video?

I am using React JW player.

My component

                    <ReactJWPlayer
                      playerId="id"
                      playerScript="https://content.jwplatform.com/libraries/xxxx.js"
                      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?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can access "raw" JW player by doing

<ReactJWPlayer playerId="id" ...

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

To get current position of JW Player do

playerInstance.getPosition();

Expose JW Player instance | JW Player .getPosition()

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading