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

qcalll

v1.0.1

Published

Call library from Quilo S.A.

Downloads

4

Readme

QCall

Install QCall With npm

 npm install qcall

With yarn

 yarn add qcall

Room Builder

Builder class wich allows you to create a Room instance with the build pattern. By default this class has the current constraints:

  • VideoConstraints:
    • Height
      • max: VideoQualities.HD.height = 720px
      • min: VideoQualities.LOW.height = 360px
      • ideal: VideoQualities.SD.height = 480px
    • Width
      • max: VideoQualities.HD.width = 1280px
      • min: VideoQualities.LOW.width = 480px
      • ideal: VideoQualities.SD.width = 640px
    • Frame Rate (fps)
      • max: FrameRates.HIGH = 45fps
      • min: FrameRates.LOW = 15fps
      • ideal: FrameRates.STANDARD = 25fps
  • withAudio = True

Functions

Name | Parameters | Description --- | --- | --- setPeerId | id: String | Sets the peerId manually. By default it is a uuid. setWithAudtio| withAudio: Boolean | Defines if the current stream will include audio. setMetadata|metadata: Object|Sets the metadata of the caller wich will be shared through the clients of the room. setOnStreamAdded | (callerId, remoteStream) => Void : Function | Callback when a remote stream is added. First parameter is the remote peerId connected. Second parameter is the remote MediaStream provided. setOnStreamDennied | (data, error) => Void : Function | Callback when the user does not give permission to the current web page to get access to the camera and/or microphone. The data (first parameter) value containts the current id and the metadata in an object instance, error (second parameter) containts the error instance. This callback its main purpose is for to show a specific message if the user does not allow the permission. setMaxVideoQuality | qualityConstraints : object | Sets the video max quality. Can be from VideoQualities constants or it can be a custom value in px like {width : 100px, height: 100px } setMinVideoQuality | qualityConstraints : object | Sets the video min quality. Can be from VideoQualities constants or it can be a custom value in px like {width : 100px, height: 100px } setIdealVideoQuality | qualityConstraints : object | Sets the video ideal quality. Can be from VideoQualities constants or it can be a custom value in px like {width : 100px, height: 100px } setIdealFrameRate | rate : Number | Sets the ideal frame rate. Can be from FrameRates constants or it can be a custom value like 40fps setMinFrameRate | rate : Number | Sets the min frame rate. Can be from FrameRates constants or it can be a custom value like 10fps setMaxFrameRate | rate : Number | Sets the max frame rate. Can be from FrameRates constants or it can be a custom value like 100fps setFacingMode | mode : String | Sets the facing mode for mobile users. It can be either FacingModes.FRONT_CAMERA or FacingModes.BACK_CAMERA

Examples

Basic Example

import { RoomBuilder } from "qcall";
/* Creates an instance of Room Class **/
const room = new RoomBuilder('roomId')
        .setMetadata({ name: "Augusto Alonso" })
        .build()

Example defining custom video quility

import { RoomBuilder, VideoQualities } from "qcall";
/* Creates an instance of Room Class **/
const room = new RoomBuilder('roomId')
        .setMetadata({ name: "Paquito Pedroza" })
        .setMaxVideoQuality(VideoQualities.FULL_HD)
        .setMinVideoQuality(VideoQualities.HD)
        .setIdealVideoQuality(VideoQualities.FULL_HD)
        .build()
/* Another way to build it with custom video quality
is by passing an object with the width and height dimensions in pixels
**/
const FourK = { width: 3840, height: 2160 }
const room = new RoomBuilder('roomId')
        .setMetadata({ name: "Paquito Pedroza" })
        .setMaxVideoQuality(FourK)
        .build()

Example defining custom frame rate

import { RoomBuilder, VideoQualities, FrameRates } from "qcall";
/* Creates an instance of Room Class **/
const room = new RoomBuilder('roomId')
        .setMetadata({ name: "Paquito Pedroza" })
        .setMaxVideoQuality(VideoQualities.FULL_HD)
       	.setMinFrameRate(FrameRates.GOOD)
        .setIdealFrameRate(FrameRates.HIGH)
        .setMaxFrameRate(FrameRates.MAX)
        .build()
/* Another way is passing the raw frame rate value desired **/
const room = new RoomBuilder('roomId')
        .setMaxFrameRate(35)
        .build()

Want to stream without audio

import { RoomBuilder } from "qcall";
/* Creates an instance of Room Class **/
const room = new RoomBuilder('roomId')
		.setWithAudtio(false)       
        .build()

Setting a onStreamDennied callback for our Room class

import { RoomBuilder } from "qcall";
/* Creates an instance of Room Class **/
const room = new RoomBuilder('roomId')
		.setMetadata({ name: 'Juice WRLD', profession: 'Musician'})
		.setOnStreamDennied((data, error) => {
        //Function where you alert and show an alert that the user MUST give 
        //the permission to the web page to record the camera and microphone
        	alertUserPermissionsNeeded()
            console.log(`The ${data.profession} ${data.name} did not consent permission to record`)
            //Output:
            //The Musician Juice WRLD did not consent permission to record
        })       
        .build()

Want to specify custom peerId (each one must be unique by default an uuid is set)

import { RoomBuilder } from "qcall";
/* Creates an instance of Room Class **/
const room = new RoomBuilder('roomId')
		.setPeerId(user.id)       
        .build()

Room Class

Properties

Property | Property Type | Description --- | --- | --- stream | MediaStream | The Media stream instance of the local caller. videoStream (getter) | MediaStream | Stream only with video of the local client excludes the audio without affecting the original stream. If the stream has not been set yet returns null audioStream (getter) | MediaStream | Stream only with audio of the local client excludes the audio without affecting the original stream. If the stream has not been set yet returns nullnt clients using the room. peer | PeerJs | Peer js instance

Functions

Name | Parameters | Description --- | --- | --- connect | Does not have parameters | When this function is calles it connects the current cleint to the room and retrieves the list of clients wich where already connected to it. It handles the connection to each of the clients in the call. close| Does not have parameters | Closes the connection with each one of the clients. Also disconnects the peer.

Client Class

Properties

Property | Property Type | Description --- | --- | --- metadata | Object | Containts the metadata set in the RoomBuilder class. stream | MediaStream | The Media stream instance of the remote caller. connection | MediaConnection | The connection with the remote caller. call | MediaConnection | The connection with the remote caller. videoTrack (getter) | MediaStreamTrack | Video Track of the current stream instance from the remote client in the room. If the stream has not been set yet returns null videoTracks (getter) | Array<MediaStreamTrack> | All the video tracks from the remote client. If stream has not been set returns [] audioTrack (getter) | MediaStreamTrack | Audio Track of the current stream instance from the remote client in the room. If the stream has not been set yet returns null audioTracks (getter) | Array<MediaStreamTrack> | All the audio tracks from the remote client. If stream has not been set returns [] peerId | String | The peer connection id of the remote caller clients | Array of Clients| Array that containts all the current clients using the room. peer | PeerJs | Peer js instance