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

@casto/sdk

v0.0.20

Published

web SDK for CASTO

Downloads

20

Readme

CASTO SDK

The javascript implementation of the CASTO platform.

Install

npm install --save @casto/sdk

Tutorial and Examples

Basic

for sender

const Casto = require('@casto/sdk')
streamer = new Casto({type: "sender"})

for viewer

const Casto = require('@casto/sdk')
viewer = new Casto({type: "viewer"})
viewer.onSendChannelsList = ({channels}) => {
  for (const channel in channels) {
    /* Do some stuff for channel list */
    button.addEventListener('click', ()=> {
      /* media should be a mediaElement for streaming */
      media.srcObject = await casto.getChannel(channel.peerId})
    })
  }
}

For other web frameworks (TBD)

  • react tutorial
  • vue tutorial
  • vanilla javascript tutorial

Modules

casto diagram

sender ( {type: "sender"} )

module that send stream to specific serviceId

viewer ( {type: "viewer"} )

module that receive channel list of serviceId and choose stream from the list to view.

relay

service that relays copies of the sender's stream to viewers.

  • https://prisms.casto.tv/serviceId=<SERVICE_ID>
  • default: https://prisms.casto.tv/serviceId=TESTO

API

Methods

Create a Casto - new Casto(options)

create an instance of the Casto Require keys in the options object:

  • type: type of casto instance. If you want to do a broadcast, set sender or set viewer if you want to watch a broadcast.
  • serviceId: default is TESTO
  • streamerPeerId:

casto.start(): MediaStream

start a broadcast by the Casto. Should return a MediaStream, which is an object for transfer to the remote.

casto.getChannel(peerId): MediaStream

Should return a MediaStream, which is an object that received broadcasting from peerId

Events

Sender

casto.onNodeInitiated:

Casto is initiated. Ready to connect to relay nodes.

casto.onReadyToCast:

Successfully connected to a relay node and is ready to start broadcasting.

casto.onCompleted:

webRTC peerConnection is 'completed'. currently sending stream to a relay.

casto.onClosed:

webRTC peerConnection is 'closed'.

Viewer

casto.onNodeInitiated:

Casto is initiated. Ready to connect to relay nodes.

casto.onReadyToCast:

Successfully connected to a relay node and is ready to view streams.

casto.onClosed:

webRTC peerConnection is 'closed'.

casto.onSendChannelsList:

Retrieved available lists of channels from relay nodes.

casto.onSendChannelRemoved:

Channel is removed.

casto.onSendChannelAdded:

Channel is added.

casto.onWavesUpdated:

Received the updated channel information.

License

MIT © Casto Network