Welcome to Just Another Player, which has been a fun and educational project designed to help me learn about video playback using Media Source Extensions (MSE) and Adaptive Bitrate (ABR) algorithms. This project is a hands-on way to learn about video streaming technologies, ABR strategies, and how to build a custom video player. It's very much still in progress, and I hope to continue to add and update different ABR algorithms.
- About the Project
- Features
- Getting Started
- Prerequisites
- Installation
- Usage
- Folder Structure
- ABR Algorithms
- Learning Goals
- Contributing
- License
This project is a custom video player built with TypeScript, React, and MSE (Media Source Extensions). It supports multiple ABR (Adaptive Bitrate) algorithms and allows you to experiment with video playback, quality switching, and buffering strategies.
The goal is to provide a platform for learning and experimenting with video streaming technologies while having fun building something cool.
- Custom Video Player: Built from scratch using MSE for video playback.
- ABR Algorithms: Includes both Fixed ABR and Buffer-Based ABR strategies. I am still working on these, and would also like to add a Throughput-based algorithm.
- Manual Quality Selection: Switch between video qualities using a simple UI.
- HLS Playback: Supports
.m3u8
playlists and.ts
segments. - Clean Architecture: Modular design for easy experimentation and learning.
Before you begin, ensure you have the following installed:
- Node.js (v16 or higher)
- npm or yarn
- A modern browser that supports Media Source Extensions (MSE) (e.g., Chrome, Edge, or Firefox).
-
Clone the repository
-
Install dependencies:
npm install
-
Start the development server:
npm start
-
Open your browser and navigate to:
http://localhost:5173
- Place your
.m3u8
playlist and.ts
segments in the hls folder, or add an m3u8 to the UI's input field. - Update the src prop in the
Player
component with the path to your.m3u8
file:<Player src="http://localhost:5173/hls/master.m3u8" abrManager="buffer" />
- Use the Quality Selector to manually switch between video qualities or let the ABR algorithm handle it automatically.
just-another-player/
├── public/
│ ├── hls/ # HLS playlists and segments
│ └── ...
├── src/
│ ├── abr/ # ABR algorithms (Fixed and Buffer-Based)
│ ├── components/ # React components (Player, QualitySelector, etc.)
│ ├── playback-engine/ # MSEEngine and related logic
│ ├── types/ # TypeScript type definitions
│ ├── utils/ # Utility functions (e.g., playlist fetching)
│ └── ...
├── index.html # Entry point for the app
├── package.json # Project dependencies and scripts
└── README.md # Project documentation
- Selects a fixed quality based on user input.
- Useful for manual quality selection and testing.
- Dynamically adjusts quality based on buffer length.
- Switches to lower quality when the buffer is low and higher quality when the buffer is sufficient.
- Dynamically adjusts quality based on measured network throughput.
- Selects the highest quality that can be streamed without causing buffering.
- Adapts quickly to changes in network conditions to ensure smooth playback.
This project was designed to help me learn about:
-
Media Source Extensions (MSE):
- How to use MSE to play
.ts
segments. - Managing
SourceBuffer
andMediaSource
for seamless playback.
- How to use MSE to play
-
Adaptive Bitrate (ABR) Algorithms:
- Implementing and experimenting with different ABR strategies.
- Understanding how ABR impacts user experience and playback quality.
-
Video Streaming Concepts:
- HLS (HTTP Live Streaming) and
.m3u8
playlists. - Buffering, seeking, and codec management.
- HLS (HTTP Live Streaming) and
-
Frontend Development:
- Building a modular React application with TypeScript.
- Creating reusable components like
Player
andQualitySelector
.
-
Building and Deploying from Scratch:
- Designing and implementing a video player from the ground up.
- Setting up a development workflow, including build tools and scripts.
- Learning how to deploy the application to a live environment for others to use and test.
This project is licensed under the MIT License. See the LICENSE file for details.