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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@microblink/camera-manager

v7.2.7

Published

Manages cameras and stream, provides both a headless component and a UI component

Downloads

3,512

Readme

@microblink/camera-manager

This package provides camera management for web applications. It handles camera selection, permissions, video stream management, and provides access to video frames for further processing. It is framework-agnostic and can be used with or without a UI.

Overview

  • Handles camera selection, permissions, and video stream lifecycle.
  • Provides access to video frames for downstream processing.
  • Can be used standalone or with the included UI components.
  • Used by @microblink/blinkid-ux-manager and @microblink/blinkid.

Installation

Install from npm using your preferred package manager:

npm install @microblink/camera-manager
# or
yarn add @microblink/camera-manager
# or
pnpm add @microblink/camera-manager

Usage

Basic Example

import { CameraManager } from "@microblink/camera-manager";

const cameraManager = new CameraManager();

// Start the camera stream (auto-selects the best camera)
await cameraManager.startCameraStream();

// Optionally, attach the video to a DOM element
const video = document.getElementById("video");
cameraManager.initVideoElement(video);

// Capture frames for processing
const removeCallback = cameraManager.addFrameCaptureCallback((imageData) => {
  // Process imageData (instance of ImageData)
});

// Stop the camera when done
cameraManager.stopStream();

See the camera-manager example for more usage details.

API

CameraManager class

  • startCameraStream(options?): Starts the camera stream. Options allow selecting a specific camera or facing mode.
  • initVideoElement(videoElement): Attaches a video element for preview.
  • addFrameCaptureCallback(callback): Registers a callback to receive frames as ImageData during capture. Returns a cleanup function.
  • startFrameCapture(): Starts capturing frames for processing.
  • stopFrameCapture(): Stops capturing frames but keeps the stream active.
  • stopStream(): Stops the camera stream and video playback.
  • setResolution(resolution): Sets the desired video resolution (e.g., "1080p").
  • setFacingFilter(facingModes): Filters available cameras by facing mode ("front" or "back").
  • getCameraDevices(): Returns available camera devices.
  • selectCamera(camera): Selects a specific camera device.
  • setCameraMirrorX(mirrorX): Mirrors the video horizontally if needed.
  • reset(): Resets the camera manager and stops all streams.

UI Integration

To use the built-in UI, use:

import { createCameraManagerUi } from "@microblink/camera-manager";

const cameraUi = await createCameraManagerUi(cameraManager, document.body);
// Optionally, add cleanup:
cameraUi.dismount();

Internationalization

You can customize UI strings either when creating the camera UI or at runtime:

const cameraUi = await createCameraManagerUi(
  cameraManager,
  undefined,
  {
    localizationStrings: {
      selected_camera: "My Updated String",
    },
  },
);

At runtime:

cameraUi.updateLocalization({
  select_camera: "My updated string",
});

Provided Translations


You can import any of these files directly or use them as a starting point for your own localization.