UmairJibran / videoconf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Video Conference Application using AWS Chime SDK

Ref Video: Build Video Chat Application
https://www.youtube.com/watch?v=nydDw4u6hsU

We are using plain Javascript without any frameworks like ReactJS etc.

Generate Amazon Chime SDK Javascript Client Library - single file

git clone https://github.com/aws-samples/amazon-chime-sdk.git
cd amazon-chime-sdk/utils/singlejs

Here make sure that src/index.js looks like this (update it if necessary):
export * as default from 'amazon-chime-sdk-js';

npm install
npm run bundle

This will generate amazon-chime-sdk.min.js in build directory.

Lambda function
server/lambda/index.js

HTML file
web/index.html
The website can be accessed by using <CloudFrontURL>/index.html

Javascript Code
web/assets/js/vid.js
Here you must set the MEETING_SERVICE constant to point to your API ( API Gateway > Lambda function)

How to create an API (Gateway)

Create API
In AWS Console > API Gateway > Create API > Choose API Type > HTTP API > Build >
Provide API Name 'byte-meeting' > For 'Configure Routes' Hit Next > For 'Configure Stages' Hit Next > Review & Create

Configure Routes
Select Routes on left menu > Hit 'Create' on right pane > Choose Method 'ANY' Route '/bytes-meeting' > Create >
Select the newly created route/method > Select 'Attach Integration' > 'Create and Attach Integration'
Choose Integration Target - Integration Type from dropdown : Lambda function , Choose AWS Region ,
Select 'bytes-meeting' lambda function ARN
Make sure "Grant API Gateway permission to invoke your Lambda function" is checked > Hit Create

Enable CORS (Optional)
Select CORS on left menu > Hit Configure button on right
Add * against Access-Control-Allow-Origin hit Add
Add * against Access-Control-Allow-Headers hit Add
Choose * against Access-Control-Allow-Methods hit Add
Leave everything else as default
Save

Deploy API
Select Deploy menu on left > Select Stages > Select your stage $default
Check if under Attached Deployment: Automatic Deployment is Enabled. If yes, you are all set.
If not you must hit the Deploy button at top right to deploy your API

NOTE: Amazon Chime SDK Endpoint has changed!
The endpoint is used in the Lambda function.

Earlier there was a global endpoint (which is being deprecated):
https://service.chime.aws.amazon.com

New regional endpoints are of the form (new customers must use these):
https://meetings-chime.[RegionHere].amazonaws.com
For eg:
https://meetings-chime.us-east-1.amazonaws.com

Complete list of endpoints available here:
https://docs.aws.amazon.com/general/latest/gr/chime-sdk.html
Ref:
https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html
aws/amazon-chime-sdk-js#2697

About


Languages

Language:JavaScript 89.8%Language:HTML 8.4%Language:CSS 1.8%