Skip to content

Commit

Permalink
Call offerSession at session end time (mrdoob#27368)
Browse files Browse the repository at this point in the history
  • Loading branch information
cabanier authored and AdaRoseCannon committed Jan 15, 2024
1 parent d0a933a commit fa6f35b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/jsm/webxr/ARButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ class ARButton {

currentSession.end();

if ( navigator.xr.offerSession !== undefined ) {

navigator.xr.offerSession( 'immersive-ar', sessionInit )
.then( onSessionStarted );

}

}

};
Expand Down
7 changes: 7 additions & 0 deletions examples/jsm/webxr/VRButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ class VRButton {

currentSession.end();

if ( navigator.xr.offerSession !== undefined ) {

navigator.xr.offerSession( 'immersive-vr', sessionInit )
.then( onSessionStarted );

}

}

};
Expand Down
7 changes: 7 additions & 0 deletions examples/jsm/webxr/XRButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ class XRButton {

currentSession.end();

if ( navigator.xr.offerSession !== undefined ) {

navigator.xr.offerSession( mode, sessionOptions )
.then( onSessionStarted );

}

}

};
Expand Down

0 comments on commit fa6f35b

Please sign in to comment.