提交 65697bbe 编写于 作者: M Mr.doob

WebVR: getVRDisplays() returns [] in Android if Chrome VR Services is not installed.

上级 30003955
......@@ -109,18 +109,27 @@ var WEBVR = {
button.style.fontStyle = 'normal';
button.style.textAlign = 'center';
button.style.zIndex = '999';
button.textContent = 'ENTER VR';
button.onclick = function () {
display.isPresenting ? display.exitPresent() : display.requestPresent( [ { source: canvas } ] );
if ( display ) {
};
button.textContent = 'ENTER VR';
button.onclick = function () {
window.addEventListener( 'vrdisplaypresentchange', function () {
display.isPresenting ? display.exitPresent() : display.requestPresent( [ { source: canvas } ] );
button.textContent = display.isPresenting ? 'EXIT VR' : 'ENTER VR';
};
}, false );
window.addEventListener( 'vrdisplaypresentchange', function () {
button.textContent = display.isPresenting ? 'EXIT VR' : 'ENTER VR';
}, false );
} else {
button.textContent = 'NO VR DISPLAY';
}
return button;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册