Skip to content

mahm0udnasr/Video-Streaming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Video Streaming Platform

A full-stack video streaming application built with React.js and Node.js that supports HLS (HTTP Live Streaming) video playback and video file uploads.

Features

  • Video upload functionality
  • Automatic conversion to HLS format using FFmpeg
  • Video streaming with adaptive bitrate
  • Support for various video formats
  • Cross-browser compatibility
  • Responsive video player

Tech Stack

Frontend

  • React.js
  • Video.js
  • @videojs/http-streaming
  • Vite

Backend

  • Node.js
  • Express.js
  • Multer for file uploads
  • FFmpeg for video processing
  • CORS enabled

Prerequisites

Before running this project, make sure you have the following installed:

  • Node.js (v14 or higher)
  • FFmpeg
  • npm or yarn

Installation

  1. Clone the repository:
git clone https://github.com/mahm0udnasr/Video-Streaming.git
cd Video-Streaming
  1. Install backend dependencies:
cd server
npm install
  1. Install frontend dependencies:
cd ../client
npm install

Configuration

Backend Configuration

The server runs on port 4000 by default. Make sure the following directories exist:

  • server/uploads/ - for temporary video storage
  • server/uploads/courses/ - for HLS converted videos

Frontend Configuration

The frontend runs on port 5173 (Vite default port). The video player is configured to stream HLS content from the backend server.

Running the Application

  1. Start the backend server:
cd server
npm run dev
  1. Start the frontend application:
cd client
npm run dev
  1. Access the application at http://localhost:5173

Usage

  1. Upload a video file through the web interface
  2. The server will automatically convert the video to HLS format
  3. Once conversion is complete, the video will be available for streaming
  4. The HLS stream URL will be in the format: http://localhost:4000/uploads/courses/{lessonId}/index.m3u8

API Endpoints

  • POST /upload - Upload a video file
  • GET /uploads/* - Stream video files and HLS segments

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.

About

A full-stack video streaming application built with Express and React. This project demonstrates how to serve and stream videos from the backend and play them smoothly on the frontend.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors