Add Python video server with range support
Co-authored-by: mathieumoran1 <[email protected]>
This commit is contained in:
co-authored by
mathieumoran1
parent
206ca2e9d7
commit
917cd32e77
@@ -14,3 +14,36 @@ Config those in your .env file:
|
||||
**OMDB_API=**`1234567` (for movie info)
|
||||
|
||||
run with **node .\index.js**
|
||||
|
||||
## Python video file server (mp4/mkv)
|
||||
This repo also includes a small Python server that serves local video files with **HTTP Range** support (required for HTML5 `<video>` seeking).
|
||||
|
||||
- Put your files in: `./media/` (repo root)
|
||||
- Served as: `http://localhost:8001/media/<filename>`
|
||||
- List endpoint: `http://localhost:8001/api/media`
|
||||
|
||||
### Install
|
||||
|
||||
```bash
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
### Run
|
||||
|
||||
```bash
|
||||
python3 video_server.py
|
||||
```
|
||||
|
||||
### Use in the web player
|
||||
Set the movie's `video_src` (or `vod_link`) to something like:
|
||||
|
||||
- `http://localhost:8001/media/MyMovie.mp4`
|
||||
- `http://localhost:8001/media/MyMovie.mkv`
|
||||
|
||||
If the Node app is on a different origin/port, the video server enables CORS by default. You can lock it down with:
|
||||
|
||||
```bash
|
||||
export CORS_ORIGINS="http://localhost:5000"
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user