npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cordova-plugin-webxr

v1.17.5

Published

WebXR Plugin

Downloads

91

Readme

Cordova WebXR Plugin

Add augmented reality content to your app using the WebXR Device API (Mozilla's version).

This is intended to support the same content as Mozilla's iOS WebXR Viewer.

Installation

Install using the Apache Cordova command line:

cordova plugin add cordova-plugin-webxr

Try It Out

To quickly test some interactive AR content, set the default source in the project's config.xml to Mozilla's example site:

<content src="https://webxr-ios.webxrexperiments.com/" />

The source code for the examples can be found in Mozilla's webxr-ios-js repo

Options

The plugin provides a set of a configurable options:

  • WEBXR_AUTHORIZATION: Sets what is shared with a page that uses the WebXR API

    • denied: Shares no world sensing data & no video
    • minimal (default): Shares minimal world sensing data, but no video
    • lite: Shares one real world plane & enables face-based experiences, but no video
    • worldSensing: Shares full world sensing data, but no video
    • videoCameraAccess: Shares full world sensing data & video feed
  • GRAPHICS_FRAMEWORK: Specifies which graphics framework to use

    • sceneKit (default): Uses SceneKit
    • metal: Uses Metal (experimental)
  • CAMERA_USAGE_DESCRIPTION: Describes to user why camera access is required

    • Default: This app uses the camera for augmented reality

To set these options, specify them when adding the plugin, e.g:

cordova plugin add cordova-plugin-webxr --variable GRAPHICS_FRAMEWORK=metal

Or add them within the plugin's tag in config.xml, e.g:

<plugin name="cordova-plugin-webxr" spec="^1.17.0">
    <variable name="WEBXR_AUTHORIZATION" value="lite" />
</plugin>

NOTE: Mozilla WebXR ≠ W3C WebXR (yet)

Mozilla is in the process of aligning their version of the API with the official draft W3C spec. As such, some features are currently broken. This plugin will be updated as the API stabilizes.

Dependencies

  • iOS 12 / ARKit 2: The plugin only works with ARKit-compatible devices & requires an iOS Deployment Target ≥ 12.0. It will automatically set the project's target to 12.0, unless specified otherwise in config.xml.

  • Swift 4: The iOS source code assumes Swift 4.0. It will automatically install cordova-plugin-add-swift-support, if it is not already present.

  • WKWebView: The plugin requires WKWebView. It will automatically install cordova-plugin-wkwebview-engine, if not already in use.

Credits

This plugin is based on the source for Mozilla's WebXR Viewer (webxr-ios@f820224)