This project aims to provide a WebVR API 1.0 (and the deprecated API version) shim/polyfill implementation that uses the OculusMobileSDKHeadTracking implementation of a native Crosswalk extension or Cordova plugin.
- js: The main library code: OculusMobileSDKHeadTrackingWebVR.js a shim of the WebVR API that uses the OculusMobileSDKHeadTracking native binding through a crosswalk extension or a cordova plugin.
- examples: Some examples that use the library.
The OculusMobileSDKHeadTrackingXWalkViewExtension project includes a test that automatically injects this file when a web page is being loaded. You can read on how to use the libray/test.
If you would like to create your own app, you could choose one of the following options:
- Inject the JS code yourself (similar to the test)
- Include the JS file in your web app before any other script.
<script src="OculusMovileSDKHeadTrackingWebVR.js"></script>
The polyfill does not override any pre-existing WebVR API by default. Check the Configuration section down below.
The polyfill can be configured and debugged with various options. The following are supported:
WebVRConfig = {
// This polyfill is active only if the WebVR API is not already present by default. This flag overrides any pre-existing WebVR API and forces the injection of the WebVR API using the native OculusMobileSDKHeadTracking extension object.
FORCE_ENABLE_VR: true, // Default: false.
// Enabled the deprecated WebVR API that still some code out there might need to use.
ENABLE_DEPRECATED_API: true, // Default: false.
}
- Add barrel distortion to the WebVR polyfill.
- OculusMobileSDKHeadTracking: The Oculus Mobile SDK head tracking handling basic library.
- OculusMobileSDKHeadTrackingCordovaPlugin: A Cordova plugin to expose the Oculus Mobile SDK Head Tracking in a JavaScript/browser based environment.
- OculusMobileSDKHeadTrackingXWalkViewExtension: A Crosswalk extension to expose the Oculus Mobile SDK Head Tracking in a JavaScript/browser based environment.