loading...
Cover image for TwilioHackathon - Video Chat app using Gatsby and twilio-8

TwilioHackathon - Video Chat app using Gatsby and twilio-8

nabendu82 profile image Nabendu Updated on ・3 min read

Alt Text
Welcome to the final part of the series. 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.

login-form.jslogin-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.

index.jsindex.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.

video.jsvideo.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.

video.jsvideo.js

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

video.cssvideo.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.

localhostlocalhost

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

DeployedDeployed

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.

video.jsvideo.js

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

video.cssvideo.css

And it is working fine for different users.

OrganizerOrganizer

ParticipantParticipant

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

Working fineWorking 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.

Twilio dashboardTwilio 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.

Posted on by:

nabendu82 profile

Nabendu

@nabendu82

Fullstack JS dev, Upcoming Author "Gatsby Cookbook"

Discussion

markdown guide