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

meteor-video-chat

v2.3.0-alpha

Published

NPM package for working with elmarti:meteor-video-chat in other platforms - Currently in alpha, feel free to get involved

Downloads

11

Readme

Meteor Video Chat

This extension allows you to implement user-to-user video calling in React, Angular and Blaze. This package now uses RTCFly

Example with React

Click here for the React example source code.

Example with Blaze

Click here for the Blaze example source code.

Stories in Ready Travis CI Maintainability

A note on previous versions

Meteor Video Chat used to use Meteor.VideoCallServices, however we have moved to a more modular system, opting for ES6 imports like so:

import { VideoCallServices } from 'meteor/elmarti:video-chat'; Old style code will be supported for the forseeable future, but we suggest moving over to the new format.

Usage with asteroid

The Meteor Video Chat client can be used by first running npm install meteor-video-chat, and then using the following mixin import


import { AsteroidVideoChatMixin } from 'meteor-video-chat';

After including this as an Asteroid mixin, as per the Asteroid page, you can access it like so:

    Asteroid.VideoCallServices;

init

Here you can set the RTCConfiguration. If you are testing outside of a LAN, you'll need to procure some STUN & TURN servers.

VideoCallServices.init({'iceServers': [{
    'urls': 'stun:stun.example.org'
  }]
});

Calling a user

To call a user, use the following method.

VideoCallServices.call(ICallParams);

These are the parameters that can be used:

interface ICallParams {
    id:string; //ID of the callee
    localElement: IHTMLMediaElement; //local HTMLElement
    remoteElement: IHTMLMediaElement; //remote HTMLElement
    video:boolean; //Do you want to show video?
    audio:boolean; //Do you want to show audio?
}

Deciding who can connect to whom

The follow method can be overridden on the server side to implement some kind of filtering. Returning false will cancel the call, and true will allow it to go ahead.

VideoCallServices.checkConnect = function(caller, target){
return *can caller and target call each other"
};

Answering a call

The first step is to handle the onReceiveCall callback and then to accept the call. The answerCall method accepts the ICallParams interfaces, just like the "call" method above

 VideoCallServices.onReceiveCall = (userId) => {
        VideoCallServices.answerCall(ICallParams);
 };

Muting local or remote videos

VideoCallServices.toggleLocalAudio();
VideoCallServices.toggleRemoteAudio();

Application state

The following values are stored in a reactive var

localMuted:boolean, 
remoteMuted:boolean, 
ringing:boolean,
inProgress:boolean

Getting the state

VideoCallServices.getState("localMuted");

Accessing the video (HTMLMediaElement) elements

const localVideo = VideoCallServices.getLocalVideo();
const remoteVideo = VideoCallServices.getRemoteVideo();

Ending call

Simply call

VideoCallServices.endCall();

Other events

The following method is invoked when the callee accepts the call.

VideoCallServices.onTargetAccept = () => {
}

The following method is invoked when either user ends the call

VideoCallServices.onTerminateCall = () => {
}

The following method invoked when the RTCPeerConnection instance has been created, making it possible to consitently mutate it or add a data channel

VideoCallServices.onPeerConnectionCreated = () => {
}

The following method is invoked on the caller browser when the callee rejects the call

VideoCallServices.onCallRejected = () => {
    
}

The following method is invoked on both the client and server whenever an error is caught. User is only passed on the server

VideoCallServices.setOnError(callback);

The onError section can also be used for handling errors thrown when obtaining the user media (Webcam/audio). See here for more info, or checkout the example.

This project is sponsored by the following:

BrowserStack

Sentry.io