@lucidweb/retro-webxr
v2.0.0
Published
A small layer to maintain backward compatibility of old projects in case of WebVR/WebXR API changes.
Downloads
1
Readme
@lucidweb/retro-webxr
Why?
It is not always possible to upgrade to the latest version without breaking changes. Handling breaking changes requires time and careful planning. This package aims to maintain a certain level of compatibility for past projects using previous versions of A-Frame.
What?
This package is bundled as an UMD bundle and expose one function, useRetroWebXR
which takes an Object
toggling compatibility flags.
Semantic versioning is used to make sure nothing breaks if there is a module API change.
Current flags
browser.requestDevice
: Aliasnavigator.xr.requestDevice
tonavigator.xr.requestSession
. Only for Chrome 79+aframe.assetItemGLBAsArrayBuffer
: Setresponse-type="arraybuffer"
ona-asset-item
when their src ends with.glb
How?
Install
npm install --save @lucidweb/retro-webxr
Use
CJS
const { useRetroWebXR } = require('@lucidweb/retro-webxr');
useRetroWebXR({
browser: {
requestDevice: true
},
aframe: {
assetItemGLBAsArrayBuffer: true
}
});
ES2015
import { useRetroWebXR } from '@lucidweb/retro-webxr';
useRetroWebXR({
browser: {
requestDevice: true
},
aframe: {
assetItemGLBAsArrayBuffer: true
}
});
window.RetroWebXR
<script type="text/javascript" src="https://unpkg.com/@lucidweb/retro-webxr@^2/dist/index.js"></script>
window.RetroWebXR.useRetroWebXR({
browser: {
requestDevice: true
},
aframe: {
assetItemGLBAsArrayBuffer: true
}
});