Reputation: 3819
I found many websites that suggests WebVR works on Chrome since version 56. I have Chrome v.62 working on a Samsung S8 (I even tried Chrome Canary which v65) and when I execute the simple sample code like this is one for instance:
https://github.com/mdn/webvr-tests/blob/master/basic-display-info/index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">
<title>VRStageParameters basic test</title>
</head>
<body>
<h1>VRStageParameters basic test</h1>
<p id='toto'></p>
</body>
<script>
var info = document.getElementById('toto');
var vrDisplay;
if(navigator.getVRDisplays) {
reportStageParams();
} else {
info.innerHTML = 'WebVR API not supported by this browser.'
}
function reportStageParams() {
info.innerHTML = 'IS WORKING SOMEHOW'
navigator.getVRDisplays().then(function(displays) {
vrDisplay = displays[0];
var stageParams = vrDisplay.stageParameters;
// stageParams is a VRStageParameters object
if(stageParams === null) {
info.textContent = 'Your VR Hardware does not support room-scale experiences.'
} else {
info.innerHTML = '<strong>Display stage parameters</strong>'
+ '<br>Sitting to standing transform: ' + stageParams.sittingToStandingTransform
+ '<br>Play area width (m): ' + stageParams.sizeX
+ '<br>Play area depth (m): ' + stageParams.sizeY
}
});
}
</script>
</html>
I keep getting the message WebVR API not supported by this browser.
?? I don't understand why. Can someone with experience setting up WebVR please tell me what I need to do in order to make it work? I use a recent phone, the latest version of the browser, so it almost seems like I need to activate WebVR somewhere in some settings but can't find anything on the web.
Upvotes: 0
Views: 633
Reputation: 3819
In fact this question was asked and already answers (to some extent):
How to enable WebVR on Google Chrome?
Strangely, this is really the first step in getting WebVR working and it's not explained in most tutorials and official websites on WebVR... so here is:
You need to go to chrome://flags
and then scroll down until you find WebVR specific features and enable the ones you want.
Upvotes: 2