MediaRenderer.SetSourceFromUriAsync method

Instructs the DMR asynchronously to prepare the content identified by the specified URI for playing.


HRESULT SetSourceFromUriAsync(
  [in]  HSTRING           URI,
  [out] PlaybackOperation **value


  • URI [in]
    An HSTRING containing the file path or resource location of media content.

  • value [out]
    Receives a reference to a PlaybackOperation object that is used to get results from the asynchronous operation.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description

The method succeeded.



If the DMR is not currently playing anything, the PlayAsync or PlayAtSpeedAsync method must be used to instruct the DMR to start playing. If the DMR is already playing content, it will automatically switch to the content provided by the URI parameter.

See also