XRSession: end event - Web APIs 编辑
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 user agent terminated the session.
Bubbles | No |
---|---|
Cancelable | No |
Interface | XRSessionEvent |
Event handler | XRSession.onend |
Example
To be informed when a WebXR session comes to an end, you can add a handler to your XRSession
instance using addEventListener()
, like this:
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 */
}
Specifications
Specification | Status | Comment |
---|---|---|
WebXR Device API The definition of 'end event' in that specification. | Working Draft | Initial definition. |
Browser compatibility
BCD tables only load in the browser
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论