void RenderVideo::updatePlayer() { if (documentBeingDestroyed()) return; bool intrinsicSizeChanged; intrinsicSizeChanged = updateIntrinsicSize(); ASSERT_UNUSED(intrinsicSizeChanged, !intrinsicSizeChanged || !view().frameView().isInRenderTreeLayout()); MediaPlayer* mediaPlayer = videoElement().player(); if (!mediaPlayer) return; if (!videoElement().inActiveDocument()) { mediaPlayer->setVisible(false); return; } contentChanged(VideoChanged); IntRect videoBounds = videoBox(); mediaPlayer->setSize(IntSize(videoBounds.width(), videoBounds.height())); #if USE(HOLE_PUNCH_GSTREAMER) || USE(HOLE_PUNCH_EXTERNAL) IntRect windowRect = document().view()->contentsToScreen(absoluteBoundingBoxRect(true)); mediaPlayer->setPosition(IntPoint(windowRect.x(), windowRect.y())); #endif mediaPlayer->setVisible(true); mediaPlayer->setShouldMaintainAspectRatio(style().objectFit() != ObjectFitFill); }
void RenderVideo::updatePlayer() { if (documentBeingDestroyed()) return; updateIntrinsicSize(); MediaPlayer* mediaPlayer = videoElement().player(); if (!mediaPlayer) return; if (!videoElement().inActiveDocument()) { mediaPlayer->setVisible(false); return; } #if USE(ACCELERATED_COMPOSITING) contentChanged(VideoChanged); #endif IntRect videoBounds = videoBox(); mediaPlayer->setFrameView(&view().frameView()); mediaPlayer->setSize(IntSize(videoBounds.width(), videoBounds.height())); mediaPlayer->setVisible(true); mediaPlayer->setShouldMaintainAspectRatio(style().objectFit() != ObjectFitFill); }
void RenderVideo::updatePlayer() { MediaPlayer* mediaPlayer = player(); if (!mediaPlayer) return; if (!mediaElement()->inActiveDocument()) { mediaPlayer->setVisible(false); return; } IntRect videoBounds = videoBox(); mediaPlayer->setFrameView(document()->view()); mediaPlayer->setSize(IntSize(videoBounds.width(), videoBounds.height())); mediaPlayer->setVisible(true); }
void HTMLVideoElement::paintCurrentFrameInContext(GraphicsContext& context, const FloatRect& destRect) { MediaPlayer* player = HTMLMediaElement::player(); if (!player) return; player->setVisible(true); // Make player visible or it won't draw. player->paintCurrentFrameInContext(context, destRect); }
void RenderVideo::updatePlayer() { MediaPlayer* mediaPlayer = player(); if (!mediaPlayer) return; if (!mediaElement()->inActiveDocument()) { mediaPlayer->setVisible(false); return; } // FIXME: This doesn't work correctly with transforms. FloatPoint absPos = localToAbsolute(); IntRect videoBounds = videoBox(); videoBounds.move(absPos.x(), absPos.y()); mediaPlayer->setFrameView(document()->view()); mediaPlayer->setRect(videoBounds); mediaPlayer->setVisible(true); }
void RenderVideo::updatePlayer() { updateIntrinsicSize(); MediaPlayer* mediaPlayer = mediaElement()->player(); if (!mediaPlayer) return; if (!videoElement()->inActiveDocument()) { mediaPlayer->setVisible(false); return; } #if USE(ACCELERATED_COMPOSITING) contentChanged(VideoChanged); #endif IntRect videoBounds = videoBox(); mediaPlayer->setFrameView(document()->view()); mediaPlayer->setSize(IntSize(videoBounds.width(), videoBounds.height())); mediaPlayer->setVisible(true); }
void RenderVideo::updatePlayer() { MediaPlayer* mediaPlayer = player(); if (!mediaPlayer) return; Document* doc = document(); if (doc->inPageCache()) return; int x; int y; absolutePosition(x, y); IntRect videoBounds = videoBox(); videoBounds.move(x, y); mediaPlayer->setFrameView(doc->view()); mediaPlayer->setRect(videoBounds); mediaPlayer->setVisible(true); }