Add VideoJS example to README.md

This commit is contained in:
Laura Hausmann 2021-01-24 04:14:25 +01:00
parent 095f2c66e0
commit c75a435610
Signed by: zotan
GPG key ID: 5EC1D38FFC321311

View file

@ -13,7 +13,7 @@
## Further setup
- Customize privacy policy to your environment if you plan on hosting it publicly
- Set up player, example code below
## nginx-mod-rtmp example config
@ -110,3 +110,25 @@ KillMode=control-group
[Install]
WantedBy=multi-user.target
```
### VideoJS Player example code
```
<link href="https://unpkg.com/video.js/dist/video-js.min.css" rel="stylesheet" />
<style>
html,
body {
margin: 0;
padding: 0;
}
</style>
<div>
<video id='hls-player' class="video-js vjs-default-skin vjs-big-play-centered" controls>
<source type="application/x-mpegURL" src="https://cdn.zotan.stream/hls/<?php echo $_GET["profile"]."/".$_GET["stream"]; ?>.m3u8">
</video>
</div>
<script src="https://unpkg.com/video.js/dist/video.min.js"></script>
<script>
var player = videojs('hls-player', {liveui: true});
player.fill(true);
</script>
```