Skip to content

ammar-hup/video-chat-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

19 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฅ Trying to make a Video chat application using 2 different API services: Agora & videosdk

1- Agora: Python & building self JS UI

2- VideoSDK: Python & JS prebuilt UI

A comprehensive video chat application built with VideoSDK, featuring both Python and web interfaces for real-time video communication.

VideoSDK Chat Python HTML5 License

โœจ Features

  • ๐Ÿ Python Application: Command-line video chat client
  • ๐ŸŒ Web Interface: Beautiful, responsive web-based video chat
  • ๐Ÿ” JWT Authentication: Automatic token generation from API credentials
  • ๐ŸŽ›๏ธ Media Controls: Toggle camera and microphone on/off
  • ๐Ÿ‘ฅ Multi-participant: Support for multiple users in the same room
  • ๐Ÿ“ฑ Responsive Design: Works on desktop and mobile browsers
  • ๐Ÿ”ง Easy Setup: Simple configuration with environment variables

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.12+
  • VideoSDK account and API credentials
  • Modern web browser (for web interface)

Installation

  1. Clone the repository

    git clone https://github.com/ammar-hup/videosdk-chat-app.git
    cd videosdk-chat-app
  2. Create virtual environment

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Get VideoSDK credentials

  5. Configure environment

    cp .env.example .env

    Edit .env and add your credentials:

    VIDEOSDK_API_KEY=your-api-key-here
    VIDEOSDK_SECRET=your-secret-here
    VIDEOSDK_MEETING_ID=test-room-123
    VIDEOSDK_NAME=Your Name

๐ŸŽฎ Usage

Python Application

python videochat.py

Web Interface

  1. Start the web server

    python server.py
  2. Open your browser Go to http://localhost:8000

  3. Join the meeting Click "Join Meeting" and allow camera/microphone access

Multi-user Testing

  1. Start the Python app: python videochat.py
  2. Start the web server: python server.py
  3. Open the web interface and join the same room
  4. Both participants will be in the same meeting!

๐Ÿ› ๏ธ Utilities

Generate Fresh Tokens

python generate_token.py

Test API Credentials

python test_credentials.py

๐Ÿ“ Project Structure

videosdk-chat-app/
โ”œโ”€โ”€ videochat.py          # Main Python video chat application
โ”œโ”€โ”€ index.html            # Web-based video chat interface
โ”œโ”€โ”€ server.py             # HTTP server for web interface
โ”œโ”€โ”€ generate_token.py     # JWT token generation utility
โ”œโ”€โ”€ test_credentials.py   # API credential testing tool
โ”œโ”€โ”€ requirements.txt      # Python dependencies
โ”œโ”€โ”€ .env.example          # Environment variables template
โ”œโ”€โ”€ .gitignore           # Git ignore file
โ””โ”€โ”€ README.md            # This file

๐Ÿ”ง Configuration

Environment Variables

Variable Description Example
VIDEOSDK_API_KEY Your VideoSDK API Key 07ab89f3-150b-442d-8c0b-711133e64753
VIDEOSDK_SECRET Your VideoSDK Secret 885c58a5977234a60f629...
VIDEOSDK_MEETING_ID Room ID to join test-room-123
VIDEOSDK_NAME Your display name Your Name

Token Generation

The application automatically generates JWT tokens from your API key and secret. Tokens are valid for 24 hours by default.

๐ŸŒ Web Interface Features

  • Modern UI: Clean, responsive design with gradient backgrounds
  • Real-time Video: Live video streaming with WebRTC
  • Media Controls: Mute/unmute microphone and camera
  • Status Indicators: Connection status and participant count
  • Cross-browser: Works on Chrome, Firefox, Safari, and Edge

๐Ÿ› Troubleshooting

Common Issues

  1. "Token is invalid" error

    • Generate a fresh token with python generate_token.py
    • Check that your API key and secret are correct
  2. Camera/microphone not working

    • Allow browser permissions for camera and microphone
    • Check that no other application is using the camera
  3. Connection fails

    • Verify your internet connection
    • Check that the meeting ID is correct

Debug Mode

Add debug logging by setting the log level in your Python scripts:

import logging
logging.basicConfig(level=logging.DEBUG)

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • VideoSDK for providing the excellent video communication platform
  • WebRTC for real-time communication standards
  • The open-source community for inspiration and tools

๐Ÿ”— Links


Made with โค๏ธ by [Your Name]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors