JWPlayer getDuration() returns 0
I am trying to get the duration of an HLS video. From the documentation, I could understand that the getDuration() method returns the duration. But what I get is 0 as the response. I want to get the duration on loading the player(before the video starts running). Is there any solution for this?