All Projects → immersive-web → webvr-polyfill-dpdb

immersive-web / webvr-polyfill-dpdb

Licence: Apache-2.0 License
An up-to-date Device Parameter Database for the WebVR Polyfill

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to webvr-polyfill-dpdb

Webvr Polyfill
Use WebVR today, without requiring a special browser build.
Stars: ✭ 1,343 (+4531.03%)
Mutual labels:  polyfill, webvr
Webxr Polyfill
Use the WebXR Device API today, providing fallbacks to native WebVR 1.1 and Cardboard
Stars: ✭ 251 (+765.52%)
Mutual labels:  polyfill, webvr
cardboard-vr-display
A JavaScript implementation of a WebVR 1.1 VRDisplay
Stars: ✭ 84 (+189.66%)
Mutual labels:  polyfill, webvr
camp
Building generative VR worlds on the Web
Stars: ✭ 16 (-44.83%)
Mutual labels:  webvr
NetStandardPolyfills
Type and Reflection polyfill extension methods. .NET 3.5+ and .NET Standard 1.0+.
Stars: ✭ 22 (-24.14%)
Mutual labels:  polyfill
aframe-cubemap-component
A component for creating a skybox with a cubemap in A-Frame.
Stars: ✭ 61 (+110.34%)
Mutual labels:  webvr
webvr
Archival repository for the legacy WebVR Specification.
Stars: ✭ 13 (-55.17%)
Mutual labels:  webvr
github-wc-polyfill
Ensure that all GitHub and GitLab scripts required for UXP and SeaMonkey are loaded correctly
Stars: ✭ 87 (+200%)
Mutual labels:  polyfill
scoped
Scoped CSS polyfill
Stars: ✭ 67 (+131.03%)
Mutual labels:  polyfill
async generator
Making it easy to write async iterators in Python 3.5
Stars: ✭ 87 (+200%)
Mutual labels:  polyfill
o9n
🖥 A screen.orientation ponyfill
Stars: ✭ 55 (+89.66%)
Mutual labels:  polyfill
appHistory
A polyfill for the AppHistory proposal
Stars: ✭ 21 (-27.59%)
Mutual labels:  polyfill
audioworklet-polyfill
strictly unofficial polyfill for Web Audio API AudioWorklet
Stars: ✭ 49 (+68.97%)
Mutual labels:  polyfill
aframe-colorwheel-component
A-Frame Colorwheel. Based on A-Painter and A-Frame Material 🎨🅰
Stars: ✭ 16 (-44.83%)
Mutual labels:  webvr
String.prototype.matchAll
Spec-compliant polyfill for String.prototype.matchAll, in ES2020
Stars: ✭ 14 (-51.72%)
Mutual labels:  polyfill
three-onEvent
Add an EventListener for Object3d in your three.js project.(support click,hover or gaze)
Stars: ✭ 55 (+89.66%)
Mutual labels:  webvr
mini-create-react-context
(A smaller) polyfill for the react context API
Stars: ✭ 34 (+17.24%)
Mutual labels:  polyfill
embedding
Embedding data into immersive environments
Stars: ✭ 26 (-10.34%)
Mutual labels:  webvr
aframe-mirror-component
Mirror effect material that works with snapshots of the scene for A-Frame
Stars: ✭ 29 (+0%)
Mutual labels:  webvr
Array.prototype.at
An ES-spec-compliant (proposed) `Array.prototype.at`shim/polyfill/replacement that works as far down as ES3.
Stars: ✭ 20 (-31.03%)
Mutual labels:  polyfill

webvr-polyfill-dpdb

Build Status (Travis CI) Package Info (npm)

This is a fork of the online cache of the Device Parameter Database (DPDB) for the webvr-polyfill.

Adding a Device

You'll need to update dpdb-formatted.json with your device's information in the following format:

{
  "devices": [
    {
      "type": "android",
      "rules": [
        {
          "mdmh": "asus/*/ASUS_Z00AD/*"
        },
        {
          "ua": "ASUS_Z00AD"
        }
      ],
      "dpi": [
        403,
        404.6
      ],
      "bw": 3,
      "ac": 1000
    }
  ]
}
  • type: Either "android" or "ios".
  • rules: An array of various rules that must be satisfied in order to use the configuration. See the Rules section below.
  • dpi: The DPI of the device's screen, either as a scalar value or as an array of X and Y DPI. Get this information via the Device Info App and look for Actual DPI X and Actual DPI Y values.
  • bw: The bezel width in millimeters, with many phones having between 3 or 4mm bezel widths. See the Calculating Bezel Width section below.
  • ac: The accuracy of this entry. This is not currently used in webvr-polyfill, but may in the future, and used to settle discrepencies between device reported information versus DPDB data, although this is more for Android apps that have may potentially have access to both API reporting and DPDB results. Can be one of the following values:
    • 0: measurements are speculative. Use as fallback only.
    • 500: measurements are based on the device's self-reported values, which is often inaccurate. Unless you're physically measuring a device, this is probably the value to use.
    • 1000: measurements are based on measuring a physical device.

Rules

The rules entry is an array of objects, each with one key/value pair, and matches if any of the rules match the device.

User-Agent

The ua rule is matched with the device's User-Agent string. It is not a regular expression, but just a simple substring match. Go to useragentstring.com and find something unique that looks like the device's name. Use this if device type is "android". Keep in mind of other models, where a string for the Nexus 5 could match the Nexus 5X, hence a string like "Nexus 5 " (note the extra space).

  { "ua": "ASUS_Z00AD" }

MDMH

The mdmh rule matches a device based on manufacturer, device, model, and hardware, as reported by the device's Android API. This rule is only applicable to Android devices running native apps, not the web.

  { "mdmh": "asus/*/ASUS_Z00AD/*" }

Resolution

The res rule matches a device based on its exact pixel resolution. This should normally only be used on iOS devices because there's a 1:1 mapping between exact resolution and phone model.

  { "res": [640, 960] }

Calculating Bezel Width

You can calculate the exact bezel width using this formula, where deviceWidth is in millimeters, screen is the screen's diagonal length in millimeters, and ratio is the screen resolution's width / height:

(deviceWidth - Math.sqrt((screen * screen) / (1 + (1 / (ratio * ratio))))) / 2;

Scripts

To generate the dpdb.json file from the dpdb-formatted.json source file, run this npm script from the command line:

npm run build

Or call this Node script directly:

node scripts/build.js --write

Change Log

The following devices were added (and/or corrections made):

2020-12-16

2019-11-09

2019-04-25

2019-02-19

2018-12-10

2018-10-17

2018-03-14

2018-02-07

2018-01-19

2017-10-12

2017-09-12

2017-08-27

2017-07-09

2017-06-01

2017-05-22

2017-01-19

  • Added format key to avoid 'unexpected format version' error (thanks to AdrienPoupa for spotting this oversight)

2017-01-12

2017-01-06

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].