IMFMediaEngine::Load method (mfmediaengine.h)

Loads the current media source.

Syntax

HRESULT Load();

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The main purpose of this method is to reload a list of source elements after updating the list. For more information, see SetSourceElements. Otherwise, calling this method is generally not required. To load a new media source, call IMFMediaEngine::SetSource or IMFMediaEngine::SetSourceElements.

The Load method explicitly invokes the Media Engine's media resource loading algorithm. Before calling this method, you must set the media resource by calling IMFMediaEngine::SetSource or IMFMediaEngine::SetSourceElements.

This method completes asynchronously. When the Load operation starts, the Media Engine sends an MF_MEDIA_ENGINE_EVENT_LOADSTART event. If no errors occur during the Load operation, several other events are generated, including the following.

  • MF_MEDIA_ENGINE_EVENT_LOADEDMETADATA
  • MF_MEDIA_ENGINE_EVENT_LOADEDDATA
  • MF_MEDIA_ENGINE_EVENT_CANPLAY
  • MF_MEDIA_ENGINE_EVENT_CANPLAYTHROUGH
If the Media Engine is unable to load the file, the Media Engine sends an MF_MEDIA_ENGINE_EVENT_ERROR event.

For more information about event handling in the Media Engine, see IMFMediaEngineNotify.

This method corresponds to the load method of the HTMLMediaElement interface in HTML5.

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