An
end
event is fired at an
XRSession
object when the WebXR session has ended, either because the web application has chosen to stop the session, or because the
用户代理
terminated the session.
| 冒泡 | No |
|---|---|
| 可取消 | No |
| 接口 |
XRSessionEvent
|
| Event handler |
XRSession.onend
|
To be informed when a WebXR session comes to an end, you can add a handler to your
XRSession
instance using
addEventListener()
,像这样:
XRSession.addEventListener("end", function(event) {
/* the session has shut down */
});
Alternatively, you can use the
XRSession.onend
event handler property to establish a handler for the
end
event:
XRSession.onend = function(event) {
/* the session has shut down */
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebXR 设备 API
The definition of 'end event' in that specification. |
工作草案 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
end
event
|
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 |
完整支持
不支持
XRSession
Navigator.xr
WebGLRenderingContext.makeXRCompatible()
XR
XRBoundedReferenceSpace
XRFrame
XRInputSource
XRInputSourceArray
XRInputSourceEvent
XRInputSourcesChangeEvent
XRPose
XRReferenceSpace
XRReferenceSpaceEvent
XRRenderState
XRRigidTransform
XRSessionEvent
XRSpace
XRView
XRViewerPose
XRViewport
XRWebGLLayer