diff options
author | Teng-Hui Zhu <ztenghui@google.com> | 2012-05-25 10:10:14 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-05-25 10:10:14 -0700 |
commit | 2cb64bfb5132a7e48f6f425eccaf1db079b91ced (patch) | |
tree | 09bddcffff59619dae7e82550eedcb340ab924c0 /Source/WebKit | |
parent | 385ef015bf9d84a940d65586b9f70292f6b6fb63 (diff) | |
parent | efae67fdcaf0deed8019517a83fd03c536fc2584 (diff) | |
download | external_webkit-2cb64bfb5132a7e48f6f425eccaf1db079b91ced.zip external_webkit-2cb64bfb5132a7e48f6f425eccaf1db079b91ced.tar.gz external_webkit-2cb64bfb5132a7e48f6f425eccaf1db079b91ced.tar.bz2 |
Merge "Better support for HTML5 audio loop" into jb-dev
Diffstat (limited to 'Source/WebKit')
-rw-r--r-- | Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp b/Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp index 52aeb23..155b841 100644 --- a/Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp +++ b/Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp @@ -168,6 +168,11 @@ void MediaPlayerPrivate::onEnded() m_networkState = MediaPlayer::Idle; } +void MediaPlayerPrivate::onRequestPlay() +{ + play(); +} + void MediaPlayerPrivate::onRestoreState() { if (!m_paused) { @@ -545,6 +550,14 @@ static void OnEnded(JNIEnv* env, jobject obj, int pointer) } } +static void OnRequestPlay(JNIEnv* env, jobject obj, int pointer) +{ + if (pointer) { + WebCore::MediaPlayerPrivate* player = reinterpret_cast<WebCore::MediaPlayerPrivate*>(pointer); + player->onRequestPlay(); + } +} + static void OnPaused(JNIEnv* env, jobject obj, int pointer) { if (pointer) { @@ -662,6 +675,8 @@ static JNINativeMethod g_MediaAudioPlayerMethods[] = { (void*) OnEnded }, { "nativeOnPrepared", "(IIII)V", (void*) OnPrepared }, + { "nativeOnRequestPlay", "(I)V", + (void*) OnRequestPlay }, { "nativeOnTimeupdate", "(II)V", (void*) OnTimeupdate }, }; |