安全上下文
此特征只可用于
安全上下文
(HTTPS),在某些或所有
支持浏览器
.
XRInputSourceArray
方法
values()
返回
JavaScript
iterator
that can walk over the list of
XRInputSource
objects contained in the array, from first to last.
xrInputSourceArray.values();
None.
A JavaScript
iterator
that can be used to walk through the list of
XRInputSource
objects in the array, starting with the first entry (at index 0) and proceeding straight through the list.
This example snippet walks through each input and calls the function
checkInput()
with each returned value.
for (const source of xrSession.inputSources.values()) {
checkInput(source);
}
这里,
for...of
is used to iterate over the array's contents. Each pass through the loop,
source
is the next
XRInputSource
in the list. The loop exits once every input has been delivered to
checkInput()
.
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebXR 设备 API
The definition of 'XRInputSourceArray' in that specification. 1 |
工作草案 |
XRInputSourceArray
interface
|
[1]
见
Iterator-like methods
in
Information contained in a WebIDL file
for information on how an
iterable
declaration in an interface definition causes
entries()
,
forEach()
,
keys()
,和
values()
methods to be exposed from objects that implement the interface.
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
值
|
Chrome 79 | Edge 79 | Firefox No | IE No | Opera No | Safari No | WebView Android No | Chrome Android 79 | Firefox Android No | Opera Android No | Safari iOS No | Samsung Internet Android 11.2 |
完整支持
不支持
XRInputSourceArray
Navigator.xr
WebGLRenderingContext.makeXRCompatible()
XR
XRBoundedReferenceSpace
XRFrame
XRInputSource
XRInputSourceEvent
XRInputSourcesChangeEvent
XRPose
XRReferenceSpace
XRReferenceSpaceEvent
XRRenderState
XRRigidTransform
XRSession
XRSessionEvent
XRSpace
XRView
XRViewerPose
XRViewport
XRWebGLLayer