From 9abcc8af97ee9c535e4d0995b564471b3866f9e4 Mon Sep 17 00:00:00 2001 From: Teng-Hui Zhu Date: Fri, 20 Jul 2012 14:03:14 -0700 Subject: Support autoplay attribute for media element, with optional gesture requirement. bug:6806306 Change-Id: I09a7494278be5631d64d125390559058682386d1 --- Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Source/WebKit') diff --git a/Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp b/Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp index c01d916..409eff6 100644 --- a/Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp +++ b/Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp @@ -315,6 +315,13 @@ public: m_naturalSize = IntSize(poster->width(), poster->height()); m_player->sizeChanged(); } + // At this time, we know that the proxy has been setup. And it is the + // right time to trigger autoplay through the HTMLMediaElement state + // change. Since we are using the java MediaPlayer, so we have to + // pretend that the MediaPlayer has enough data. + m_readyState = MediaPlayer::HaveEnoughData; + m_player->readyStateChanged(); + } void onPrepared(int duration, int width, int height) -- cgit v1.1