return result;
}
+
+struct WebViewCoreStaticMethods {
+ jmethodID m_supportsMimeType;
+} gWebViewCoreStaticMethods;
+
+// Check whether a media mimeType is supported in Android media framework.
+bool WebViewCore::supportsMimeType(const WebCore::String& mimeType) {
+ JNIEnv* env = JSC::Bindings::getJNIEnv();
+ jstring jMimeType = env->NewString(mimeType.characters(), mimeType.length());
+ jclass webViewCore = env->FindClass("android/webkit/WebViewCore");
+ bool val = env->CallStaticBooleanMethod(webViewCore,
+ gWebViewCoreStaticMethods.m_supportsMimeType, jMimeType);
+ checkException(env);
+ env->DeleteLocalRef(jMimeType);
+
+ return val;
+}
+
// ----------------------------------------------------------------------------
#define GET_NATIVE_VIEW(env, obj) ((WebViewCore*)env->GetIntField(obj, gWebViewCoreFields.m_nativeClass))
LOG_ASSERT(gWebViewCoreFields.m_webView,
"Unable to find android/webkit/WebViewCore.mWebView");
+ gWebViewCoreStaticMethods.m_supportsMimeType =
+ env->GetStaticMethodID(widget, "supportsMimeType", "(Ljava/lang/String;)Z");
+ LOG_ASSERT(gWebViewCoreStaticMethods.m_supportsMimeType == NULL,
+ "Could not find static method supportsMimeType from WebViewCore");
+
return jniRegisterNativeMethods(env, "android/webkit/WebViewCore",
gJavaWebViewCoreMethods, NELEM(gJavaWebViewCoreMethods));
}
// if there exists at least on WebViewCore instance then we return the
// application context, otherwise NULL is returned.
static jobject getApplicationContext();
+
+ // Check whether a media mimeType is supported in Android media framework.
+ static bool supportsMimeType(const WebCore::String& mimeType);
};
} // namespace android