@solid-primitives/stream
TypeScript icon, indicating that this package has built-in type declarations

0.7.1 • Public • Published

Solid Primitives Stream

@solid-primitives/stream

size size stage

Creates primitives to work with media streams from microphones, cameras or the screen.

Installation

npm install @solid-primitives/stream
# or
yarn add @solid-primitives/stream

How to use it

const [stream, { mutate, refetch, stop } = createStream(constraints: MediaDeviceInfo | MediaStreamConstraints);

stream: Accessor<MediaStream | undefined> & { loading: boolean, error: any }
mutate: (stream: MediaStream | undefined) => void // overwrite the stream
refetch: () => void // refetch the stream without changing the constraints
stop: () => void // stop the current stream

const [amplitude, { mutate, refetch, stop } = createAmplitudeStream(device: MediaDeviceInfo);

amplitude: Accessor<number> & { loading: boolean, error: any }
// otherwise like createStream

createMediaPermissionRequest(target?: 'audio' | 'video' | MediaStreamConstraints);
// use the createPermission primitive to watch the permissions.

Demo

https://primitives.solidjs.community/playground/stream

Changelog

See CHANGELOG.md

Package Sidebar

Install

npm i @solid-primitives/stream

Weekly Downloads

450

Version

0.7.1

License

MIT

Unpacked Size

18 kB

Total Files

5

Last publish

Collaborators

  • davedbase
  • lexlohr
  • thetarnav.