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 🙏

© 2026 – Pkg Stats / Ryan Hefner

video-call-lib

v1.0.1

Published

Reusable Angular/Ionic library for WebRTC peer-to-peer video calling with Socket.IO signaling

Readme

Video Call Library

A reusable Angular/Ionic library for WebRTC peer-to-peer video calling functionality. This library provides all the necessary services and utilities to integrate video calling into any Angular or Ionic application.

Features

  • WebRTC Services - Complete peer connection management
  • Socket.IO Signaling - Real-time signaling for connection negotiation
  • Call State Management - Observable-based call state tracking
  • Authentication Guard - Route protection for authenticated calls
  • Multi-platform - Works on Web, iOS, and Android (via Capacitor)
  • Camera Switching - Support for front/rear camera switching
  • Audio/Video Controls - Toggle audio/video tracks
  • ICE Servers - Automatic ICE server configuration

Installation

npm install video-call-lib socket.io-client

Quick Start

1. Import the Module

import { NgModule } from '@angular/core';
import { VideoCallLibModule } from 'video-call-lib';

@NgModule({
  imports: [VideoCallLibModule]
})
export class AppModule { }

2. Configure Signaling Server

import { setSignalingUrl } from 'video-call-lib';

// In your app initialization (app.component.ts or main.ts)
setSignalingUrl('http://localhost:3000');

// For production
// setSignalingUrl('https://your-signaling-server.com');

3. Use WebRTC Service

import { Component, ViewChild, ElementRef } from '@angular/core';
import { WebRTCService } from 'video-call-lib';

@Component({
  selector: 'app-call',
  template: `
    <div>
      <input [(ngModel)]="roomId" placeholder="Room ID">
      <button (click)="startCall()">Start Call</button>
      <button (click)="endCall()">End Call</button>
      
      <video #localVideo autoplay muted playsinline></video>
      <video #remoteVideo autoplay playsinline></video>
    </div>
  `
})
export class CallComponent {
  @ViewChild('localVideo') localVideo!: ElementRef<HTMLVideoElement>;
  @ViewChild('remoteVideo') remoteVideo!: ElementRef<HTMLVideoElement>;

  roomId = 'test-room';

  constructor(private webrtc: WebRTCService) {}

  async startCall() {
    await this.webrtc.init(
      this.roomId,
      this.localVideo.nativeElement,
      this.remoteVideo.nativeElement
    );
  }

  endCall() {
    this.webrtc.leave();
  }
}

API Reference

WebRTCService

// Initialize a call
async init(room: string, localVideoElement: HTMLVideoElement, remoteVideoElement: HTMLVideoElement): Promise<void>

// Leave the call
leave(): void

// Switch between front and rear camera
async switchCamera(): Promise<void>

// Toggle audio track
toggleAudio(enabled: boolean): void

// Toggle video track
toggleVideo(enabled: boolean): void

// Pause all tracks
pause(): void

// Resume all tracks
resume(): void

CallStateService

// Set the current room ID
setRoom(id: string): void

// Get room ID as observable
getRoom(): Observable<string | null>

AuthGuard

Protect routes that require authentication:

const routes: Routes = [
  {
    path: 'call',
    component: CallComponent,
    canActivate: [AuthGuard]
  }
];

Signaling Server

The library requires a WebRTC signaling server for connection negotiation.

Quick Start

# Start the signaling server
node server.js

# Server runs on http://localhost:3000

Server Configuration

Configure your signaling server URL based on your environment:

// Development
setSignalingUrl('http://localhost:3000');

// Android Emulator
setSignalingUrl('http://10.0.2.2:3000');

// Production
setSignalingUrl('https://your-signaling-server.com');

Environment-based Configuration

import { environment } from './environments/environment';
import { setSignalingUrl } from 'video-call-lib';

@NgModule({})
export class AppModule {
  constructor() {
    setSignalingUrl(environment.signalingUrl);
  }
}

Browser Support

  • Chrome/Edge 90+
  • Firefox 87+
  • Safari 14.1+
  • Android Chrome 90+
  • iOS Safari 14.5+

Requirements

  • Angular 20+
  • RxJS 7.8+
  • Socket.IO Client 4.8+
  • Capacitor 8+ (optional, for mobile)

License

MIT