This project is an HLS video player featuring dynamic text and logo overlays that can be added, edited, moved, resized, or deleted in real-time. Ideal for livestream branding, captions, or announcements, it’s built with Flask and MongoDB Atlas, providing full CRUD support for managing overlays seamlessly during playback.
- Frontend: React.js, HLS.js, React-RND (draggable/resizable overlays)
- Backend: Python Flask + MongoDB Atlas
- Styling: CSS (custom + responsive)
┣ 📂 backend # Flask + MongoDB API
┃ ┣ app.py
┃ ┣ requirements.txt
┣ 📂 frontend # React HLS Player + Overlay Form
┃ ┣ src/
┃ ┣ package.json
┣ README.md # Setup + Docsgit clone https://github.com/your-username/Livestream-RTSP-URL.git
cd backendpython -m venv venv
source venv/bin/activate # for Mac/Linux
venv\Scripts\activate # for Windowspip install -r requirements.txtclient = MongoClient("mongodb+srv://<username>:<password>@cluster-url")python app.pyServer will run on:
👉 http://127.0.0.1:5000/cd frontend
npm install
npm starthttp://127.0.0.1:5000POST
/overlay Add a new overlay (text and/or logo). Request Body (JSON)
{
"name": "welcome",
"text": "Hello World!",
"logo": "https://example.com/logo.png](https://upload.wikimedia.org/wikipedia/commons/a/a7/React-icon.svg",
"top": "50px",
"left": "100px",
"size": "24px"
}Response
{ "message": "Overlay saved successfully" }GET
/overlay Response
[
{
"name": "welcome",
"text": "Hello World!",
"logo": "https://example.com/logo.png",
"top": "50px",
"left": "100px",
"size": "24px"
}
]PUT
/overlay/<name>Update overlay text, logo, or position.
Request Body (JSON)
{
"text": "Updated Text",
"top": "80px",
"left": "120px",
"size": "30px"
}Response
{ "message": "Overlay updated successfully" }DELETE
/overlay/<name>Response
{ "message": "Overlay deleted successfully" }