File tree Expand file tree Collapse file tree 4 files changed +66
-11
lines changed
Expand file tree Collapse file tree 4 files changed +66
-11
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,10 @@ volumes:
6262* Stream Key: `hello`
6363
6464# ## Watch Stream
65- * In Safari, VLC or any HLS player, open:
65+ * Load up the example hls.js player in your browser:
66+ http://localhost:8080/player/?url=http://localhost:8080/live/hello.m3u8
67+
68+ * Or in Safari, VLC or any HLS player, open:
6669```
6770http://localhost:8080/live/$STREAM_NAME.m3u8
6871```
Original file line number Diff line number Diff line change 4141}
4242
4343http {
44+ root /www/static;
4445 access_log /dev/stdout combined;
4546
4647 ssl_ciphers HIGH:!aNULL:!MD5;
@@ -80,15 +81,14 @@ http {
8081
8182 location /stat {
8283 rtmp_stat all;
83- rtmp_stat_stylesheet static/ stat.xsl;
84+ rtmp_stat_stylesheet stat.xsl;
8485 }
8586
86- location /static {
87- alias /www/static;
87+ location /stat.xsl {
88+ root /www/static;
8889 }
8990
90- location = /crossdomain.xml {
91- root /www/static;
91+ location /crossdomain.xml {
9292 default_type text/xml;
9393 expires 24h;
9494 }
Original file line number Diff line number Diff line change 4141}
4242
4343http {
44+ root /www/static;
4445 access_log /dev/stdout combined;
4546
4647 ssl_ciphers HIGH:!aNULL:!MD5;
@@ -80,15 +81,14 @@ http {
8081
8182 location /stat {
8283 rtmp_stat all;
83- rtmp_stat_stylesheet static/ stat.xsl;
84+ rtmp_stat_stylesheet stat.xsl;
8485 }
8586
86- location /static {
87- alias /www/static;
87+ location /stat.xsl {
88+ root /www/static;
8889 }
8990
90- location = /crossdomain.xml {
91- root /www/static;
91+ location /crossdomain.xml {
9292 default_type text/xml;
9393 expires 24h ;
9494 }
Original file line number Diff line number Diff line change 1+
2+ <!DOCTYPE html>
3+ < html lang ="en ">
4+ < head >
5+ < meta charset ="utf-8 ">
6+ < title > hls.js Player</ title >
7+ < script src ="https://cdn.jsdelivr.net/npm/hls.js@latest "> </ script >
8+ < style >
9+ .container {
10+ width : 80% ;
11+ margin : 0 auto;
12+ }
13+
14+ .video-wrapper {
15+ padding-top : 20px ;
16+ height : 80% ;
17+ margin : 0 auto;
18+ }
19+
20+ video {
21+ display : block;
22+ width : 100% ;
23+ height : 100% ;
24+ }
25+ </ style >
26+ </ head >
27+ < body >
28+ < div class ="container ">
29+ < h1 > hls.js player</ h1 >
30+ < a href ="https://github.com/video-dev/hls.js "> github.com/video-dev/hls.js</ a >
31+ < div class ="video-wrapper ">
32+ < video id ="video " controls muted > </ video >
33+ </ div >
34+ </ div >
35+
36+ < script >
37+ var params = new URLSearchParams ( window . location . search ) ;
38+ var url = params . get ( 'url' ) ;
39+ if ( Hls . isSupported ( ) ) {
40+ var video = document . getElementById ( 'video' ) ;
41+ var hls = new Hls ( ) ;
42+ hls . attachMedia ( video ) ;
43+ hls . on ( Hls . Events . MEDIA_ATTACHED , function ( ) {
44+ hls . loadSource ( url ) ;
45+ hls . on ( Hls . Events . MANIFEST_PARSED , function ( event , data ) {
46+ video . play ( ) ;
47+ } ) ;
48+ } ) ;
49+ }
50+ </ script >
51+ </ body >
52+ </ html >
You can’t perform that action at this time.
0 commit comments