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 🙏

© 2026 – Pkg Stats / Ryan Hefner

openui5-camera

v0.0.11

Published

A pure javascript UI5 control that enables device's camera access and easy snapshots

Readme

OpenUI5-Camera

An UI5 control which uses the HTML5 media capture API to access the device's camera. The control renders a live camera preview and can take pictures when the users clicks/taps on it. This is a work in progress so feature set is still very basic.

Demo

Please check here

TODO

  • [ ] Add an optional button instead of clicking on the preview only
  • [ ] Allow the image format to be configurable
  • [ ] Allow an easy way to get the actual image pixels for manipulation
  • [ ] Configurable camera (front-facing vs back-facing)
  • [ ] Think about video and audio streams

Usage

To use it you must first install this code in your app.

Instalation

  1. Make sure your app has a package.json at the root. If it does not, do npm init and follow the prompts.
  2. Do npm install openui5-camera at the root of your project. This will pull this code into a subfolder named node_modules.
  3. Copy file node_modules\openui5-camera\dist\openui5\camera\library-preload.js into thirdparty\openui5\camera\library-preload.js (create folders as necessary).
  4. In your manifest, declare a dependency to this control by adding the following inside sap.ui5:
"resourceRoots": {
   "openui5.camera": "./thirdparty/openui5/camera/"
}
  1. Check test/demo/manifest.json if you're unclear about the previous step.

Usage in your app

  1. In the view you want to display the camera preview, insert the following:
<cam:Camera
    id="idCamera"
    width="800"
    height="600"
    snapshot=".onSnapshot" />
  1. Add the following to the same view's namespace declarations: xmlns:cam="openui5.camera"

  2. In the corresponding controller, add an event handler. This function will be called everytime the user clicks/taps the preview. It contains the picture in PNG format encoded in base64 (so it is a character string).

 onSnapshot: function (oEvent) {
    // The image is inside oEvent, on the image parameter,
    // let's grab it.
    var sSnapshot = oEvent.getParameter("image")});
    // Do something with it!
    // As you see in the demo, you can attach it directly to a src of an Image. 
    // Because it is already a text string it is also easy to POST to a server inside a json message. 
},

Found a bug? Want to contribute to this project?

  1. Install node.js (get it from nodejs.org).
  • If working behind a proxy, you need to configure it properly (HTTP_PROXY / HTTPS_PROXY / NO_PROXY environment variables)
  1. Clone the repository and navigate into it
git clone https://github.com/jumpifzero/openui5-camera
cd openui5-camera
  1. Install all npm dependencies (also installs all bower dependencies)
npm install
  1. Run npm start or grunt to lint, build and run a local server (have a look into Gruntfile.js to see all the tasks).
grunt
  1. Open a test page in your browser: http://localhost:8080/test/demo/index.html Attention: In Chrome, the camera API is blocked when using http as the protocol. For this reason, you have to either disable web security or setup a self-signed https local server.

Contributing

Contributions are welcomed. Please use a feature branch and don't forget to include your name (alphabetical order) in the list below.

Contributors

@stermi repo openui5-chartjs was also critical as an example, so thanks @stermi and all other UI5Lab contributors :)