Coder Social home page Coder Social logo

sendbird / quickstart-calls-javascript Goto Github PK

View Code? Open in Web Editor NEW
12.0 16.0 14.0 974 KB

Sendbird Calls for JavaScript sample, guiding you to bulid a real-time voice and video calls quickly and easily.

Home Page: https://sendbird.com

License: MIT License

JavaScript 92.39% CSS 4.74% HTML 2.86%
calls quickstart javascript js voip webrtc rtc call sendbird-application calls-sdk

quickstart-calls-javascript's Introduction

This vanilla JS version of quickstart is OUTDATED. Please check out the react version of quickstart instaed.

Sendbird Calls for JavaScript Quickstart

Platform Languages

Introduction

Sendbird Calls SDK for JavaScript is used to initialize, configure, and build voice and video calling functionality into your JavaScript client app. In this repository, you will find the steps you need to take before implementing the Calls SDK into a project, and a sample app which contains the code for implementing voice and video call.

More about Sendbird Calls for Javascript

Find out more about Sendbird Calls for JavaScript on Calls for JavaScript doc. If you need any help in resolving any issues or have questions, visit our community.


Before getting started

This section shows you the prerequisites you need for testing Sendbird Calls for Javascript sample app.

Requirements

The minimum requirements for Calls SDK for Javascript sample are:

  • Node
  • npm (or yarn)
  • Modern browser, supporting WebRTC APIs.

Getting started

If you would like to try the sample app specifically fit to your usage, you can do so by following the steps below.

Create a Sendbird application

  1. Login or Sign-up for an account on Sendbird Dashboard.
  2. Create or select an application on the dashboard.
  3. Note your Sendbird application ID for future reference.
  4. Contact sales to get the Calls menu enabled on your dashboard. A self-serve will be available soon to help you purchase call credits automatically from your dashboard.

Create test users

  1. On the Sendbird dashboard, navigate to the Users menu.
  2. Create at least two new users: one as a caller, and the other as a callee.
  3. Note the user_id of each user for future reference.

Install and run the sample app

  1. Clone this repository
$ git clone [email protected]:sendbird/quickstart-calls-javascript.git
  1. Install dependencies
$ cd quickstart-calls-javascript
$ npm install
  1. In envs.js, replace the value of TEST_APP_ID with APP_ID which you can find on your Sendbird application information. If you skip this step, an additional field for the Application ID will appear in the login view.
export const TEST_APP_ID = 'SAMPLE_APP_ID';
  1. Build
$ npm run build
  1. Start the sample app
# Start with webpack-dev-sever
$ npm run start:dev

# Start with express server
$ npm run start
  1. If two devices are available, repeat these steps to install the sample app on each device.

Making your first call

How to make a call

  1. On each device, open a browser and go to the index page of the sample web app. The default URL is localhost:9000.
  2. On each browser, choose an app type between Full-screen or Widget.
  3. On the primary device’s browser, log in to the sample app with the user ID set as the caller.
  4. On the secondary device’s browser, log in to the sample app with the user ID set as the caller.
  5. On the primary browser, specify the user ID of the callee and initiate a call.
  6. If all steps are followed correctly, an incoming call notification will appear on the browser of the callee.
  7. Reverse the roles. Initiate a call from the other browser.
  8. If the two testing devices are near each other, use headphones to make a call to prevent audio feedback.

Sound Effects

You can use different sound effects to enhance the user experience for events that take place while using Sendbird Calls.

To add sound effects, use the SendBirdCall.addDirectCallSound(type: SoundType, uri: string) method for the following events: dialing, ringing, reconnecting, and reconnected. Remember to set sound effects before the mentioned events occur. To remove sound effects, use the SendBirdCall.Options.removeDirectCallSound(type: SoundType) method.

Use SendBirdCall.addDirectCallSound(type: SoundType, uri: string) method to set sound effects for a number of types: dialing, ringing, reconnecting, reconnected. Sound effects must be set before the events occur. To unregister a sound effect, remove it by calling SendBirdCall.Options.removeDirectCallSound(type: SoundType).

// Play on a caller’s side when making a call.
SendBirdCall.addDirectCallSound(SendBirdCall.SoundType.DIALING, DIALING_SOUND_URL);
// Play on a callee’s side when receiving a call.
SendBirdCall.addDirectCallSound(SendBirdCall.SoundType.RINGING, RINGING_SOUND_URL);
// Play when a connection is lost, but the SDK immediately attempts to reconnect.
SendBirdCall.addDirectCallSound(SendBirdCall.SoundType.RECONNECTING, RECONNECTING_SOUND_URL);
// Play when the connection is re-established.
SendBirdCall.addDirectCallSound(SendBirdCall.SoundType.RECONNECTED, RECONNECTED_SOUND_URL);

For more information about sound effects, see the SDK for JavaScript README for Sound effects

Reference

For further detail on Sendbird Calls for JavaScript, refer to Sendbird Calls SDK for JavaScript README.

quickstart-calls-javascript's People

Contributors

danney-chun avatar famous90 avatar git-babel avatar sf-jeff-lim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.