Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tjenkinson/mock-hls-server
Fake a live/event HLS stream from a VOD one. Useful for testing. Supports looping.
https://github.com/tjenkinson/mock-hls-server
cli event-hls-stream hls http-live-streaming live m3u8 m3u8-playlist mock-hls-server playlist proxy segment server stream streaming test testing testing-tools vod
Last synced: 7 days ago
JSON representation
Fake a live/event HLS stream from a VOD one. Useful for testing. Supports looping.
- Host: GitHub
- URL: https://github.com/tjenkinson/mock-hls-server
- Owner: tjenkinson
- License: apache-2.0
- Created: 2018-01-07T17:50:36.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-18T01:41:41.000Z (about 2 months ago)
- Last Synced: 2024-10-12T13:34:00.025Z (27 days ago)
- Topics: cli, event-hls-stream, hls, http-live-streaming, live, m3u8, m3u8-playlist, mock-hls-server, playlist, proxy, segment, server, stream, streaming, test, testing, testing-tools, vod
- Language: JavaScript
- Homepage:
- Size: 544 KB
- Stars: 69
- Watchers: 4
- Forks: 8
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-video - tjenkinson/mock-hls-server - Fake a live/event HLS stream from a VOD one. Useful for testing. - tjenkinson/mock-hls-server (HLS / Talks Presentations Podcasts)
README
[![npm version](https://badge.fury.io/js/mock-hls-server.svg)](https://badge.fury.io/js/mock-hls-server)
# Mock HLS Server
Fake a live/event HLS stream from a VOD one. Useful for testing.# Usage
```
npm install -g mock-hls-server
```
to install globally.```
mock-hls-server
```
will start the server running on "http://localhost:8080".```
mock-hls-server 0.0.0.0 -p 8000 --event
```
will start listening on all interfaces on port 8000. It will also serve the playlist as an EVENT playlist, which means URL's will never be removed from the start.These are all the options:
- `host`
- `port`
- `windowSize`: The number of seconds to keep in the playlist. Not valid with `--event`.
- `initialDuration`: The number of seconds into the stream that should be available on the first playlist request.
- `event`: Changes the playlist type to EVENT, meaning no segments will ever be removed.
- `loop`: Loop the playlist.
- `logLevel`Now start your stream at `http://localhost:8080/proxy?url=`. The first playlist request will start the stream. Variant playlists are supported, and the playlist URL's contained in them will be rewritten to route through the proxy.
The source stream should be a VOD playlist that contains all the segments.
# Example
Run
```
mock-hls-server
```
and then start streaming 'http://localhost:8080/proxy?url=https%3A%2F%2Fdevstreaming-cdn.apple.com%2Fvideos%2Fstreaming%2Fexamples%2Fimg_bipbop_adv_example_ts%2Fmaster.m3u8'