共用方式為


IMediaRenderer::SetSourceFromMediaSourceAsync method (windows.media.streaming.h)

Instructs the DMR asynchronously to prepare the specified content for playing.

Syntax

HRESULT SetSourceFromMediaSourceAsync(
  [in]  IInspectable                *mediaSource,
  [out] __FIAsyncOperation_1_UINT32 **value
);

Parameters

[in] mediaSource

A reference to an IInspectable interface implementing IMFActivate. The IMFActivate interface is used to query for an IMFMediaSource interface that represents the media source.

[out] value

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
S_OK
The method succeeded.

Remarks

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 mediaSource parameter.

Requirements

Requirement Value
Target Platform Windows
Header windows.media.streaming.h

See also

IMediaRenderer