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

@akkadu/rtc-streamer-base

v4.3.6

Published

To understand the larger context where this module operates, if you are not already familiar, take a look at our Agora RTC documentation [here](https://www.notion.so/akkadu/Agora-RTC-6f6935c5b3be40b08ec33251d8334ca4)

Downloads

557

Readme

RTC Base

To understand the larger context where this module operates, if you are not already familiar, take a look at our Agora RTC documentation here

Purpose of this module

This module is the base of all the RTC modules and provides common functionalities and initialization methods for an Agora client.

The tasks that the base is supposed to accomplish:

  • Create a Agora client
  • Connect client to a room
  • Manage client state (client type, room connection)
  • Manage device support outlined in support.js
  • Manage which Agora version we import (AgoraRTS for non-webRTC devices, agora-rtc-sdk for others)
  • Maintain and parse streamer information (publishers) requested from the streaming API

Core concepts

Storing publisher information

This module expects a certain type of publisher data to be given when initialized. This data is based upon a return of the streams api, however the data is not in a good format, and it is then reformatted in the function parsePublishers to a format of:

{
  'en-US':['stream-1', 'stream-2', 'stream-x']
}

which can then be accessed via this.baseConfig.publishers in this class and classes extending it.

Using the module

The module is a javascript ESM class and is as of now published as-is. This is so that we can worry about bundling and babelifying the module separately in one place, namely our webapp repository.

This module is not meant to be used directly by itself, but via proxies like rtc-streamer-consumer and producer which extend this base classes functionality.

The main points of using and extending this is to:

  1. Pass in the correct config, defined in index.d.ts in the class constructor. validator.js implements the proper checks and throws an error in the case of invalid config.
  2. Listen to support and error emits which are documented at index.d.ts at method checkDeviceSupport
  3. Use this.client that is exposed by the module. If you want to make sure everything is initialized before calling client methods you can await this.clientInitialized.

Communication with the module

To simplify usage in the frontend and to make it easier to have consistent behavior with Agora's inconsistent streaming module all communication is done through emits.

This means that when you call a method you should expect a corresponding emit to be fired from the streamer. To see what emits functions are sending see index.d.ts file or use intellisense's documentation user @fires point

Structure

Documentation

  • index.d.ts defines the modules interface, this is your main source of method definitions

Implementation

  • index.js

Tests

  • ./tests/test.js

Commands

Build yarn build

Run Tests yarn test

Development

There are two ways of development, you can either develop inside the repository using the rtc-test-server module or follow the instructions here to export this module outside the repository