This is the code that runs https://bandolier.learnjsthehardway.com/ for you to review. It uses the https://git.learnjsthehardway.com/learn-javascript-the-hard-way/bandolier-template to create the documentation for the project.
https://bandolier.learnjsthehardway.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
937 B
52 lines
937 B
2 years ago
|
<!doctype html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="utf-8">
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
|
|
||
|
<script type="module" src="/js/webtorrent.js">
|
||
|
</script>
|
||
|
|
||
|
<script type="module">
|
||
|
const wt_opts = {
|
||
|
use_dht: false,
|
||
|
private: true,
|
||
|
tracker: true,
|
||
|
webSeeds: true,
|
||
|
maxConns: 50
|
||
|
}
|
||
|
|
||
|
let client = new WebTorrent(wt_opts);
|
||
|
|
||
|
function onTorrent(torrent) {
|
||
|
console.log(torrent.files);
|
||
|
const file = torrent.files[0];
|
||
|
file.renderTo("#video-player");
|
||
|
}
|
||
|
|
||
|
client.add("${base_host}${media.torrent_url}", onTorrent);
|
||
|
</script>
|
||
|
|
||
|
<title>${ site_name }: ${ media.title }</title>
|
||
|
|
||
|
<style>
|
||
|
body {
|
||
|
margin: 0px;
|
||
|
padding: 0px;
|
||
|
}
|
||
|
|
||
|
video {
|
||
|
max-width: 100vw;
|
||
|
min-width: 100vw;
|
||
|
width: 100vw;
|
||
|
}
|
||
|
</style>
|
||
|
</head>
|
||
|
|
||
|
<video id="video-player" poster="${ media.poster }">
|
||
|
</video>
|
||
|
|
||
|
<body>
|
||
|
</body>
|
||
|
</html>
|