Skip to content

Commit f394e71

Browse files
authored
Call offerSession at session end time (#27368)
1 parent f7102ac commit f394e71

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

examples/jsm/webxr/ARButton.js

+7
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,13 @@ class ARButton {
104104

105105
currentSession.end();
106106

107+
if ( navigator.xr.offerSession !== undefined ) {
108+
109+
navigator.xr.offerSession( 'immersive-ar', sessionInit )
110+
.then( onSessionStarted );
111+
112+
}
113+
107114
}
108115

109116
};

examples/jsm/webxr/VRButton.js

+7
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ class VRButton {
7070

7171
currentSession.end();
7272

73+
if ( navigator.xr.offerSession !== undefined ) {
74+
75+
navigator.xr.offerSession( 'immersive-vr', sessionInit )
76+
.then( onSessionStarted );
77+
78+
}
79+
7380
}
7481

7582
};

examples/jsm/webxr/XRButton.js

+7
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ class XRButton {
7474

7575
currentSession.end();
7676

77+
if ( navigator.xr.offerSession !== undefined ) {
78+
79+
navigator.xr.offerSession( mode, sessionOptions )
80+
.then( onSessionStarted );
81+
82+
}
83+
7784
}
7885

7986
};

0 commit comments

Comments
 (0)