From 4a3543a3e708f76c6b58ef72a1eecb783982bc9f Mon Sep 17 00:00:00 2001 From: Brandon Jones Date: Fri, 21 Jul 2017 16:02:56 -0700 Subject: [PATCH] Remove the navigation event from the explainer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Requested by @NellWaliczek. This is for the sake of clarifying things for TAG review if we don’t get a better solution in place before they look at the explainer, since we know this ISN’T the right way to handle this. Ideally we’ll put it back in with #256 or a similar PR. --- explainer.md | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/explainer.md b/explainer.md index 47f5bd6d..5915b3a4 100644 --- a/explainer.md +++ b/explainer.md @@ -515,27 +515,6 @@ vrSession.addEventListener('resetpose', vrSessionEvent => { }); ``` -### Page navigation - -WebVR applications can, like any web page, link to other pages. In the context of a VR scene this is handled by setting `window.location` to the desired URL when the user performs some action. If the page being linked to is not VR-capable the user will either have to remove the VR device to view it (which the UA should explicitly instruct them to do) or the page could be shown as a 2D page in a VR browser. - -If the page being navigated to is VR capable, however, it's frequently desirable to allow the user to immediately begin using a VR session for that page as well, so that the user feels as though they are navigating through a single continuous VR experience. To achieve this the page can handle the `navigate` event, fired on the `navigator.vr` object. This event provides a `VRSession` for the `VRDevice` that the previous page was presenting to. - -The `VRDevice` and `VRSession` must not retain any state set by the previous page, and need not make any guarantees about consistency of pose data between pages. They should maintain the same general implementation between pages for basic usage consistency. For example: The user agent should not switch users from the Oculus SDK to OpenVR between pages, or from Daydream to Cardboard, even though in both cases the users device could technically be used with either. - -To indicate to indicate that you wish to continue presenting VR content on this page the handler must call `event.preventDefault()`. - -```js -navigator.vr.addEventListener('navigate', vrSessionEvent => { - vrSessionEvent.preventDefault(); - vrSession = vrSessionEvent.session; - vrDevice = vrSession.device; - - // Ensure content is loaded and begin drawing. - onDrawFrame(); -}); -``` - ## Appendix A: I don’t understand why this is a new API. Why can’t we use… ### `DeviceOrientation` Events @@ -578,7 +557,6 @@ partial interface Navigator { interface VR : EventTarget { attribute EventHandler ondeviceconnect; attribute EventHandler ondevicedisconnect; - attribute EventHandler onnavigate; Promise> getDevices(); };