本文整理汇总了C++中HTMLMediaElement::isFullscreen方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLMediaElement::isFullscreen方法的具体用法?C++ HTMLMediaElement::isFullscreen怎么用?C++ HTMLMediaElement::isFullscreen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLMediaElement
的用法示例。
在下文中一共展示了HTMLMediaElement::isFullscreen方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: additionalCompositingReasons
CompositingReasons RenderVideo::additionalCompositingReasons() const
{
if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled()) {
HTMLMediaElement* media = toHTMLMediaElement(node());
if (media->isFullscreen())
return CompositingReasonVideo;
}
if (shouldDisplayVideo() && supportsAcceleratedRendering())
return CompositingReasonVideo;
return CompositingReasonNone;
}
示例2: shouldShowFullscreenButton
static bool shouldShowFullscreenButton(const HTMLMediaElement& mediaElement)
{
// Unconditionally allow the user to exit fullscreen if we are in it
// now. Especially on android, when we might not yet know if
// fullscreen is supported, we sometimes guess incorrectly and show
// the button earlier, and we don't want to remove it here if the
// user chose to enter fullscreen. crbug.com/500732 .
if (mediaElement.isFullscreen())
return true;
if (!mediaElement.hasVideo())
return false;
if (!Fullscreen::fullscreenEnabled(mediaElement.document()))
return false;
return true;
}
示例3: makeOpaque
void MediaControlPanelElement::makeOpaque()
{
HTMLMediaElement* mediaElement = toParentMediaElement(this);
if(mediaElement && mediaElement->isFullscreen()){
return;
}
if (m_opaque)
return;
setInlineStyleProperty(CSSPropertyTransitionProperty, CSSPropertyOpacity);
setInlineStyleProperty(CSSPropertyTransitionDuration, fadeInDuration, CSSPrimitiveValue::CSS_S);
setInlineStyleProperty(CSSPropertyOpacity, 1.0, CSSPrimitiveValue::CSS_NUMBER);
m_opaque = true;
if (m_isDisplayed)
show();
}
示例4: showContextMenu
void ContextMenuClientImpl::showContextMenu(const WebCore::ContextMenu* defaultMenu)
{
// Displaying the context menu in this function is a big hack as we don't
// have context, i.e. whether this is being invoked via a script or in
// response to user input (Mouse event WM_RBUTTONDOWN,
// Keyboard events KeyVK_APPS, Shift+F10). Check if this is being invoked
// in response to the above input events before popping up the context menu.
if (!m_webView->contextMenuAllowed())
return;
HitTestResult r = m_webView->page()->contextMenuController().hitTestResult();
LocalFrame* selectedFrame = r.innerNodeFrame();
WebContextMenuData data;
IntPoint mousePoint = selectedFrame->view()->contentsToWindow(r.roundedPointInInnerNodeFrame());
// FIXME(bokan): crbug.com/371902 - We shouldn't be making these scale
// related coordinate transformatios in an ad hoc way.
PinchViewport& pinchViewport = selectedFrame->host()->pinchViewport();
mousePoint -= flooredIntSize(pinchViewport.visibleRect().location());
mousePoint.scale(m_webView->pageScaleFactor(), m_webView->pageScaleFactor());
data.mousePosition = mousePoint;
// Compute edit flags.
data.editFlags = WebContextMenuData::CanDoNone;
if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canUndo())
data.editFlags |= WebContextMenuData::CanUndo;
if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canRedo())
data.editFlags |= WebContextMenuData::CanRedo;
if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canCut())
data.editFlags |= WebContextMenuData::CanCut;
if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canCopy())
data.editFlags |= WebContextMenuData::CanCopy;
if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canPaste())
data.editFlags |= WebContextMenuData::CanPaste;
if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canDelete())
data.editFlags |= WebContextMenuData::CanDelete;
// We can always select all...
data.editFlags |= WebContextMenuData::CanSelectAll;
data.editFlags |= WebContextMenuData::CanTranslate;
// Links, Images, Media tags, and Image/Media-Links take preference over
// all else.
data.linkURL = r.absoluteLinkURL();
if (isHTMLCanvasElement(r.innerNonSharedNode())) {
data.mediaType = WebContextMenuData::MediaTypeCanvas;
} else if (!r.absoluteImageURL().isEmpty()) {
data.srcURL = r.absoluteImageURL();
data.mediaType = WebContextMenuData::MediaTypeImage;
data.mediaFlags |= WebContextMenuData::MediaCanPrint;
} else if (!r.absoluteMediaURL().isEmpty()) {
data.srcURL = r.absoluteMediaURL();
// We know that if absoluteMediaURL() is not empty, then this
// is a media element.
HTMLMediaElement* mediaElement = toHTMLMediaElement(r.innerNonSharedNode());
if (isHTMLVideoElement(*mediaElement))
data.mediaType = WebContextMenuData::MediaTypeVideo;
else if (isHTMLAudioElement(*mediaElement))
data.mediaType = WebContextMenuData::MediaTypeAudio;
if (mediaElement->error())
data.mediaFlags |= WebContextMenuData::MediaInError;
if (mediaElement->paused())
data.mediaFlags |= WebContextMenuData::MediaPaused;
if (mediaElement->muted())
data.mediaFlags |= WebContextMenuData::MediaMuted;
if (mediaElement->loop())
data.mediaFlags |= WebContextMenuData::MediaLoop;
if (mediaElement->supportsSave())
data.mediaFlags |= WebContextMenuData::MediaCanSave;
if (mediaElement->hasAudio())
data.mediaFlags |= WebContextMenuData::MediaHasAudio;
// Media controls can be toggled only for video player. If we toggle
// controls for audio then the player disappears, and there is no way to
// return it back. Don't set this bit for fullscreen video, since
// toggling is ignored in that case.
if (mediaElement->hasVideo() && !mediaElement->isFullscreen())
data.mediaFlags |= WebContextMenuData::MediaCanToggleControls;
if (mediaElement->controls())
data.mediaFlags |= WebContextMenuData::MediaControls;
} else if (isHTMLObjectElement(*r.innerNonSharedNode()) || isHTMLEmbedElement(*r.innerNonSharedNode())) {
RenderObject* object = r.innerNonSharedNode()->renderer();
if (object && object->isWidget()) {
Widget* widget = toRenderWidget(object)->widget();
if (widget && widget->isPluginContainer()) {
data.mediaType = WebContextMenuData::MediaTypePlugin;
WebPluginContainerImpl* plugin = toWebPluginContainerImpl(widget);
WebString text = plugin->plugin()->selectionAsText();
if (!text.isEmpty()) {
data.selectedText = text;
data.editFlags |= WebContextMenuData::CanCopy;
}
data.editFlags &= ~WebContextMenuData::CanTranslate;
data.linkURL = plugin->plugin()->linkAtPosition(data.mousePosition);
if (plugin->plugin()->supportsPaginatedPrint())
data.mediaFlags |= WebContextMenuData::MediaCanPrint;
HTMLPlugInElement* pluginElement = toHTMLPlugInElement(r.innerNonSharedNode());
//.........这里部分代码省略.........