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

@htmlbricks/hb-player-input-streaming

v0.76.5

Published

Requests camera and microphone with `getUserMedia`, binds the stream to a `<video>` element, and exposes basic controls (play/pause, fullscreen, enable/disable video and audio tracks). Emits `AudioVideoAccess` with grant result and `VideoInitialized` with

Readme

hb-player-input-streaming — integrator guide

Category: media · Tags: media, video, camera · Package: @htmlbricks/hb-player-input-streaming

Summary

This web component captures the user’s camera and microphone using the browser MediaDevices.getUserMedia() API, assigns the resulting MediaStream to an in-shadow <video> element, and renders a small toolbar for playback, fullscreen, and toggling video/audio tracks.

Access is requested automatically when the component mounts (see implementation in component.wc.svelte). If permission is denied, the component dispatches an event with the failure outcome and throws internally after logging; there is no separate “request” button in the default UI.

Custom element tag

<hb-player-input-streaming …></hb-player-input-streaming>

Attributes (HTML / reflected props)

| Attribute | Role | |-----------|------| | id | Included in event detail (default empty string). | | style | Optional on Component; host style still affects layout in the light DOM. |

User interface

Inside the shadow root, the layout is roughly:

  • A <video> element (with a captions <track> placeholder) showing the live preview once a stream is attached.
  • A control row showing the current playback time (numeric) and buttons:
    • Play / pause — toggles HTMLMediaElement.play() / pause() on the preview video.
    • FH — calls requestFullscreen() on the video element.
    • remove / add video — enables or disables video MediaStreamTrack instances on the bound stream.
    • remove / add audio — same for audio tracks.

Labels use plain English strings (play, pause, FH, etc.) as in the source.

Events

| Event | detail | |-------|----------| | AudioVideoAccess | { granted: boolean; id: string } — after getUserMedia succeeds or fails. | | VideoInitialized | { videoElement: HTMLVideoElement; id: string } — after the stream is bound and play() is invoked on success. |

TypeScript typings (authoring)

From types/webcomponent.type.d.ts:

export type Component = { id?: string; style?: string };
export type Events = {
  AudioVideoAccess: { granted: boolean; id: string };
  VideoInitialized: { videoElement: HTMLVideoElement; id: string };
};

Requirements and limitations

  • Secure context: getUserMedia is restricted to secure contexts (HTTPS or localhost).
  • Permissions: The browser shows its own prompt for camera and microphone; the user can deny either or both.
  • Privacy: Embedding this component implies you will request sensitive device access as soon as it loads; consider UX and legal copy (privacy policy, consent) on the host page.

Styling (Bulma)

The component forwards the shared Bulma web-component theme on :host. Consumer pages can override Bulma CSS variables from the light DOM. See Bulma CSS variables and extra/docs.ts for the curated list used in metadata:

| Variable | Role | |----------|------| | --bulma-text | Toolbar / text beside the preview. | | --bulma-link | Accent for interactive controls when Bulma tokens apply. | | --bulma-background | Surface behind the video area. | | --bulma-border | Optional separators if you extend layout around the shell. |

Host baseline (styles/webcomponent.scss) sets :host { display: block; } and a relative container for the player shell.

There are no documented ::part names or slots for this package (extra/docs.ts).

Minimal HTML

Minimal host with a stable id (useful for tests or logging):

<hb-player-input-streaming id="cam1"></hb-player-input-streaming>

Sized host (layout via host style):

<hb-player-input-streaming
  id="player-input-demo"
  style="display:block;width:100%;max-width:640px;"
></hb-player-input-streaming>

Listening for access and initialization in vanilla JS:

<hb-player-input-streaming id="preview"></hb-player-input-streaming>
<script>
  const el = document.querySelector("hb-player-input-streaming");
  el.addEventListener("AudioVideoAccess", (e) => {
    console.log("granted:", e.detail.granted, "id:", e.detail.id);
  });
  el.addEventListener("VideoInitialized", (e) => {
    console.log("video element:", e.detail.videoElement);
  });
</script>

License: Apache-2.0 per extra/docs.ts / published LICENSE.md.