I try add webVR Extension using viewer API.
There is no error on console, but the webVRicon is not displayed.
How to load webVR Extension.
It's My source code:
HTML:
<link rel="stylesheet" href="https://developer.api.autodesk.com/viewingservice/v1/viewers/style.min.css?v=2.13" type="text/css">
<script src="https://developer.api.autodesk.com/viewingservice/v1/viewers/viewer3D.js?v=2.13"></script>
JS:
var viewerElement = document.getElementById("viewerMain");
view = new Autodesk.Viewing.Private.GuiViewer3D(viewerElement, {});
view.loadExtension("Autodesk.Viewing.WebVR");
I'm using GoogleChrome/FF.
For a developer using Forge viewer, there is nothing more than just adding the following code to load the WebVR extension:
view.loadExtension("Autodesk.Viewing.WebVR");
Your code should be all good for the initial webvr experience, the reason why the WebVRIcon does not show is because the desktop Chrome does not support WebVR by default, you can check the WebVR extension script for the detail, or you can check this website [http://www.createwebvr.com][1] for all the supported browser.
I have deployed a website https://viewervr.herokuapp.com/ with WebVR extension enabled, you can open the link within your mobile phone to check how it works.
Related
I am trying to create a WebVR scene. For this task, I want to enable WebVR on Google Chrome. My OS is Windows 8.
I open flags using chrome://flags/. WebVR is not there. How can I enable it?
Official channels of Google Chrome do not support WebVR. (now they do, see below)
There is an unofficial build of chrome that does. FYI Firefox Nightly also supports WebVR in their official and current release, as does Samsung Internet Beta for GearVR (the latter after some configuration).
UPDATE: Chrome Android now works with WebVR if you enable chrome://flags/#enable-webvr. See this manual on how to enable WebVR on different browsers.
You can install Google Chrome extension for WebVR debugging
It can really help to debug your VR application.
You will be able change the position of the virtual device in the environment, to see the change of camera position.
Also, it is possible to emulate the HTC Vive controllers.
Alternative is to use WebVR polyfill
It adds WebVR-API to your browser.
Currently you can test your sample webVR code on the following browsers :
Google Chromium
Firefox Nightly
Samsung browser for webVR
Google Chrome version 54.0 onwards was expected to support webVR, but it seems we have to wait a little more.
If you are not very comfortable with ThreeJS library for VR projects, you should try aframe framework ( check http://aframe.io ). Here you will focus only on the VR code flow and all other graphics related overheads (camera, rendering etc) will be taken care by aframe itself.
Do you still need this special Chromium build?
In latest Chrome #58 it seems the feature is available within chrome://flags now
WebVR Mac, Windows, Linux, Chrome OS, Android Enabling this option
allows web applications to access experimental Virtual Reality APIs.
#enable-webvr
Didnt try it out yet though (dont want to break my productive browser)
Greetz
I'm deploying my app and I have a dashboard implemented with Chart.js. When I tested my app in standard way, the dashboard works fine, but opening my app through a Google Chrome shortcut (within a window) the charts doesn't work. Just charts doesn't work in Chrome window mode.
The problem occurs in Windows 7, when I open the app directly from the shortcut, the charts doesn't work, but if I open the Google Chrome, and then open the app using the shortcut, the charts works fine.
Someone have an idea about that?
Thanks.
You'll need to look in the developer tools console to see if your getting any errors in your app. A fairly likely culprit is that you are including scripts within your html page. Chrome apps require that all scripts are external to your html and referenced using something like
<script src="path/to/your/script.js">
You'll have to do some DOM manipulation in your script file to add the charts to your page.
I'm trying to load the native messaging example app in an external webpage as follows:
test.html
<html>
<head>
</head>
<body>
<iframe src="chrome-extension://knldjmfmopnpolahpmmgbagdohdnhkik/main.html"</iframe>
</body>
</html>
I have added the web_accessible_resources property in the app's manifest:
manifest.json
{
// <some code snipped>
"web_accessible_resources": ["main.html"]
}
However, when I use the app within test.html, I get the following error in the console, coming from a JavaScript file within the app:
Developer Console
Uncaught TypeError: Object # has no method 'connectNative'
main.js:51
The problematic line of code is the following:
main.js
port = chrome.runtime.connectNative(hostName);
Here's a screenshot - the problem happens when I click on the Connect button (which calls the connect function):
Obviously, this works when the app is run standalone. How can I go about loading the app in a webpage?
You can't. With very few exceptions, Chrome avoids proprietary extensions to the open web. You're asking for exactly that: an external web page that has nonstandard abilities simply because it's opened in Chrome rather than another browser. As the web is today, that kind of behavior would lead to a poor developer and user experience. The native-messaging documentation suggests that the functionality you want is available to Chrome extensions and Chrome apps. And as you're finding out, that's indeed the case: it works as an app, but not as a web-standard iframe. This is by design.
You probably want to write a Chrome extension. Your webpage should detect whether the Chrome extension is installed and whether the user's browser is Chrome. If it's not Chrome, it should give an appropriate error message. If it is Chrome but the extension is not installed, it should urge the user to install your extension.
I wish to make a link in my mobile website that will trigger a location based application (as waze or google maps) to open in location.
the following html code:
go to location
working great with android browsers, but not working with iphone (using safari or chrome)
How can it be done to work with iphone/ipad browsers?
To open google maps on ios you have to use a specific url scheme (specific for each application, if provided) for example the following will call google maps :
comgooglemaps://?daddr=%f,%f&saddr=%f,%f&mrsp=0&ht=it&ftr=0", contactPosition.latitude, contactPosition.longitude, myPosition.latitude, myPosition.longitude
and this wil open waze :
waze://?ll=37.331689,-122.030731&navigate=yes
In both cases to have this working the user, obviously, should have the apps installed.
Downloaded the NPAPI hello-world plugin from https://github.com/axgle/npapi-chrome-plugin-helloworld and packaged it as a chrome extension (crx) using Chrome developer mode.
Loaded the above extension in chrome browser and tried to open test.html (provided with above plugin) in chrome browser. But it says "Could not load plugin"
Below is the source code of test.html
<doctype html>
<html>
<head>
<script>
window.onload = function(){
test = document.getElementById("pluginObj");
alert(test.sayHello());
}
</script>
</head>
<embed id="pluginObj" type="application/x-helloworld">
<body></body>
</html>
As per my validation, plugin is getting embedded (since on altering test it gives HTML document object) but unable to invoke sayHello method of the plugin.
However when I tried to load the above extension in another PC over there it loaded properly and was able to invoke sayHello method of the plugin.
Both systems have same OS (Windows XP + SP3) and both are using same version of chrome browser (23.0.1271.97 m)
Appreciate any help on this front.
When you added it to the CRX did you mark it public? If you don't it won't be visible outside of the extension.
See the relevant docs
Here is another relevant question: Google Chrome Extensions and NPAPI