getDuration

Gets the duration of the media resource.

long getDuration();

Return Values

  • If the method call succeeds, returns the total duration of the media file (milliseconds).
  • If the method call fails, returns a value less than 0.