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

rn-antmedia

v1.2.1-beta

Published

Port of webrtc-adaptor (AntMedia) to react-native using react-native-webrtc

Downloads

9

Readme

React Native AntMedia

rn-antmedia on NPM

Essential SDK to use antmedia with React native.

Table of content

  1. What is RN AntMedia?
  2. Getting Started
  3. Using
  4. Hook Parameters
  5. Hook returned adaptor
  6. Help this project

1. What is RN AntMedia?

RN AntMedia is an port of web sdk of antmedia webrtc_adaptor to react-native using react-native-webrtc. Some functionalities still the same but others have some differences.

Some functionalities are under development.

2. Getting Started

NOTE for Expo users: this plugin doesn't work unless you eject since you need to install react-native-webrtc too.

npm

	npm i rn-antmedia react-native-webrtc

yarn

	yarn add rn-antmedia react-native-webrtc

3. Usage

To know how to use you need to see examples in examples folder, i'm working on new examples.

4. Hooks Parameters

When you call a hook function, you need to pass some of this params to work, by default the hook will start getUserMedia with mediaConstraints.

Params with * is mandatory acctually

  • *url: string with url to your antmedia server example "wss://testserver.com/WebRTCAppEE/websocket"
  • *mediaConstraints: object with constraints to getUserMedia (react-native-webrtc)
  • *sdp_constraints: object with constraints to RTCSessionDescription (react-native-webrtc)
  • peerconnection_config: object with peerconnection configurartion (react-native-webrtc) -debug: boolean to show some messages on the console as some catch errors in the lib, false by default. -onlyDataChannel: boolean to init only in dataChannel mode.
  • *bandwidth: object with bandwidth config number or string example 300 or "unlimited"
  • callback: callback function when some event is fired by antmedia server by websocket
    • callback(this, message, data)
    • callback-this: is object returned by hook to use internally in callback
    • callback-message: is message returned by antmedia server
    • callback-data: is data returned by antmedia server (by the event could be undefined)
  • *callbackError: callback function when some error event is fired by antmedia server by websocket
    • callbackError(errorMessage, data)
    • callbackError-errorMessage: error message from antmedia event
    • callbackError-data: error data
  • *onopen: callback function called when connection is done between antmedia server and client
    • onopen-data: is data returned by onopen event in websocket connection

5. Hook returned adaptor

Params with * is mandatory

  • publish(*streamId, token): based on publish by antmedia webrtcAdaptor
  • joinRoom(*room, streamId): based on joinRoom by antmedia webrtcAdaptor
  • leaveFromRoom(room: string): based on leaveFromRoom by antmedia webrtcAdaptor
  • join(*streamId): based on join by antmedia webrtcAdaptor
  • leave(*streamId): based on leave by antmedia webrtcAdaptor
  • play(*streamId, token, room): based on play by antmedia webrtcAdaptor
  • stop(*streamId): based on stop by antmedia webrtcAdaptor
  • peerMessage(*streamId, *definition, *data): based on peerMessage by antmedia webrtcAdaptor
  • sendData(*streamId, *message): based on sendData by antmedia webrtcAdaptor
  • localStream: this is local stream when the hook is started
  • remoteStreams: this is object with remote streams when have connection between peers.
  • getUserMedia(*mediaConstrants): based on getUserMedia (react-native-webrtc)
  • getStreamInfo(*streamId): based on getStreamInfo by antmedia webrtcAdaptor
  • signallingState(*streamId): this function return the signalling state of the gived stream id
  • initPeerConnection(*streamId): funcion to initPeerConnection between the stream id and the user
  • handleTurnVolume(): function to turn on/off the volume (by default is turned on)
  • handleTurnCamera(): function to turn on/off the camera (by default is turned on)
  • isTurnedOf: boolean to return the state of camera (true is turned on)
  • isMuted: boolean to return the state of volume (true is turned on)

6. Help this project

How could you help this project: open an issue when you find some error, open an pull request when you find the solution.

If this project help you, please consider to help me to develop this project continuously.

paypal