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

@lapix/olwebrtc

v3.0.11

Published

Otra Libreria WebRTC

Downloads

11

Readme

Otra Librería WebRTC (olwebrtc)

npm npm

Yet another WebRTC Library.

Usage

import {WebRTCCall} from '@lapix/olwebrtc/dist/webrtc-call';
import {GraphqlSignaling} from '@lapix/olwebrtc/dist/graphql-signaling';
import {FetchCheckNetworkStatus} from '@lapix/olwebrtc/dist/fetch-check-network-status';
import newCallClient from "@lapix/olwebrtc/dist/graphql-client"

// Split the mutations and subscriptions based on the
// current graphql implementation.
const apolloClient = newCallClient({uri: "wss://my-signaling-server.io/query"}, currentApolloClient)

const call = new WebRTCCall({
  // Zero Log everything, Five silence.
  logLevel: 5,
  // Will sanitize the sdp, browsers will not support that.
  allowSDPTransform: true,
  // If could not find a valid ice, then will try to make
  // the call again.
  allowIceStalledChecking: true,
  // If the ICE connection state is disconnected it will
  // check the bitrate in the next 5s and if it get worst 
  // the will restart the ICE candidates.
  allowBitrateChecking: true,
  // Max bandwidth.
  bandwidth: 300,
  // Will check the network connection to if the peer connection
  // is closed before the call has been finished.
  network: new FetchCheckNetworkStatus(),
  signaling: new GraphqlSignaling(apolloClient),
  rtcConfiguration: {
    iceServers: [{ urls: "stun:stun.l.google.com:19302" }],
  },
});

call.start({
  roomId: "vip-room",
  mediaStreamConstrains: {
    camera: {
      video: {
        width: { min: 720 },
        height: { min: 480 },
        frameRate: { max: 30 },
      },
      audio: {
        noiseSuppression: true,
      },
    },
    // By default it will share the camera stream, if you want to
    // share your screen just call the `shareScreen` method, by now
    // it does not renegotiate, it just close the connection and start
    // a new one, then if you what to share the camera again just call
    // the `shareVideo` method.
    screen: {
      video: true,
    }, 
  },
});

call.on("change", () => console.log(call))
call.on("error", err => console.error(err))
call.on("finish", err => console.warn("Has been finished"))

call.on("local-track-change", () => {
    this.localStream = call.localStream;
})
call.on("track-change", () => {
    this.peerStream = call.peerStream;
})

// are Video or audio enabled?
this.video = call.video; 
this.audio = call.audio; 

// Update local controls.
this.toggleAudio();
this.toggleVideo();

// Peer controls.
const {video, audio} = call.externalControls;

// Share screen or camera.
call.shareScreen();
call.shareVideo();

// Has the call been finished.
this.finished = call.finished;
this.finish();

GraphQL

Signaling server must implement the following graphql schema.

ReactNative

It works with ReactNative, you only need to replace the FetchCheckNetworkStatus for RNCheckNetworkStatus.

TODO

  • [ ] (*) Test
  • [ ] Docs
  • [ ] Disconnection Strategy in ReactNative.
  • [ ] Fix the max bandwidth.
  • [ ] Make it flexible.

Thanks to

License

ISC