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

vani-meeting-client

v1.8.3

Published

Vani Meeting Clinet SDK

Downloads

613

Readme

Vani Meeting SDK

Next generation video and audio API and SDK solutions to enhance your online experience. Engage with your audience in real-time, on any platform, from anywhere, through the addition of video and voice with Vani Meetings’s API and SDK solutions.

Getting Started

Installation

Install vani-meeting.demo with npm

  npm install com.vanimeeting.demo
                
  yarn add com.vanimeeting.demo

Usage/Examples

    import * as MeetingHandler from "com.vanimeeting.demo";
    import * as EventEmitter from "events";

    class WebrtcCallHandler {
    constructor() {
    this.roomid = null;
    this.meetingRequest = null;
    this.evenetEmitter = new EventEmitter();
    }

    static instance = new WebrtcCallHandler();
    static getInstance() {
        if (WebrtcCallHandler.instance === null) {
            WebrtcCallHandler.instance = new WebrtcCallHandler();
         } else {
        return WebrtcCallHandler.instance;
        }
    }
    setup(roomid, userid, appName, userData) {
        if (this.meetingRequest === null) {
            const locaUserid =
            new Date().getTime() + "_" + Math.floor(Math.random() * 20);
            this.meetingRequest = MeetingHandler.meetingStartRequestObject(
                roomid,
                userid || locaUserid,
                "demo" || appName
            );
            this.meetingRequest.numberOfUsers = 2;
            this.meetingRequest.userData = userData;
            }
            return this.meetingRequest;
        }
    }

    export default WebrtcCallHandler;

First we have to import SDK.

    import * as MeetingHandler from "com.vanimeeting.demo";
    import * as EventEmitter from "events";

Then we have to call meetingStartRequestObject which returns meetingStartRequestObject modal and accepts roomId, userId, appId, and userData as its params where:

  • roomId : is always unique string to join a meeting.
  • userId : is always unique string respective to user.
  • appId : can be any manual id given by user.
  • userData : any extra data.
    setup(roomid, userid, appName, userData) {
        if (this.meetingRequest === null) {
            const locaUserid =
            new Date().getTime() + "_" + Math.floor(Math.random() * 20);
            this.meetingRequest = MeetingHandler.meetingStartRequestObject(
                roomid,
                userid || locaUserid,
                "demo" || appName
            );
            this.meetingRequest.numberOfUsers = 2;
            this.meetingRequest.userData = userData;
            }
            return this.meetingRequest;
        }
    }

Then we will initialize the meeting and establish the connection by calling init method.

    MeetingHandler.init();

Then we will call startLocalStream method of MeetingHandler which will ask for camera and mic permission, once given returns the localStream of the user itself. It accepts isVideoRequired and isAudioRequired as its params.

  • isVideoRequired : boolean
  • isAudioRequired : boolean
    MeetingHandler.startLocalStream();

Then we will call checkSocket method of MeetingHandler to establish a connection with web socket.

    MeetingHandler.checkSocket();

After the connection is established with the websocket we will recieve an onConnected event and pass event name "onConnected" as first params and pass callback function onConnected as second parameter which will call startMeeting method of MeetingHandler to start the meeting.

    MeetingHandler.eventEmitter.on("onConnected", this.onConnected);
    onConnected = () => {
    MeetingHandler.startMeeting();
    };

After the initiation of meeting we will recieve an onTrack event and pass that event as event name "onTrack" as first params and pass callback function onTrack as second parameter which will recieve track as a parameter which will be passed as a MediaStream to video tag.

    MeetingHandler.eventEmitter.on("onTrack", this.onTrack);
    MeetingHandler.eventEmitter.on("refreshTrack", this.onTrack);*
    onTrack(track) {
        if (
            track.track !== null &&
            track &&
            track.kind === "video" &&
            track.isLocalTrack
        ) {
            this.localVideoRef.current.srcObject = new MediaStream([track.track]);
            this.localVideoRef.current.play();
        } else if (track && track.track !== null && !track.isLocalTrack) {
        if (track.kind === "video" && track) {
            this.remoteVideoRef.current.srcObject = new MediaStream([track.track]);
            this.remoteVideoRef.current.play();
        } else {
        if (track && track.track !== null) {
          this.remoteAudioRef.current.srcObject = new MediaStream([
            track.track,
          ]);
            this.remoteAudioRef.current.play();
            }
        }
        }
    }