diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/error.html | 2 | ||||
-rw-r--r-- | docs/index.html | 55 | ||||
-rw-r--r-- | docs/index.master.html | 130 | ||||
-rw-r--r-- | docs/src/js/docs.js | 8 | ||||
-rw-r--r-- | docs/src/less/components/buttons.less | 8 | ||||
-rw-r--r-- | docs/src/less/components/icons.less | 2 | ||||
-rw-r--r-- | docs/src/less/components/type.less | 4 | ||||
-rw-r--r-- | docs/src/less/docs.less | 2 | ||||
-rw-r--r-- | docs/src/less/variables.less | 2 |
9 files changed, 181 insertions, 32 deletions
diff --git a/docs/error.html b/docs/error.html index de0428d7..8f5086ef 100644 --- a/docs/error.html +++ b/docs/error.html @@ -6,7 +6,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Docs styles --> - <link rel="stylesheet" href="//cdn.plyr.io/1.3.5/docs.css"> + <link rel="stylesheet" href="//cdn.plyr.io/1.3.7/docs.css"> </head> <body> <main> diff --git a/docs/index.html b/docs/index.html index d9c5f9f9..cd4248a0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,10 +8,10 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Styles --> - <link rel="stylesheet" href="https://cdn.plyr.io/1.3.5/plyr.css"> + <link rel="stylesheet" href="https://cdn.plyr.io/1.3.7/plyr.css"> <!-- Docs styles --> - <link rel="stylesheet" href="https://cdn.plyr.io/1.3.5/docs.css"> + <link rel="stylesheet" href="https://cdn.plyr.io/1.3.7/docs.css"> </head> <body> <header> @@ -21,12 +21,12 @@ <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 + <svg class="icon"><use xlink:href="#shr-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 + <svg class="icon"><use xlink:href="#shr-twitter"/></svg>Tweet </a> </li> </ul> @@ -56,9 +56,11 @@ <!-- 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> @@ -77,22 +79,39 @@ <!-- 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; + (function() { + [ + "https://cdn.shr.one/0.1.9/sprite.svg", + "https://cdn.plyr.io/1.3.7/sprite.svg" + ] + .forEach(function(u) { + var x = new XMLHttpRequest(), + b = document.body; + + // Check for CORS support + // If you're loading from same domain, you can remove the if statement + // XHR for Chrome/Firefox/Opera/Safari + if ("withCredentials" in x) { + x.open("GET", u, true); + } + // XDomainRequest for older IE + else if (typeof XDomainRequest != "undefined") { + x = new XDomainRequest(); + x.open("GET", u); + } + else { + return; + } - // If proper CORS supported - if("withCredentials" in a) { - a.open("GET", u, true); - a.send(); - a.onload = function(){ + x.send(); + x.onload = function() { var c = document.createElement("div"); c.setAttribute("hidden", ""); - c.innerHTML = a.responseText; + c.innerHTML = x.responseText; b.insertBefore(c, b.childNodes[0]); } - } - } + }); + })(); // Load the plyr sprite loadSprite(document, "../dist/sprite.svg"); @@ -101,12 +120,12 @@ </script> <!-- Plyr core script --> - <script src="https://cdn.plyr.io/1.3.5/plyr.js"></script> + <script src="https://cdn.plyr.io/1.3.7/plyr.js"></script> <!-- Shr core script --> - <script src="https://cdn.shr.one/0.1.7/shr.js"></script> + <script src="https://cdn.shr.one/0.1.9/shr.js"></script> <!-- Docs script --> - <script src="https://cdn.plyr.io/1.3.5/docs.js"></script> + <script src="https://cdn.plyr.io/1.3.7/docs.js"></script> </body> </html> diff --git a/docs/index.master.html b/docs/index.master.html new file mode 100644 index 00000000..c6972ae6 --- /dev/null +++ b/docs/index.master.html @@ -0,0 +1,130 @@ +<!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="../dist/plyr.css"> + + <!-- Docs styles --> + <link rel="stylesheet" href="dist/docs.css"> + </head> + <body> + <header> + <h1>Plyr</h1> + <p>A simple HTML5 media player with custom controls and WebVTT captions 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="#shr-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="#shr-twitter"/></svg>Tweet + </a> + </li> + </ul> + </nav> + </header> + + <main role="main" id="main"> + <nav class="btn-bar nav-panel"> + <ul> + <li><a href="#video" class="btn active btn-small">Video</a></li> + <li><a href="#youtube" class="btn btn-small">YouTube</a></li> + <li><a href="#audio" class="btn btn-small">Audio</a></li> + </ul> + </nav> + <div class="panels"> + <section class="panel example-video active" id="video"> + <div class="player"> + <video poster="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> + <small>Big Buck Bunny. More info can be found at <a href="https://peach.blender.org" target="_blank">peach.blender.org</a>.</small> + </section> + <section class="panel example-video" id="youtube"> + <div class="player"> + <div data-video-id="Au87oAJ2jeE" data-type="youtube"></div> + </div> + <small>Envato's "Made By" interview of <a href="https://www.youtube.com/watch?v=Au87oAJ2jeE" target="_blank">Dan Cederholm</a> from <a href="https://dribbble.com" target="_blank">Dribbble</a>.</small> + </section> + <section class="panel example-audio" id="audio"> + <div class="player"> + <audio controls> + <!-- Audio files --> + <source src="//cdn.selz.com/plyr/1.0/logistics-96-sample.mp3" type="audio/mp3"> + <source src="//cdn.selz.com/plyr/1.0/logistics-96-sample.ogg" type="audio/ogg"> + + <!-- Fallback for browsers that don't support the <audio> element --> + <a href="//cdn.selz.com/plyr/1.0/logistics-96-sample.mp3">Download</a> + </audio> + </div> + <small>"96" by Logistics, which can be purchased from <a href="https://www.hospitalrecords.com/shop/artist/logistics" target="_blank">Hospital Records</a>.</small> + </section> + </div> + </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() { + [ + "https://cdn.shr.one/0.1.9/sprite.svg", + "../dist/sprite.svg" + ] + .forEach(function(u) { + var x = new XMLHttpRequest(), + b = document.body; + + // Check for CORS support + // If you're loading from same domain, you can remove the if statement + // XHR for Chrome/Firefox/Opera/Safari + if ("withCredentials" in x) { + x.open("GET", u, true); + } + // XDomainRequest for older IE + else if (typeof XDomainRequest != "undefined") { + x = new XDomainRequest(); + x.open("GET", u); + } + else { + return; + } + + x.send(); + x.onload = function() { + var c = document.createElement("div"); + c.setAttribute("hidden", ""); + c.innerHTML = x.responseText; + b.insertBefore(c, b.childNodes[0]); + } + }); + })(); + </script> + + <!-- Plyr core script --> + <script src="../src/js/plyr.js"></script> + + <!-- Shr core script --> + <script src="https://cdn.shr.one/0.1.9/shr.js"></script> + + <!-- Docs script --> + <script src="dist/docs.js"></script> + </body> +</html> diff --git a/docs/src/js/docs.js b/docs/src/js/docs.js index 4e2208ee..1e3c3206 100644 --- a/docs/src/js/docs.js +++ b/docs/src/js/docs.js @@ -2,7 +2,7 @@ // Docs example // ========================================================================== -/*global plyr, shr */ +/*global plyr, shr*/ // Setup the player plyr.setup({ @@ -25,7 +25,7 @@ shr.setup({ }); // General functions -(function() { +(function() { var buttons = document.querySelectorAll('[data-source]'); // Bind to each button @@ -103,7 +103,7 @@ shr.setup({ } })(); -// Google analytics +// Google analytics // For demo site (http://[www.]plyr.io) only if(document.domain.indexOf('plyr.io') > -1) { (function(i,s,o,g,r,a,m){i.GoogleAnalyticsObject=r;i[r]=i[r]||function(){ @@ -112,4 +112,4 @@ if(document.domain.indexOf('plyr.io') > -1) { })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-40881672-11', 'auto'); ga('send', 'pageview'); -}
\ No newline at end of file +} diff --git a/docs/src/less/components/buttons.less b/docs/src/less/components/buttons.less index 066011fe..1401cd01 100644 --- a/docs/src/less/components/buttons.less +++ b/docs/src/less/components/buttons.less @@ -78,7 +78,7 @@ nav { } } -// Shared +// Shared .btn, .btn-count { display: inline-block; @@ -88,7 +88,7 @@ nav { user-select: none; } -// Buttons +// Buttons .btn { padding: (@padding-base / 2) @padding-base; background: @body-background; @@ -121,7 +121,7 @@ nav { box-shadow: 0 1px 1px rgba(0,0,0, .15); text-shadow: 0 1px 1px rgba(0,0,0, .1); color: #fff; - + &:hover, &:focus { color: #fff; @@ -156,4 +156,4 @@ nav { border-width: 1px 0 0 1px; transform: rotate(-45deg) translate(-50%, -50%); } -}
\ No newline at end of file +} diff --git a/docs/src/less/components/icons.less b/docs/src/less/components/icons.less index 882ce25d..7bcc792e 100644 --- a/docs/src/less/components/icons.less +++ b/docs/src/less/components/icons.less @@ -19,4 +19,4 @@ label svg { a .icon, .btn .icon { margin-right: (@padding-base / 2); -}
\ No newline at end of file +} diff --git a/docs/src/less/components/type.less b/docs/src/less/components/type.less index 7b214b49..8fc200e2 100644 --- a/docs/src/less/components/type.less +++ b/docs/src/less/components/type.less @@ -29,7 +29,7 @@ small { ul li { list-style: none; - margin: 0; + margin: 0; padding: 0; } @@ -58,4 +58,4 @@ a { } .color-youtube { color: @color-youtube; -}
\ No newline at end of file +} diff --git a/docs/src/less/docs.less b/docs/src/less/docs.less index ea799382..965dcba1 100644 --- a/docs/src/less/docs.less +++ b/docs/src/less/docs.less @@ -24,4 +24,4 @@ @import "components/buttons.less"; @import "components/panels.less"; @import "components/error.less"; -@import "components/examples.less";
\ No newline at end of file +@import "components/examples.less"; diff --git a/docs/src/less/variables.less b/docs/src/less/variables.less index 8cb4bc1b..097aa1f2 100644 --- a/docs/src/less/variables.less +++ b/docs/src/less/variables.less @@ -35,4 +35,4 @@ // Examples @example-width-audio: 520px; -@example-width-video: 1200px;
\ No newline at end of file +@example-width-video: 1200px; |