Windows Dev Center

IMFMediaEngine::CanPlayType method

Queries how likely it is that the Media Engine can play a specified type of media resource.

Syntax


HRESULT CanPlayType(
  [in]  BSTR                    type,
  [out] MF_MEDIA_ENGINE_CANPLAY *pAnswer
);

Parameters

type [in]

A string that contains a MIME type with an optional codecs parameter, as defined in RFC 4281.

pAnswer [out]

Receives an MF_MEDIA_ENGINE_CANPLAY enumeration value.

Return value

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

Remarks

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

The canPlayType attribute defines the following values.

ValueDescription
"" (empty string)The user-agent cannot play the resource, or the resource type is "application/octet-stream".
"probably"The user-agent probably can play the resource.
"maybe"Neither of the previous values applies.

 

The value "probably" is used because a MIME type for a media resource is generally not a complete description of the resource. For example, "video/mp4" specifies an MP4 file with video, but does not describe the codec. Even with the optional codecs parameter, the MIME type omits some information, such as the actual coded bit rate. Therefore, it is usually impossible to be certain that playback is possible until the actual media resource is opened.

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:
© 2015 Microsoft