Giter Club home page Giter Club logo

signal-twilio-video-webrtc-go-demo's Introduction

Getting started with Twilio Video WebRTC Go

This repo is an example project to show the least amount of code you need to set up a Twilio Video WebRTC Go room between two participants. It accompanies the SIGNAL 2021 session on Twilio WebRTC Go.

Twilio WebRTC Go is a free service that allows you to build a custom one-to-one video chat application into your website or native application. In Twilio WebRTC Go rooms participants can chat for free. WebRTC go allows up to 500 concurrent participants (250 rooms with 2 participants per room) and unlimited TURN usage.

If you outgrow Twilio WebRTC Go, you can upgrade your room without changing the code as the SDK is the same.

How to run this application

You will need Node.js 12 and a free Twilio account to run this application.

Clone the source code from GitHub:

git clone https://github.com/philnash/signal-twilio-video-webrtc-go-demo.git
cd signal-twilio-video-webrtc-go-demo

Install the dependencies:

npm install

Copy the .env.example file to .env:

cp .env.example

Fill in the .env file with your Twilio Account SID and Auth Token, found on your Twilio console dashboard, and an API Key and Secret, which you can create in the API Keys section of the console.

Run the application with:

npm start

Open localhost:3000/index.html and enter your name and a room name. Submit and you are in your own Twilio Video WebRTC Go room.

Deploy

You can deploy this application to Twilio Functions. Just run:

npm run deploy

How it works

This is a Twilio Functions application made up of static assets and JavaScript Functions.

Functions

There is a Function called token.js that creates a Twilio Video access token for a WebRTC Go room.

Static Assets

In the src directory there is an index.html which is set up for you to enter a username and room name. There is a stylesheet app.css to give the page a little style and an app.js which powers the Video chat.

In app.js the code does the following:

  • Intercept the form submission
  • Make a request to the /token endpoint to retrieve a token for the username and room
  • Use the token with the Twilio Video JS SDK to connect to the room
  • Once the room is connected show the local participant's video on the page
  • Listens to the room for other participants to join and when they do add their media to the page

Check the source code for commented code to show you what is being done.

Find out more

Check out the following to find out more about building Twilio Video WebRTC Go applications:

We can't wait to see what you build with Twilio Video!

signal-twilio-video-webrtc-go-demo's People

Contributors

philnash avatar

Watchers

 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.