Search code examples
javavideo-processingjmf

How to get video length using JMF?


I'm using JMF and I wonder if there is a way of getting the length of the movie I'm playing in HH:mm:ss or in long format?


Solution

  • Player extends Controller that extends Duration that declares method

    Time getDuration():

    Here is quotation from its javadoc: Get the duration of the media represented by this object.

    Shortly create player and then invoke its getDuration()