I'm use nginx-rtmp to convert rtmp to hls and stream in a web page with Clappr. But Clappr take old .ts segment (cause 404 error because it is removed on server). How to fix this ?
Sorry, this is a first time i'm using nginx-rtmp and streaming
Nginx-rtmp config:
rtmp {
server {
listen 1935; # Listen on standard RTMP port
chunk_size 4000;
buflen 1s;
application show {
live on;
record off;
# Turn on HLS
hls on;
hls_path /nginx/hls/;
hls_fragment 600ms;
hls_playlist_length 5s;
# disable consuming the stream from nginx as rtmp
deny play all;
}
}
}
Code to stream on web
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>videojs-contrib-hls embed</title>
<link href="video-js.css" rel="stylesheet">
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/clappr@latest/dist/clappr.min.js">
</script>
</head>
<body>
<div id="player"></div>
<script>
var player = new Clappr.Player({
source: "<my url>",
parentId: "#player",
});
</script>
</body>
</html>