本文整理汇总了C++中MediaPlayerFactory::supportsTypeAndCodecs方法的典型用法代码示例。如果您正苦于以下问题:C++ MediaPlayerFactory::supportsTypeAndCodecs方法的具体用法?C++ MediaPlayerFactory::supportsTypeAndCodecs怎么用?C++ MediaPlayerFactory::supportsTypeAndCodecs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaPlayerFactory
的用法示例。
在下文中一共展示了MediaPlayerFactory::supportsTypeAndCodecs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: supportsType
MediaPlayer::SupportsType MediaPlayer::supportsType(const MediaEngineSupportParameters& parameters, const MediaPlayerSupportsTypeClient* client)
{
// 4.8.10.3 MIME types - The canPlayType(type) method must return the empty string if type is a type that the
// user agent knows it cannot render or is the type "application/octet-stream"
if (parameters.type == applicationOctetStream())
return IsNotSupported;
MediaPlayerFactory* engine = bestMediaEngineForSupportParameters(parameters);
if (!engine)
return IsNotSupported;
#if PLATFORM(COCOA)
// YouTube will ask if the HTMLMediaElement canPlayType video/webm, then
// video/x-flv, then finally video/mp4, and will then load a URL of the first type
// in that list which returns "probably". When Perian is installed,
// MediaPlayerPrivateQTKit claims to support both video/webm and video/x-flv, but
// due to a bug in Perian, loading media in these formats will sometimes fail on
// slow connections. <https://bugs.webkit.org/show_bug.cgi?id=86409>
if (client && client->mediaPlayerNeedsSiteSpecificHacks()) {
String host = client->mediaPlayerDocumentHost();
if ((host.endsWith(".youtube.com", false) || equalIgnoringCase("youtube.com", host))
&& (parameters.type.startsWith("video/webm", false) || parameters.type.startsWith("video/x-flv", false)))
return IsNotSupported;
}
#else
UNUSED_PARAM(client);
#endif
return engine->supportsTypeAndCodecs(parameters);
}
示例2: supportsType
MediaPlayer::SupportsType MediaPlayer::supportsType(ContentType contentType)
{
String type = contentType.type();
String codecs = contentType.parameter("codecs");
MediaPlayerFactory* engine = chooseBestEngineForTypeAndCodecs(type, codecs);
if (!engine)
return IsNotSupported;
return engine->supportsTypeAndCodecs(type, codecs);
}
示例3: supportsType
MediaPlayer::SupportsType MediaPlayer::supportsType(const ContentType& contentType)
{
String type = contentType.type().lower();
String typeCodecs = contentType.parameter(codecs());
// 4.8.10.3 MIME types - The canPlayType(type) method must return the empty string if type is a type that the
// user agent knows it cannot render or is the type "application/octet-stream"
if (type == applicationOctetStream())
return IsNotSupported;
MediaPlayerFactory* engine = bestMediaEngineForTypeAndCodecs(type, typeCodecs);
if (!engine)
return IsNotSupported;
return engine->supportsTypeAndCodecs(type, typeCodecs);
}