Socket
Book a DemoInstallSign in
Socket

@shinyoshiaki/whip

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shinyoshiaki/whip

https://github.com/medooze/whip-whep-js

latest
npmnpm
Version
0.0.1
Version published
Maintainers
0
Created
Source

https://github.com/medooze/whip-whep-js

Example

browser

import { WhipSender } from "@shinyoshiaki/whip";

//Get mic+cam
const stream = await navigator.mediaDevices.getUserMedia({
  audio: true,
  video: true,
});

//Create peerconnection
const pc = new RTCPeerConnection();

//Send all tracks
for (const track of stream.getTracks()) {
  //You could add simulcast too here
  pc.addTrack(track);
}

//Create whip client
const whip = new WhipSender();

const url = "https://whip.test/whip/endpoint";
const token =
  "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IndoaXAgdGVzdCIsImlhdCI6MTUxNjIzOTAyMn0.jpM01xu_vnSXioxQ3I7Z45bRh5eWRBEY2WJPZ6FerR8";

//Start publishing
whip.publish(pc, url, token);

FAQs

Package last updated on 10 Jan 2025

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