Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@norskvideo/webrtc-client

Package Overview
Dependencies
Maintainers
6
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@norskvideo/webrtc-client

WHIP/WHEP/duplex WebRTC client for Norsk integration

  • 0.1.1
  • npm
  • Socket score

Version published
Weekly downloads
53
decreased by-15.87%
Maintainers
6
Weekly downloads
 
Created
Source

webrtc-client

A simple client wrapper to initiate WebRTC connections via WHIP, WHEP and the similar internal duplex protocol for Norsk.

In the case of WHIP and WHEP, this package is provided in case it might be useful, but does not aim to be a fully general solution - there are other JS libraries supporting WHIP and WHEP, as well as non-browser alternatives. This implementation is tested with Norsk and used for internal test pages.

In the case of the Norsk duplex protocol - which is ultimately very similar to WHIP and WHEP - this code should provide a suitable integration point. In that case there are no real alternatives other than deriving your own implementation, or simply making separate webrtc connections for ingest and egest.

Usage

Create a client:

let myClient = new WhepClient({url: "subscribe"});

or

let myClient = new WhipClient({url: "publish"});

or

let myClient = new DuplexClient({url: "subscribe"});

Then start the client as required:

await myClient.start();

For WHEP and Duplex clients you can optionally provide a container element, to which an appropriate video element will be added, and also optionally set up for simulcast video:

new WhepClient({url: "subscribe", container: document.getElementById('container'), simulcastVideoCount: 3 });

Otherwise you will find the created RTCPeerConnection can be accessed and used as normal:

myClient.client.addEventListener('track', (event) => console.log(event));

Alternatives

  • @eyevinn/wrtc-egress - WHEP and WHPP egress
  • @eyevinn/webrtc-player - player supporting WHIP
  • @medooze/whip-whep-js - WHIP and WHEP clients
  • Cloudflare provide sample client code

FAQs

Package last updated on 06 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc