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

pipstream

v1.0.24

Published

PIP Raw library for live streaming

Downloads

46

Readme

PIPStream

Live Streaming Library from Volcano.live

Build Status

PIPstream is a quick and easy live streaming library. PIP has the same "selector" strcture as jQuery, instead of $, PIP uses $P.

Quick 3 Steps

  • Install PIP usng npm
  • $P("document").init();
  • $P("#mybutton").cameraTrigger();

Install

npm i pipstream

Note: You need HTTPS connection for WEBRTC to work. (Only localhost will work without https)

Features

  • Stream live video content using WEBRTC (from your browser).
  • Supports upto 18 live streamers and unlimted live viewers.
  • Option to control camera, switch devices, mute, unmute etc.

Usage

1. Initialise WebRTC

import { $P } from "pipstream";

$P("document").init("mychannelname");

Here the channelname parameter can be any unique string used by both the broadcaster and the viewer.

To check the status, we can pass a callback function, to the above function. The first callback is for success, second callback is for failure.

$P("document").init("mychannelname", successCallback, failureCallback);

For example:

$P("document").init("mychannelname", function (response) {
  console.log("success");
});

2. Trigger the Camera

Make a button/link/or any html element to trigger the camera popup. Clicking on the element will trigger the camera permission popup, and get permission from the browser.

HTML

<a href="#" id="startlink">Start</a>

JS

$P("#startlink").cameraTrigger();

3. Show Webcam Video

Creat a html video tag, and make that video element to display local stream video.

HTML

<video width="500" id="myvideo" muted></video>

JS

$P("#myvideo").localVideoStream();

Note: This function accept a success callback method as a parameter.

For example:

$P("#myvideo").localVideoStream(function () {
  $P.getDevices(); // this method is for listing all available video/audio devices in the system.
});

4. Go Live

The above function, 'localVideoStream' get the video/audio stream from the device and play locally. You need to make it go live to broadcast the video.

$P("#myvideo").goLive();

OR

<a href="#live" onclick='$P("#myvideo").goLive()'>Go Live</a>

To End the Stream (Leave Stream)

$P.disconnect();

5. Show Remote Video (Or Watch any live stream)

Create a html video element anywhere and make the video to play the remote stream.

For Example:

<video width="500" id="remotevideo" muted></video>

JS

$P("#remotevideo").remoteVideoStream(function () {
  /* Callback when the stream begins */
});

On Stream End Callback

Use the follwing function to get the callback when the stream ends. (On the receiver side)

$P("#remotevideo").onStreamRemoved(function () {
  /* callback function */
});

Some other quick functions

1. Switch Camera Device

$P.getLocalStream().switchDevice("video", deviceID);
// $P.getDevices() can be used to get a list of Device IDs

2. Switch Audio Device

$P.getLocalStream().switchDevice("audio", deviceID);
// $P.getDevices() can be used to get a list of Device IDs

3. Disable/Enable Local Video (Turn Video Off)

$P("#myvideo").turnVideo("off");
$P("#myvideo").turnVideo("on");

3. Disable/Enable Local Audio (Mute/Unmute)

$P("#myvideo").turnAudio("off");
$P("#myvideo").turnAudio("on");

4. Manually Trigger Camera

If you want any event other than onClick on an element to trigger the camera, (Alternative Fuction to cameraTrigger ) use the following function.

$P.enableCamera();

For example

<p ondblclick="$P.enableCamera()">Double-click me</p>

5. Get Connection Status at any time

$P.getConnectionStatus(); //returns true or false

Advanced Functions

Get Local Stream Object

$P.getLocalStream(); //Single Object

Get Remote Stream Object

$P.getIncomingStreams(); // Array of Objects

Get PIP Stream Object

$P.getPipStreamObject();

About Volcano

Volcano is a live streaming video platform for real life contents. Visit: https://volcano.live