diff options
| author | Teng-Hui Zhu <ztenghui@google.com> | 2012-01-11 10:31:22 -0800 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-01-11 10:31:22 -0800 |
| commit | dd6c3b2bf081a084d44a33b59dddea1ca9eef03e (patch) | |
| tree | a09ddac74216032e2111888985feb9b28bd1e57e /Source/WebKit/android/WebCoreSupport | |
| parent | 3c3d37e22bc472db3c836a0d97e7467058f62c9e (diff) | |
| parent | 299925eb66dc094d5153fb4027be09bc13e139a0 (diff) | |
| download | external_webkit-dd6c3b2bf081a084d44a33b59dddea1ca9eef03e.zip external_webkit-dd6c3b2bf081a084d44a33b59dddea1ca9eef03e.tar.gz external_webkit-dd6c3b2bf081a084d44a33b59dddea1ca9eef03e.tar.bz2 | |
Merge "Native function to support restore the media player state"
Diffstat (limited to 'Source/WebKit/android/WebCoreSupport')
| -rw-r--r-- | Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp b/Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp index 339e91b..7a80925 100644 --- a/Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp +++ b/Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp @@ -168,6 +168,14 @@ void MediaPlayerPrivate::onEnded() m_networkState = MediaPlayer::Idle; } +void MediaPlayerPrivate::onRestoreState() +{ + if (!m_paused) { + //Kick off a JNI call to start the video. + play(); + } +} + void MediaPlayerPrivate::onPaused() { m_paused = true; @@ -570,6 +578,15 @@ static void OnTimeupdate(JNIEnv* env, jobject obj, int position, int pointer) } } +static void OnRestoreState(JNIEnv* env, jobject obj, int pointer) +{ + if (pointer) { + WebCore::MediaPlayerPrivate* player = reinterpret_cast<WebCore::MediaPlayerPrivate*>(pointer); + player->onRestoreState(); + } +} + + // This is called on the UI thread only. // The video layers are composited on the webkit thread and then copied over // to the UI thread with the same ID. For rendering, we are only using the @@ -632,6 +649,8 @@ static JNINativeMethod g_MediaPlayerMethods[] = { (void*) OnPaused }, { "nativeOnPosterFetched", "(Landroid/graphics/Bitmap;I)V", (void*) OnPosterFetched }, + { "nativeOnRestoreState", "(I)V", + (void*) OnRestoreState }, { "nativeSendSurfaceTexture", "(Landroid/graphics/SurfaceTexture;IIII)Z", (void*) SendSurfaceTexture }, { "nativeOnTimeupdate", "(II)V", |
