duration

Gets the duration of the current media resource.

public long duration()
Since
Available since v4.5.1.
Note: This method is only valid when playing a local media file or inputting an online media stream.

Return Values

When the method call succeeds, returns the duration of the current media resource in milliseconds.