English中文

Fullscreen

用于使用标准全屏 API 的独立于浏览器的函数。 Browser-independent functions for working with the standard fullscreen API.
另见: See:

成员 Members

static readonly Cesium.Fullscreen.changeEventName : string

进入或退出全屏时触发的文档事件的名称。此事件名称旨在与 addEventListener 一起使用。在事件处理程序中,要确定浏览器是否处于全屏模式,请使用 The name of the event on the document that is fired when fullscreen is entered or exited. This event name is intended for use with addEventListener. In your event handler, to determine if the browser is in fullscreen mode or not, use Fullscreen#fullscreen.

static readonly Cesium.Fullscreen.element : object

当前全屏的元素(如果有)。要简单地检查浏览器是否处于全屏模式,请使用 The element that is currently fullscreen, if any. To simply check if the browser is in fullscreen mode or not, use Fullscreen#fullscreen.

static readonly Cesium.Fullscreen.enabled : boolean

确定浏览器是否允许元素全屏显示。例如,默认情况下,iframe 无法全屏显示,除非包含页面添加“allowfullscreen”属性(或带前缀的等效属性)。 Determine whether the browser will allow an element to be made fullscreen, or not. For example, by default, iframes cannot go fullscreen unless the containing page adds an "allowfullscreen" attribute (or prefixed equivalent).

static readonly Cesium.Fullscreen.errorEventName : string

发生全屏错误时触发的事件的名称。此事件名称旨在与 addEventListener 一起使用。 The name of the event that is fired when a fullscreen error occurs. This event name is intended for use with addEventListener.

static readonly Cesium.Fullscreen.fullscreen : boolean

确定浏览器当前是否处于全屏模式。 Determines if the browser is currently in fullscreen mode.

方法 Methods

static Cesium.Fullscreen.exitFullscreen()

异步退出全屏模式。如果浏览器当前未处于全屏状态,或者浏览器不支持全屏模式,则不执行任何操作。 Asynchronously exits fullscreen mode. If the browser is not currently in fullscreen, or if fullscreen mode is not supported by the browser, does nothing.

static Cesium.Fullscreen.requestFullscreen(element, vrDevice)

异步请求浏览器在给定元素上进入全屏模式。如果浏览器不支持全屏模式,则不执行任何操作。 Asynchronously requests the browser to enter fullscreen mode on the given element. If fullscreen mode is not supported by the browser, does nothing.
名称 Name 类型 Type 说明 Description
element object 将置于全屏模式的 HTML 元素。 The HTML element which will be placed into fullscreen mode.
vrDevice object 可选 optional HMDVRDevice 设备。 The HMDVRDevice device.
示例: Example:
// Put the entire page into fullscreen.
Cesium.Fullscreen.requestFullscreen(document.body)

// Place only the Cesium canvas into fullscreen.
Cesium.Fullscreen.requestFullscreen(scene.canvas)

static Cesium.Fullscreen.supportsFullscreen()boolean

检测浏览器是否支持标准全屏API。 Detects whether the browser supports the standard fullscreen API.
返回: Returns:
true 如果浏览器支持标准全屏 API, if the browser supports the standard fullscreen API, false otherwise.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.