<commit_before># OculusMobileSDKHeadTrackingWebVR

This project aims to provide a [WebVR API](https://mozvr.com/webvr-spec/) [(and the deprecated version](https://developer.mozilla.org/en-US/docs/Web/API/WebVR_API) shim/polyfill implementation that uses the [OculusMobileSDKHeadTracking](https://github.com/judax/OculusMobileSDKHeadTracking) implementation of a native [Crosswalk extension](https://github.com/judax/OculusMobileSDKHeadTrackingXWalkViewExtension) or [Cordova plugin](https://github.com/judax/cordova-plugin-oculusmobilesdkheadtracking.git). 

## Folder Structure

* **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.

# How to use it

**Disclaimer**

Crosswalk extensions and Cordova plugins are a great way to expose native functionalities through JavaScript for web application, but they fail to provide easy initialization of the native hooks in some scenarios. The WebVR API entry point is a function (`navigator.getVRDisplays` or the deprecated `navigator.getVRDevices`) in the navigator object that should be available once the web app is loaded. Crosswalk extensions need to reference the corresponding extension object at least once to be loaded (lazy initialization) in JavaScript, a requirement that does not match well with a function in the navigator object. On the other hand, Cordova plugins need the `deviceready` event to be fired to be sure that the plugin is availabel in the JavaScript side. These behaviours make it difficult to automatically inject a WebVR API shim to make it available out of the box for any WebVR application. I am still trying to overcome these limitations, but for now, I have only been able to find a solution by providing the WebVR API shim through a JavaScript file that the developer needs to include in his/her web application. 

In order to include the WebVR shim API, please, include the following line before any mention to the WebVR API itself (inside the head tag for exmaple).

```
<script src="OculusMovileSDKHeadTrackingWebVR.js"></script><commit_msg>Making markdown pretty ;)<commit_after># OculusMobileSDKHeadTrackingWebVR

This project aims to provide a [WebVR API](https://mozvr.com/webvr-spec/) [(and the deprecated version](https://developer.mozilla.org/en-US/docs/Web/API/WebVR_API) shim/polyfill implementation that uses the [OculusMobileSDKHeadTracking](https://github.com/judax/OculusMobileSDKHeadTracking) implementation of a native [Crosswalk extension](https://github.com/judax/OculusMobileSDKHeadTrackingXWalkViewExtension) or [Cordova plugin](https://github.com/judax/cordova-plugin-oculusmobilesdkheadtracking.git). 

## Folder Structure

* **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.

# How to use it

---
_Disclaimer_

Crosswalk extensions and Cordova plugins are a great way to expose native functionalities through JavaScript for web application, but they fail to provide easy initialization of the native hooks in some scenarios. The WebVR API entry point is a function (`navigator.getVRDisplays` or the deprecated `navigator.getVRDevices`) in the navigator object that should be available once the web app is loaded. Crosswalk extensions need to reference the corresponding extension object at least once to be loaded (lazy initialization) in JavaScript, a requirement that does not match well with a function in the navigator object. On the other hand, Cordova plugins need the `deviceready` event to be fired to be sure that the plugin is availabel in the JavaScript side. These behaviours make it difficult to automatically inject a WebVR API shim to make it available out of the box for any WebVR application. I am still trying to overcome these limitations, but for now, I have only been able to find a solution by providing the WebVR API shim through a JavaScript file that the developer needs to include in his/her web application. 
---

In order to include the WebVR shim API, please, include the following line before any mention to the WebVR API itself (inside the head tag for exmaple).

```
<script src="OculusMovileSDKHeadTrackingWebVR.js"></script>
{'fraction_non_alphanumeric': 0.05916629314208875, 'fraction_numerical': 0.0, 'mean_word_length': 5.3757142857142854, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2783478', 'n_tokens_mistral': 1166, 'n_tokens_neox': 1096, 'n_words': 560}