diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-07-09 06:39:44 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-07-09 06:39:44 -0700 |
commit | 77c0e7bfb36b8ff55042255fe9ab20a06cd71e5b (patch) | |
tree | c0b02042d57a214c9be6a24853502f34882dd955 | |
parent | 092781fb4111909137004effd195aa2fb5db75a1 (diff) | |
parent | df3ab7f9f53c31e752bbae79fdf32877c3f98f87 (diff) | |
download | external_webkit-77c0e7bfb36b8ff55042255fe9ab20a06cd71e5b.zip external_webkit-77c0e7bfb36b8ff55042255fe9ab20a06cd71e5b.tar.gz external_webkit-77c0e7bfb36b8ff55042255fe9ab20a06cd71e5b.tar.bz2 |
Merge change 6357
* changes:
Add fullscreen support back in.
-rw-r--r-- | WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp b/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp index 36304c1..2465e29 100644 --- a/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp +++ b/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp @@ -42,7 +42,6 @@ static const char* g_ProxyJavaClass = "android/webkit/HTML5VideoViewProxy"; struct MediaPlayerPrivate::JavaGlue { jobject m_javaProxy; - jobject m_videoView; jmethodID m_getInstance; jmethodID m_play; jmethodID m_createView; @@ -55,10 +54,8 @@ MediaPlayerPrivate::~MediaPlayerPrivate() if (m_glue->m_javaProxy) { JNIEnv* env = JSC::Bindings::getJNIEnv(); if (env) { - env->CallVoidMethod(m_glue->m_javaProxy, m_glue->m_removeView, - m_glue->m_videoView); + env->CallVoidMethod(m_glue->m_javaProxy, m_glue->m_removeView); env->DeleteGlobalRef(m_glue->m_javaProxy); - env->DeleteGlobalRef(m_glue->m_videoView); } } @@ -105,7 +102,7 @@ void MediaPlayerPrivate::play() WebViewCore* webViewCore = WebViewCore::getWebViewCore(frameView); ASSERT(webViewCore); jstring jUrl = env->NewString((unsigned short *)m_url.characters(), m_url.length()); - env->CallVoidMethod(m_glue->m_javaProxy, m_glue->m_play, jUrl, m_glue->m_videoView); + env->CallVoidMethod(m_glue->m_javaProxy, m_glue->m_play, jUrl); env->DeleteLocalRef(jUrl); checkException(env); } @@ -212,8 +209,7 @@ void MediaPlayerPrivate::paint(GraphicsContext*, const IntRect& r) IntSize size = m_player->size(); env->CallVoidMethod(m_glue->m_javaProxy, m_glue->m_attachView, - m_glue->m_videoView, r.x(), r.y(), size.width(), - size.height()); + r.x(), r.y(), size.width(), size.height()); } MediaPlayerPrivateInterface* MediaPlayerPrivate::create(MediaPlayer* player) @@ -242,12 +238,11 @@ MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player) : m_player(player), m_glue = new JavaGlue; m_glue->m_getInstance = env->GetStaticMethodID(clazz, "getInstance", "(Landroid/webkit/WebViewCore;)Landroid/webkit/HTML5VideoViewProxy;"); - m_glue->m_play = env->GetMethodID(clazz, "play", "(Ljava/lang/String;Landroid/webkit/ViewManager$ChildView;)V"); - m_glue->m_createView = env->GetMethodID(clazz, "createView", "(Landroid/webkit/WebViewCore;)Landroid/webkit/ViewManager$ChildView;"); - m_glue->m_attachView = env->GetMethodID(clazz, "attachView", "(Landroid/webkit/ViewManager$ChildView;IIII)V"); - m_glue->m_removeView = env->GetMethodID(clazz, "removeView", "(Landroid/webkit/ViewManager$ChildView;)V"); + m_glue->m_play = env->GetMethodID(clazz, "play", "(Ljava/lang/String;)V"); + m_glue->m_createView = env->GetMethodID(clazz, "createView", "()V"); + m_glue->m_attachView = env->GetMethodID(clazz, "attachView", "(IIII)V"); + m_glue->m_removeView = env->GetMethodID(clazz, "removeView", "()V"); m_glue->m_javaProxy = NULL; - m_glue->m_videoView = NULL; env->DeleteLocalRef(clazz); // An exception is raised if any of the above fails. checkException(env); @@ -256,7 +251,7 @@ MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player) : m_player(player), void MediaPlayerPrivate::createJavaPlayerIfNeeded() { // Check if we have been already created. - if (m_glue->m_videoView) + if (m_glue->m_javaProxy) return; FrameView* frameView = m_player->frameView(); @@ -274,16 +269,13 @@ void MediaPlayerPrivate::createJavaPlayerIfNeeded() WebViewCore* webViewCore = WebViewCore::getWebViewCore(frameView); ASSERT(webViewCore); - // Get the HTML4VideoViewProxy instance + // Get the HTML5VideoViewProxy instance jobject obj = env->CallStaticObjectMethod(clazz, m_glue->m_getInstance, webViewCore->getJavaObject().get()); m_glue->m_javaProxy = env->NewGlobalRef(obj); + // Create our VideoView object. + env->CallVoidMethod(obj, m_glue->m_createView); + // Clean up. env->DeleteLocalRef(obj); - - // Get our VideoView object. - obj = env->CallObjectMethod(obj, m_glue->m_createView, webViewCore->getJavaObject().get()); - m_glue->m_videoView = env->NewGlobalRef(obj); - env->DeleteLocalRef(obj); - env->DeleteLocalRef(clazz); checkException(env); } |