diff options
author | Andrei Popescu <andreip@google.com> | 2009-10-06 14:44:10 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-10-14 16:53:30 +0100 |
commit | 7da6c11f9b0356ea2b070f6114d2005cbc2c43bb (patch) | |
tree | 6c8649623c4c1fcbd9bc4db0ced1887e498bdeb7 | |
parent | 25323377ad937254493c5d3d3454a655e508fcec (diff) | |
download | external_webkit-7da6c11f9b0356ea2b070f6114d2005cbc2c43bb.zip external_webkit-7da6c11f9b0356ea2b070f6114d2005cbc2c43bb.tar.gz external_webkit-7da6c11f9b0356ea2b070f6114d2005cbc2c43bb.tar.bz2 |
Remove the Android guards added to the <video> implementation in WebCore. Do not merge.
The patch in https://bugs.webkit.org/show_bug.cgi?id=29133 landed.
This has already been submitted to master branch.
-rw-r--r-- | WebCore/html/HTMLMediaElement.cpp | 13 | ||||
-rw-r--r-- | WebCore/html/HTMLMediaElement.h | 2 | ||||
-rw-r--r-- | WebCore/platform/graphics/MediaPlayer.cpp | 19 | ||||
-rw-r--r-- | WebCore/platform/graphics/MediaPlayer.h | 5 | ||||
-rw-r--r-- | WebCore/platform/graphics/MediaPlayerPrivate.h | 5 |
5 files changed, 11 insertions, 33 deletions
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp index f98200d..401d79f 100644 --- a/WebCore/html/HTMLMediaElement.cpp +++ b/WebCore/html/HTMLMediaElement.cpp @@ -555,13 +555,11 @@ void HTMLMediaElement::loadResource(const KURL& url, ContentType& contentType) m_player->load(m_currentSrc, contentType); -#if PLATFORM(ANDROID) if (isVideo() && m_player->canLoadPoster()) { KURL posterUrl = static_cast<HTMLVideoElement*>(this)->poster(); if (!posterUrl.isEmpty()) m_player->setPoster(posterUrl); } -#endif if (renderer()) renderer()->updateFromElement(); @@ -1443,15 +1441,13 @@ PassRefPtr<TimeRanges> HTMLMediaElement::seekable() const bool HTMLMediaElement::potentiallyPlaying() const { - return !paused() && m_readyState >= HAVE_FUTURE_DATA && !endedPlayback() && !stoppedDueToErrors() && !pausedForUserInteraction(); + return m_readyState >= HAVE_FUTURE_DATA && couldPlayIfEnoughData(); } -#if PLATFORM(ANDROID) bool HTMLMediaElement::couldPlayIfEnoughData() const { return !paused() && !endedPlayback() && !stoppedDueToErrors() && !pausedForUserInteraction(); } -#endif bool HTMLMediaElement::endedPlayback() const { @@ -1534,12 +1530,9 @@ void HTMLMediaElement::updatePlayState() float time = currentTime(); if (m_lastSeekTime < time) m_playedTimeRanges->add(m_lastSeekTime, time); -#if PLATFORM(ANDROID) - } else if (couldPlayIfEnoughData() && playerPaused) { + } else if (couldPlayIfEnoughData() && playerPaused) m_player->prepareToPlay(); -#endif - } - + if (renderer()) renderer()->updateFromElement(); } diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h index 70b686e..9218ad6 100644 --- a/WebCore/html/HTMLMediaElement.h +++ b/WebCore/html/HTMLMediaElement.h @@ -227,9 +227,7 @@ private: bool endedPlayback() const; bool stoppedDueToErrors() const; bool pausedForUserInteraction() const; -#if PLATFORM(ANDROID) bool couldPlayIfEnoughData() const; -#endif float minTimeSeekable() const; float maxTimeSeekable() const; diff --git a/WebCore/platform/graphics/MediaPlayer.cpp b/WebCore/platform/graphics/MediaPlayer.cpp index 531c598..8792640 100644 --- a/WebCore/platform/graphics/MediaPlayer.cpp +++ b/WebCore/platform/graphics/MediaPlayer.cpp @@ -63,6 +63,7 @@ public: virtual void load(const String&) { } virtual void cancelLoad() { } + virtual void prepareToPlay() { } virtual void play() { } virtual void pause() { } @@ -104,14 +105,10 @@ public: virtual void paint(GraphicsContext*, const IntRect&) { } -#if PLATFORM(ANDROID) virtual bool canLoadPoster() const { return false; } virtual void setPoster(const String&) { } - virtual void prepareToPlay() { } -#endif #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) - virtual void setPoster(const String& /*url*/) { } virtual void deliverNotification(MediaPlayerProxyNotificationType) { } virtual void setMediaPlayerProxy(WebMediaPlayerProxy*) { } #endif @@ -259,30 +256,26 @@ void MediaPlayer::load(const String& url, const ContentType& contentType) m_private.set(createNullMediaPlayer(this)); } -#if PLATFORM(ANDROID) bool MediaPlayer::canLoadPoster() const { return m_private->canLoadPoster(); } -void MediaPlayer::prepareToPlay() -{ - m_private->prepareToPlay(); -} -#endif - -#if ENABLE(PLUGIN_PROXY_FOR_VIDEO) || PLATFORM(ANDROID) void MediaPlayer::setPoster(const String& url) { m_private->setPoster(url); } -#endif void MediaPlayer::cancelLoad() { m_private->cancelLoad(); } +void MediaPlayer::prepareToPlay() +{ + m_private->prepareToPlay(); +} + void MediaPlayer::play() { m_private->play(); diff --git a/WebCore/platform/graphics/MediaPlayer.h b/WebCore/platform/graphics/MediaPlayer.h index 8eade50..d0220ed 100644 --- a/WebCore/platform/graphics/MediaPlayer.h +++ b/WebCore/platform/graphics/MediaPlayer.h @@ -125,6 +125,7 @@ public: bool visible() const; void setVisible(bool); + void prepareToPlay(); void play(); void pause(); @@ -184,14 +185,10 @@ public: MediaPlayerClient* mediaPlayerClient() const { return m_mediaPlayerClient; } -#if PLATFORM(ANDROID) bool canLoadPoster() const; void setPoster(const String&); - void prepareToPlay(); -#endif #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) - void setPoster(const String& url); void deliverNotification(MediaPlayerProxyNotificationType notification); void setMediaPlayerProxy(WebMediaPlayerProxy* proxy); #endif diff --git a/WebCore/platform/graphics/MediaPlayerPrivate.h b/WebCore/platform/graphics/MediaPlayerPrivate.h index 109ad10..de7f75c 100644 --- a/WebCore/platform/graphics/MediaPlayerPrivate.h +++ b/WebCore/platform/graphics/MediaPlayerPrivate.h @@ -43,6 +43,7 @@ public: virtual void load(const String& url) = 0; virtual void cancelLoad() = 0; + virtual void prepareToPlay() { } virtual void play() = 0; virtual void pause() = 0; @@ -92,14 +93,10 @@ public: virtual void setAutobuffer(bool) { }; -#if PLATFORM(ANDROID) virtual bool canLoadPoster() const { return false; } virtual void setPoster(const String&) { } - virtual void prepareToPlay() { } -#endif #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) - virtual void setPoster(const String& url) = 0; virtual void deliverNotification(MediaPlayerProxyNotificationType) = 0; virtual void setMediaPlayerProxy(WebMediaPlayerProxy*) = 0; #endif |