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

rtc-ui

v1.1.2

Published

Common UI interaction patterns for working with rtc.io modules

Downloads

6

Readme

rtc-ui

This is a collection of user interface helper functions that can be used in conjunction with other rtc.io modules.

NPM

experimental Gitter chat

Reference

rtc-ui/stream

Provides a number of helper functions for rendering both local and remote streams to the DOM. Also provides a top level streamui function that chain be used as a quickconnect "plugin" to automatically wire up these helper functions for typical usage.

An example of usage is provided below:

var quickconnect = require('rtc-quickconnect');
var capture = require('rtc-capture');
var streamui = require('rtc-ui/stream');
var conference;

capture({ video: true, audio: true }, function(err, stream) {
  if (err) {
    return console.error(err);
  }

  // create the conference
  conference = quickconnect('https://switchboard.rtc.io/', {
    room: 'rtc-ui:conference-example'
  });

  // add the local stream to the conference
  conference.addStream(stream);

  // render the local stream using the stream ui
  streamui.local(document.body)(stream);

  // use streamui to automatically handle element creation and removal
  streamui(conference, { container: document.body });
});

streamui(qc, opts)

Link standard quickconnect events to sensible streamui handlers. Use opts to provide configuration to the handler functions, notably:

  • container - the container element in which new elements will be created within and searches for element removal will be constrained to. Defaults to document.body.

  • plugins - If you are using any rtc.io plugins specify these here to have them passed on to rtc-attach for integration.

streamui.local(container, opts?) => fn(stream)

Create a handler function specifying a target container and any additional options. The handler function expects a single argument of stream for which a rendering element will be created and added to the specified container.

This element will have the rtc abd localvideo classes applied to it so can be styled using CSS by your app.

streamui.add(container, opts?) => fn(id, stream)

Create a handler function that is designed to respond to stream:added events generated by rtc-quickconnect (i.e it follows the (id, stream) function signature). A renderer element will be created for the stream and appended to the container element.

This element will have the rtc and remotevideo classes applied to it, and will also have data-peer and data-stream attributes set on the created element.

streamui.remove(container, opts?) => fn(id, stream?)

Create a handler function that is designed to respond to both stream:removed and call:ended events generated by rtc-quickconnect. When the handler is invoked with just an id, all elements with the data-peer matching the specified value will be removed from container. If a stream argument value is supplied, then only those matching the data-stream label will be removed.

License(s)

ISC

Copyright (c) 2015, National ICT Australia Limited (NICTA)

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.