The patch in https://bugs.webkit.org/show_bug.cgi?id=29133 landed.
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();
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
{
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();
}
bool endedPlayback() const;
bool stoppedDueToErrors() const;
bool pausedForUserInteraction() const;
-#if PLATFORM(ANDROID)
bool couldPlayIfEnoughData() const;
-#endif
float minTimeSeekable() const;
float maxTimeSeekable() const;
virtual void load(const String&) { }
virtual void cancelLoad() { }
+ virtual void prepareToPlay() { }
virtual void play() { }
virtual void pause() { }
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
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();
bool visible() const;
void setVisible(bool);
+ void prepareToPlay();
void play();
void pause();
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
virtual void load(const String& url) = 0;
virtual void cancelLoad() = 0;
+ virtual void prepareToPlay() { }
virtual void play() = 0;
virtual void pause() = 0;
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