I did, and i tried all kinds of ways even with ports in the address etc. the m3u8 file appeared in D:/streami/testi2/tmp/hls but i dont think the player got it since i got errors and usually i tried obs server rtmp://192.168.1.2/hls and i tried different sources too (myip is my external ip or dns):
Code:
<source src="http://myip/hls/stream.m3u8" type="application/x-mpegURL">
<source src="http://myip/hls/stream" type="application/x-mpegURL">
<source src="http://myip:8080/hls/stream.m3u8" type="application/x-mpegURL">
also in many guides there was no mention of videojs-contrib-hls.min.js file which i suppose is needed? Tried it aswell...
in obs i tried
rtmp://192.168.1.2/hls
rtmp://192.168.1.2:1935/hls
rtmp://192.168.1.2:8080/hls
with key: stream
with these .js files scripted
video.js , video-js.css , videojs-ie8.min.js , videojs-contrib-hls.min.js
here is my player:
Code:
<video id="my-video" class="video-js vjs-default-skin vjs-16-9 vjs-big-play-centered" controls poster="images/poster.jpg" preload="auto" data-setup="{}">
<source src="http://myip:8080/hls/stream.m3u8" type="application/x-mpegURL">
<p class="vjs-no-js">
To view this video please enable JavaScript, and consider upgrading to a web browser that
<a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
</p>
</video>
<script src="video-js-5.11.6/video.js"></script>
<script src="video-js-5.11.6/videojs-contrib-hls.min.js"></script>
here is my nginx.conf:
Code:
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
rtmp {
server {
listen 1935;
chunk_size 4000;
application hls {
live on;
hls on;
hls_path tmp/hls;
}
# MPEG-DASH is similar to HLS
application dash {
live on;
dash on;
dash_path tmp/dash;
}
}
}
http {
server {
listen 8080;
location /hls {
# Serve HLS fragments
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /tmp;
add_header Cache-Control no-cache;
}
location /dash {
# Serve DASH fragments
root /tmp;
add_header Cache-Control no-cache;
}
}
}
here one of the errors i encountered, maybe something to do with hls_path that i edited in nginx.conf to tmp/hls; (in guide examples /tmp/hls; but then nginx wouldnt even start)
Code:
2016/09/09 00:01:23 [emerg] 11396#9592: CreateDirectory() "/tmp/hls" failed (3: The system cannot find the path specified)
2016/09/09 07:32:50 [error] 5460#11168: *5 CreateFile() "D:/tmp/hls/stream.m3u8" failed (3: The system cannot find the path specified), client: 192.168.1.1, server: , request: "GET /hls/stream.m3u8 HTTP/1.1", host: "myip:8080", referrer: "http://mywebpage.com/?page=privatestream"
so the real path of stream.m3u8 is D:/streami/testi2/tmp/hls/stream.m3u8 so its probably not picking it up?