- Ingest url:
rtmp://example.com/live
- Player url: http://example.com/?key=STREAM_KEY
Last active
May 16, 2022 21:23
-
-
Save ZipFile/a96f3b87559d1c47549c843ab17a56c4 to your computer and use it in GitHub Desktop.
DIY stream testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Stream Testing</title> | |
<script defer src="http://cdn.dashjs.org/latest/dash.all.min.js"></script> | |
<style> | |
:root {background: black; color: #ccc;} | |
body {margin: 0;} | |
video {width: 100%; height: 100%;} | |
</style> | |
</head> | |
<body> | |
<video id="player" data-dashjs-player autoplay controls></video> | |
<script> | |
const url = new URL(document.location.href); | |
const src = url.searchParams.get("src"); | |
const key = url.searchParams.get("key"); | |
const player = document.getElementById("player"); | |
player.src = key ? `dash/${key}.mpd` : src; | |
</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rtmp { | |
server { | |
listen 1935; | |
chunk_size 4096; | |
application live { | |
live on; | |
record off; | |
hls on; | |
hls_path /tmp/hls; | |
dash on; | |
dash_path /tmp/dash; | |
deny play all; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
server_name example.com; | |
location / { | |
root /srv/stream; # index.html goes here | |
} | |
location /stat { | |
rtmp_stat all; | |
} | |
location /hls { | |
types { | |
application/vnd.apple.mpegurl m3u8; | |
video/mp2t ts; | |
} | |
root /tmp; | |
add_header Cache-Control no-cache; | |
} | |
location /dash { | |
root /tmp; | |
add_header Cache-Control no-cache; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment