IMFMediaEngine::SetSourceElements method

Sets a list of media sources.

Syntax


HRESULT SetSourceElements(
  [in]  IMFMediaEngineSrcElements *pSrcElements
);

Parameters

pSrcElements [in]

A pointer to the IMFMediaEngineSrcElements interface. The caller must implement this interface.

Return value

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

Remarks

This method corresponds to adding a list of source elements to a media element in HTML5.

The Media Engine tries to load each item in the pSrcElements list, until it finds one that loads successfully. After this method is called, the application can use the IMFMediaEngineSrcElements interface to update the list at any time. To reload the list, call IMFMediaEngine::Load.

This method completes asynchronously. When the 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 a URL, it sends an MF_MEDIA_ENGINE_EVENT_ERROR event.

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

If the application also calls IMFMediaEngine::SetSource, the URL passed to SetSource takes precedence over the list given to SetSourceElements.

Requirements

Minimum supported client

Windows 8 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 [desktop apps | Windows Store apps]

Header

Mfmediaengine.h

See also

IMFMediaEngine

 

 

Community Additions

ADD
Show:
© 2014 Microsoft