Socket
Book a DemoInstallSign in
Socket

@popul-ar/user-media

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@popul-ar/user-media

Web component wrapper for the getUserMedia API

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

<user-media>

A WebComponent wrapper for the getUserMedia API.

Get webcam video and microphone audio streams with a simple html tag!

Installation

Loading from CDN

Load the component from unpkg with a script tag:

<script type="module" src="https://unpkg.com/@popul-ar/user-media@latest"></script>

Installing from NPM

Install the module: npm install --save @popul-ar/user-media

Import the module: import '@popul-ar/user-media'

Examples

Using the component without any attributes will give you a muted video element with default webcam settings.

<user-media></user-media>

You can also specify other attributes depending on your needs.

<user-media width="720" height="1280" controls></user-media>

<user-media aspect-ratio="1.333" video-facing-mode="user"></user-media>

Documentation

See the <user-media> component API documentation for more details about attributes, events, and methods.

Demos

Basic webcam example: device selector with a few controls

Simplest usage: just the tag

Audio controls: audio streams and properties

Advanced properties: zoom, contrast, exposure mode, etc...

Development

npm install: installs dependencies

npm start: starts a dev server and runs a watcher for compiling the component

npm run build: builds the component in production mode and generates docs

Built With Stencil

FAQs

Package last updated on 25 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts