From 262f8b8647eccdbab77100edeb33aac3f5a46a13 Mon Sep 17 00:00:00 2001 From: Rik Cabanier Date: Mon, 3 Apr 2023 15:24:30 +0000 Subject: [PATCH] Add offersession example --- input-selection-2.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/input-selection-2.html b/input-selection-2.html index cccec0f..4c307d4 100644 --- a/input-selection-2.html +++ b/input-selection-2.html @@ -92,6 +92,15 @@ }); navigator.xr.requestSession('inline').then(onSessionStarted); + if (navigator.xr.offerSession !== undefined) { + navigator.xr.offerSession('immersive-vr', { + requiredFeatures: ['local-floor'] + }).then((session) => { + xrButton.setSession(session); + session.isImmersive = true; + onSessionStarted(session); + }); + } } }