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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ashetm/ng-mediastream

v12.0.1

Published

``@ashetm/ng-mediastream`` is a library that simplify manipulation of API ``MediaStream``.

Downloads

28

Readme

@ashetm/ng-mediastream

@ashetm/ng-mediastream is a library that simplify manipulation of API MediaStream.

It works with Angular 11 and above

Install

You can install it with npm:

npm install @ashetm/ng-mediastream

Import

You only need to import MediastreamModule.

...
import { MediastreamModule } from '@ashetm/ng-mediastream';
...
@NgModule({
  ...
  imports: [
    ...
    MediastreamModule, 
    ...
  ]
  ...
})
export class AppModule { }

API

@ashetm/ng-mediastream exposes the following:

Modules

  • MediastreamModule, that needs to import in order to use the library

Services

MediastreamService

MediastreamService is a service concern all about MediaStream API.

And for methods, there is the following:

  • getCameraDevices() returns Promise<MediaDeviceInfo[]> with camera device list of type MediaDeviceInfo[].

  • getDevices() returns Promise<MediaDeviceInfo[]> with all device list of type MediaDeviceInfo[].

  • getMicrophoneDevices() returns Promise<MediaDeviceInfo[]> with microphone device list of type MediaDeviceInfo[].

  • hasCameraDevices() returns Promise<boolean> boolean value if has at least 1 camera devise.

  • hasMicrophoneDevices() returns Promise<boolean> boolean value if has at least 1 microphone devise.

  • requestCamera(constraints?: MediaTrackConstraints) returns Promise<MediastreamCameraService> that contain instance of MediastreamCameraService (See below), it has 1 optional argument:

  1. constraints of type MediaTrackConstraints a configuration for camera.
  • requestCameraAndMicrophone(constraints?: Partial<Record<'audio' | 'video', MediaTrackConstraints>>) returns Promise<MediastreamCameraService> that contain instance of MediastreamCameraService (See below), it has 1 optional argument:
  1. constraints of type Partial<Record<'audio' | 'video', MediaTrackConstraints>> a configuration for bot camera and microphone.
  • requestMicrophone(constraints?: MediaTrackConstraints) returns Promise<MediastreamMicrophoneService> that contain instance of MediastreamMicrophoneService (See below), it has 1 optional argument:
  1. constraints of type MediaTrackConstraints a configuration for microphone.

MediastreamCameraService

MediastreamCameraService is a service concern all about MediaStream API of camera.

  • currentMediaDevice$ is Observable<MediaDeviceInfo>, it emits MediaDeviceInfo value of current media camera device information.

  • mediastream$ is Observable<MediaStream>, it emits MediaStream value of media stream information.

  • mediastreamConstraints is boolean | MediaTrackConstraints concerning camera configuration value.

For methods, there is the following:

  • disableCamera() returns void, it disables the current camera device.

  • enableCamera() returns void, it enables the current camera device.

  • toggleCamera() returns void, it disables/enables the current camera device.

  • updateCameraDevice(device: MediaDeviceInfo & Record<'kind', 'videoinput'>) returns void, it updates the current camera device with the first argument device: MediaDeviceInfo & Record<'kind', 'videoinput'>.

MediastreamCameraMicrophoneService

MediastreamCameraMicrophoneService is a service concern all about MediaStream API of both camera and microphone at the same time.

  • currentCameraMediaDevice$ is Observable<MediaDeviceInfo>, it emits MediaDeviceInfo value of current media camera device information.

  • currentMicrophoneMediaDevice$ is Observable<MediaDeviceInfo>, it emits MediaDeviceInfo value of current media microphone device information.

  • mediastream$ is Observable<MediaStream>, it emits MediaStream value of media stream information.

  • mediastreamCameraConstraints is boolean | MediaTrackConstraints concerning camera configuration value.

  • mediastreamMicrophoneConstraints is boolean | MediaTrackConstraints concerning microphone configuration value.

For methods, there is the following:

  • disableCamera() returns void, it disables the current camera device.

  • disableMicrophone() returns void, it disables the current microphone device.

  • enableCamera() returns void, it enables the current camera device.

  • enableMicrophone() returns void, it enables the current microphone device.

  • toggleCamera() returns void, it disables/enables the current camera device.

  • toggleMicrophone() returns void, it disables/enables the current microphone device.

  • updateCameraDevice(device: MediaDeviceInfo & Record<'kind', 'videoinput'>) returns void, it updates the current camera device with the first argument device: MediaDeviceInfo & Record<'kind', 'videoinput'>.

  • updateMicrophoneDevice(device: MediaDeviceInfo & Record<'kind', 'audioinput'>) returns void, it updates the current microphone device with the first argument device: MediaDeviceInfo & Record<'kind', 'audioinput'>.

MediastreamMicrophoneService

MediastreamMicrophoneService is a service concern all about MediaStream API of microphone.

  • currentMediaDevice$ is Observable<MediaDeviceInfo>, it emits MediaDeviceInfo value of current media microphone device information.

  • mediastream$ is Observable<MediaStream>, it emits MediaStream value of media stream information.

  • mediastreamConstraints is boolean | MediaTrackConstraints concerning microphone configuration value.

For methods, there is the following:

  • disableMicrophone() returns void, it disables the current microphone device.

  • enableMicrophone() returns void, it enables the current microphone device.

  • toggleMicrophone() returns void, it disables/enables the current microphone device.

  • updateMicrophoneDevice(device: MediaDeviceInfo & Record<'kind', 'audioinput'>) returns void, it updates the current microphone device with the first argument device: MediaDeviceInfo & Record<'kind', 'audioinput'>.

Issue

LOOKING FOR MAINTAINER OR IF THERE IS AN ISSUE OR ANY IDEA TO ADD. PLEASE CREATE ISSUE IN GITHUB REPOSITORY.