OSDN Git Service

Remove the Android guards added to the <video> implementation in WebCore. Do not...
authorAndrei Popescu <andreip@google.com>
Tue, 6 Oct 2009 13:44:10 +0000 (14:44 +0100)
committerSteve Block <steveblock@google.com>
Wed, 14 Oct 2009 15:53:30 +0000 (16:53 +0100)
The patch in https://bugs.webkit.org/show_bug.cgi?id=29133 landed.

This has already been submitted to master branch.

WebCore/html/HTMLMediaElement.cpp
WebCore/html/HTMLMediaElement.h
WebCore/platform/graphics/MediaPlayer.cpp
WebCore/platform/graphics/MediaPlayer.h
WebCore/platform/graphics/MediaPlayerPrivate.h

index f98200d..401d79f 100644 (file)
@@ -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();
 }
index 70b686e..9218ad6 100644 (file)
@@ -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;
index 531c598..8792640 100644 (file)
@@ -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();
index 8eade50..d0220ed 100644 (file)
@@ -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
index 109ad10..de7f75c 100644 (file)
@@ -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