Video Chat app using Gatsby and twilio-8

Welcome to the final part of the series. You can find the part-7 here.

Our web-app is almost finish and only some CSS remains, so let’s start it.

I also want to show the name of the Organiser, so let’s get if from login-form.js. We will use a callback function storeName which is similar to storeToken, to send the name back.

Image for post
Image for post
login-form.js

Next, let’s update in index.js and use the logic similar to that of token. We are passing the name also, to the Video component.

Image for post
Image for post
index.js

Next, let’s update the Video component in the video.js file. Here, we are first importing a video.css file. We will make it soon. After that we are destructuring the name prop.

Image for post
Image for post
video.js

After that in the video.js file, do the following changes. We are first changing the enclosing div to a fragment. After that adding Organiser and using the name prop.

Also adding a h2 for Remote participants. Last adding a className for remoteVideRef div, which we are going to style next.

Image for post
Image for post
video.js

Add a video.css file in the same folder and add this simple styles into it.

Image for post
Image for post
video.css

All the changes are done, so time to test it in localhost. It is working fine and i checked it my logging from three different browsers.

Image for post
Image for post
localhost

It’s time to push the code in github, to deploy it automatically. After, it got deployed i logged in from 3 different devices.

Image for post
Image for post
Deployed

It is working fine but found a bug ie for remote participant it will show his name in place of Organiser. So, let’s change the way it will look for each user. I am now showing the name in Connect, so it will be different for each user.

Image for post
Image for post
video.js

Also, let’s add below lines in video.css file.

Image for post
Image for post
video.css

And it is working fine for different users.

Image for post
Image for post
Organizer
Image for post
Image for post
Participant

I will redeploy now and check the web-app. I am testing with all 3 -2 laptops and 1 phone.

Image for post
Image for post
Working fine

Now, my app is complete and deployed. As told earlier this is a very Simple Video app, which can be created with ease and deployed in no time with netlify.

After that share the link with your known people and enjoy video conferencing. We get 15 dollars free credits from twilio and i used 3.24 dollars while making this project.

Image for post
Image for post
Twilio dashboard

I am submitting the web-app soon for the hackathon, so i had to add a README and LICENSE file. I had added both in my github and also joined the Twilio CodeExchange community

The details about the submission rules are here.

You can also find the code for this project in this github link.

Written by

UI Lead- ReactJS, JavaScript and everything in-between.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store