react-native-verto

0.1.3 • Public • Published

react-native-verto

Getting started

Installation

npm:

$ npm install react-native-verto --save

yarn:

$ yarn add react-native-verto

For use this library you must be link react-native-webrtc

React Native version < 0.60

Follow react-native-webrtc installation from this link:

React Native version >= 0.60 (auto-linking)

For iOS

cd ios/ && pod install && cd .. && react-native run-ios

For Android

react-native run-android

Usage

VertoView

import {VertoView} from 'react-native-verto';
 
const vertoParams = {
    websocket: {
        login: '<username>@<wsHost>',
        password: '<password>',
        url: 'webSocketURL'
    },
    deviceParams: {
        useMic: 'any',
        useSpeak: 'any',
        useCamera: 'any',
    }
}
 
const callbacks = {
    onPrivateEvent: (vertoClient, dataParams, userData) => {},
    onEvent: (vertoClient, dataParams, userData) => {},
    onInfo: (params) => {},
    onClientReady: (params) => {},
    onNewCall: (call: Call) => {},
    onPlayLocalVideo: (stream: MediaStream) => {},
    onPlayRemoteVideo: (stream: MediaStream) => {},
}
 
return(
    <VertoView vertoParams={vertoParams} callbacks={callbacks}/>
)

VertoClient

import {VertoClient} from 'react-native-verto';
 
const vertoParams = {
    websocket: {
        login: '<username>@<wsHost>',
        password: '<password>',
        url: 'webSocketURL'
    },
    deviceParams: {
        useMic: 'any',
        useSpeak: 'any',
        useCamera: 'any',
    }
}
 
const callbacks = {
    onPrivateEvent: (vertoClient, dataParams, userData) => {},
    onEvent: (vertoClient, dataParams, userData) => {},
    onInfo: (params) => {},
    onClientReady: (params) => {},
    onNewCall: (call: Call) => {},
    onPlayLocalVideo: (stream: MediaStream) => {},
    onPlayRemoteVideo: (stream: MediaStream) => {},
}
 
let vertoClient = new VertoClient(vertoParams, callbacks)

METHODS

destroy

vertoClient.destroy()

Callbacks

  • onInfo
  • onClientReady
  • onNewCall
  • onPlayLocalVideo
  • onPlayRemoteVideo

Package Sidebar

Install

npm i react-native-verto

Weekly Downloads

3

Version

0.1.3

License

MIT

Unpacked Size

72.8 kB

Total Files

20

Last publish

Collaborators

  • rizvanrzayev