IMFMediaEngine::GetDuration method (mfmediaengine.h)

Gets the duration of the media resource.

Syntax

double GetDuration();

Return value

Returns the duration, in seconds. If no media data is available, the method returns not-a-number (NaN). If the duration is unbounded, the method returns an infinite value.

Remarks

This method corresponds to the duration attribute of the HTMLMediaElement interface in HTML5.

If the duration changes, the Media Engine sends an MF_MEDIA_ENGINE_EVENT_DURATIONCHANGE event. See IMFMediaEngineNotify::EventNotify.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 [desktop apps | UWP apps]
Target Platform Windows
Header mfmediaengine.h

See also

IMFMediaEngine