diff options
Diffstat (limited to 'WebCore/html/HTMLVideoElement.cpp')
-rw-r--r-- | WebCore/html/HTMLVideoElement.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/WebCore/html/HTMLVideoElement.cpp b/WebCore/html/HTMLVideoElement.cpp index a67db71..b0aac3c 100644 --- a/WebCore/html/HTMLVideoElement.cpp +++ b/WebCore/html/HTMLVideoElement.cpp @@ -52,27 +52,30 @@ bool HTMLVideoElement::rendererIsNeeded(RenderStyle* style) return HTMLElement::rendererIsNeeded(style); } +#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO) RenderObject* HTMLVideoElement::createRenderer(RenderArena* arena, RenderStyle*) { if (m_shouldShowPosterImage) return new (arena) RenderImage(this); return new (arena) RenderVideo(this); } +#endif void HTMLVideoElement::attach() { HTMLMediaElement::attach(); - + +#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO) if (m_shouldShowPosterImage) { if (!m_imageLoader) m_imageLoader.set(new HTMLImageLoader(this)); m_imageLoader->updateFromElement(); if (renderer() && renderer()->isImage()) { - RenderImage* imageRenderer = static_cast<RenderImage*>(renderer()); + RenderImage* imageRenderer = toRenderImage(renderer()); imageRenderer->setCachedImage(m_imageLoader->image()); } } - +#endif } void HTMLVideoElement::detach() @@ -91,9 +94,14 @@ void HTMLVideoElement::parseMappedAttribute(MappedAttribute* attr) if (attrName == posterAttr) { updatePosterImage(); if (m_shouldShowPosterImage) { +#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO) if (!m_imageLoader) m_imageLoader.set(new HTMLImageLoader(this)); m_imageLoader->updateFromElementIgnoringPreviousError(); +#else + if (m_player) + m_player->setPoster(poster()); +#endif } } else if (attrName == widthAttr) addCSSLength(attr, CSSPropertyWidth, attr->value()); @@ -163,12 +171,18 @@ const QualifiedName& HTMLVideoElement::imageSourceAttributeName() const void HTMLVideoElement::updatePosterImage() { +#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO) bool oldShouldShowPosterImage = m_shouldShowPosterImage; - m_shouldShowPosterImage = !poster().isEmpty() && m_networkState < LOADED_FIRST_FRAME; +#endif + + m_shouldShowPosterImage = !poster().isEmpty() && readyState() < HAVE_CURRENT_DATA; + +#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO) if (attached() && oldShouldShowPosterImage != m_shouldShowPosterImage) { detach(); attach(); } +#endif } } |