113 lines
5.5 KiB
HTML
113 lines
5.5 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>Plyr - A simple HTML5 media player</title>
|
|
<meta name="description" content="A simple HTML5 media player with custom controls and WebVTT captions.">
|
|
<meta name="author" content="Sam Potts">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<!-- Styles -->
|
|
<link rel="stylesheet" href="https://cdn.plyr.io/1.3.5/plyr.css">
|
|
|
|
<!-- Docs styles -->
|
|
<link rel="stylesheet" href="https://cdn.plyr.io/1.3.5/docs.css">
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1>Plyr</h1>
|
|
<p>A simple, accessible HTML5 media player by <a href="https://twitter.com/sam_potts" target="_blank">@sam_potts</a> from <a href="https://twitter.com/selz" target="_blank">@selz</a></p>
|
|
<nav>
|
|
<ul>
|
|
<li>
|
|
<a href="https://github.com/selz/plyr" target="_blank" class="btn btn-primary" data-shr-network="github">
|
|
<svg class="icon"><use xlink:href="#icon-github"/></svg>Download on GitHub
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="https://twitter.com/intent/tweet?text=A+simple+HTML5+media+player+with+custom+controls+and+WebVTT+captions.&url=http%3A%2F%2Fplyr.io&via=Sam_Potts" target="_blank" class="btn btn-twitter" data-shr-network="twitter">
|
|
<svg class="icon"><use xlink:href="#icon-twitter"/></svg>Tweet
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
</header>
|
|
|
|
<main role="main" id="main">
|
|
<nav class="btn-bar nav-panel">
|
|
<ul>
|
|
<li>
|
|
<button type="button" class="btn active" data-source="video">Video</button>
|
|
</li>
|
|
<li>
|
|
<button type="button" class="btn" data-source="audio">Audio</button>
|
|
</li>
|
|
<li>
|
|
<button type="button" class="btn btn-youtube" data-source="youtube"><svg class="icon"><use xlink:href="#icon-youtube"/></svg>YouTube</button>
|
|
</li>
|
|
<li>
|
|
<button type="button" class="btn btn-vimeo" data-source="vimeo"><svg class="icon"><use xlink:href="#icon-vimeo"/></svg>Vimeo</button>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
<section>
|
|
<div class="plyr">
|
|
<video poster="https://cdn.selz.com/plyr/1.0/poster.jpg" controls crossorigin>
|
|
<!-- Video files -->
|
|
<source src="https://cdn.selz.com/plyr/1.0/movie.mp4" type="video/mp4">
|
|
<source src="https://cdn.selz.com/plyr/1.0/movie.webm" type="video/webm">
|
|
|
|
<!-- Text track file -->
|
|
<track kind="captions" label="English" srclang="en" src="https://cdn.selz.com/plyr/1.0/example_captions_en.vtt" default>
|
|
|
|
<!-- Fallback for browsers that don't support the <video> element -->
|
|
<a href="https://cdn.selz.com/plyr/1.0/movie.mp4">Download</a>
|
|
</video>
|
|
</div>
|
|
|
|
<ul>
|
|
<li class="cite cite-video"><small><a href="https://www.bigbuckbunny.org" target="_blank">Big Buck Bunny</a> © Copyright 2008, Blender Foundation</small></li>
|
|
<li class="cite cite-audio"><small><a href="https://www.hospitalrecords.com/shop/artist/logistics" target="_blank">96 by Logistics</a> © Copyright, Hospital Records</small></li>
|
|
<li class="cite cite-youtube"><small><a href="https://www.youtube.com/watch?v=Au87oAJ2jeE" target="_blank">Envato's "Made By" interview of Dan Cederholm</a> on <span class="color-youtube"><svg class="icon"><use xlink:href="#icon-youtube"/></svg>YouTube</span></small>
|
|
<li class="cite cite-vimeo"><small><a href="https://vimeo.com/87701971" target="_blank">Yosemite HD II</a> on <span class="color-vimeo"><svg class="icon"><use xlink:href="#icon-vimeo"/></svg>Vimeo</span></small>
|
|
</ul>
|
|
</section>
|
|
</main>
|
|
|
|
<!-- Load SVG defs -->
|
|
<!-- You should bundle all SVG/Icons into one file using a build tool such as gulp and svg store -->
|
|
<script>
|
|
function loadSprite(d, u) {
|
|
var a = new XMLHttpRequest(),
|
|
b = document.body;
|
|
|
|
// If proper CORS supported
|
|
if("withCredentials" in a) {
|
|
a.open("GET", u, true);
|
|
a.send();
|
|
a.onload = function(){
|
|
var c = document.createElement("div");
|
|
c.setAttribute("hidden", "");
|
|
c.innerHTML = a.responseText;
|
|
b.insertBefore(c, b.childNodes[0]);
|
|
}
|
|
}
|
|
}
|
|
// Load the plyr sprite
|
|
loadSprite(document, "../dist/sprite.svg");
|
|
|
|
// This is for the docs only
|
|
loadSprite(document, "dist/sprite.svg");
|
|
</script>
|
|
|
|
<!-- Plyr core script -->
|
|
<script src="https://cdn.plyr.io/1.3.5/plyr.js"></script>
|
|
|
|
<!-- Shr core script -->
|
|
<script src="https://cdn.shr.one/0.1.7/shr.js"></script>
|
|
|
|
<!-- Docs script -->
|
|
<script src="https://cdn.plyr.io/1.3.5/docs.js"></script>
|
|
</body>
|
|
</html>
|