HLS-over-IPFS-video-player/index.html
2021-11-25 19:21:16 -05:00

69 lines
2.2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HLS over IPFS video player</title>
<link rel="icon" href="favicon.ico">
<style>
* { box-sizing: border-box; }
html, body {
padding: 0;
margin: 0;
}
body {
font-family: sans-serif;
color: white;
background-color: black;
display: flex;
justify-content: center;
align-items: center;
}
code {
white-space: nowrap;
}
#status {
font-size: 2em;
text-align: center;
transition: transform 0.3s 1s ease;
position: fixed;
bottom: 100%;
left: 0;
width: 100%;
height: 3ex;
margin-bottom: -3ex;
}
.is-hiding {
transform: translateY(-3ex)
}
#video {
display: none;
width: 100%;
height: 100%;
}
#help {
max-width: 80ch;
padding: 5em;
}
</style>
<script type="module" defer="" src="./src/index.js"></script>
</head>
<body>
<video id="video" controls="" autoplay=""></video>
<div id="status"></div>
<section id="help">
<h1>HLS over IPFS video player</h1>
<p>This is a tool for viewing videos encoded as <a href="https://github.com/ipfs-examples/js-ipfs-examples/tree/master/examples/browser-video-streaming">HLS</a>. The folder containing this playlist and all its files is uploaded to IPFS, and the hash is provided in the URL as a parameter.</p>
<pre>?hash=QmYzdc44xBkVgp8aWJW57KprjDs5j2hmN8g7eDqm5pvY8L</pre>
<p>It also accepts parameters for <code>source</code> filename (default is <code>master.m3u8</code>) and <code>title</code>.
</p>
<p>Given at least a valid hash, it should play a video in the browser using <a href="https://github.com/ipfs/js-ipfs">JS-IPFS</a> to connect directly to the IPFS network.</p>
<noscript>
<p><strong>Since your browser is not executing JavaScript, none of this will work.</strong></p>
</noscript>
</section>
</body>
</html>