Stream

NPM
v0.6.14

#Installation

npm install @solid-primitives/stream
yarn add @solid-primitives/stream
pnpm add @solid-primitives/stream

#Readme

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

#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

Live Site

https://primitives.solidjs.community

#Changelog

See CHANGELOG.md