Merge branch 'master' into master
This commit is contained in:
commit
e98d356ede
2
.github/pull_request_template.md
vendored
2
.github/pull_request_template.md
vendored
@ -4,5 +4,5 @@
|
|||||||
|
|
||||||
### Task list
|
### Task list
|
||||||
|
|
||||||
- [ ] Tested on [supported browsers](https://github.com/Selz/plyr#browser-support)
|
- [ ] Tested on [supported browsers](https://github.com/sampotts/plyr#browser-support)
|
||||||
- [ ] Gulp build completed
|
- [ ] Gulp build completed
|
@ -9,7 +9,7 @@
|
|||||||
"HTml5 Video"
|
"HTml5 Video"
|
||||||
],
|
],
|
||||||
"authors": [
|
"authors": [
|
||||||
"Sam Potts <me@sampotts.me>"
|
"Sam Potts <sam@potts.es>"
|
||||||
],
|
],
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"main": [
|
"main": [
|
||||||
@ -27,7 +27,7 @@
|
|||||||
],
|
],
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git://github.com/selz/plyr.git"
|
"url": "git://github.com/sampotts/plyr.git"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
}
|
}
|
||||||
|
16
changelog.md
16
changelog.md
@ -1,8 +1,20 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v2.0.16
|
||||||
|
- Fullscreen bug fix (fixes #664)
|
||||||
|
|
||||||
|
## v2.0.15
|
||||||
|
- Demo fix
|
||||||
|
|
||||||
|
## v2.0.14
|
||||||
|
- CDN URL updates. Sorry, still working on V3 as hard as I can...
|
||||||
|
|
||||||
|
## v2.0.13
|
||||||
|
- Repo moved and Vimeo demo fix
|
||||||
|
|
||||||
## v2.0.12
|
## v2.0.12
|
||||||
- Ability to set custom `blankUrl` for source changes (https://github.com/Selz/plyr/pull/504)
|
- Ability to set custom `blankUrl` for source changes (https://github.com/sampotts/plyr/pull/504)
|
||||||
- Ability to set caption button listener (https://github.com/Selz/plyr/pull/468)
|
- Ability to set caption button listener (https://github.com/sampotts/plyr/pull/468)
|
||||||
|
|
||||||
## v2.0.11
|
## v2.0.11
|
||||||
- Fix for `cleanUp` being called twice (thanks to @sebastiancarlsson)
|
- Fix for `cleanUp` being called twice (thanks to @sebastiancarlsson)
|
||||||
|
@ -37,6 +37,7 @@ You need to add several placeholders to your html template that are replaced whe
|
|||||||
|
|
||||||
- `{id}` - the dynamically generated ID for the player (for form controls)
|
- `{id}` - the dynamically generated ID for the player (for form controls)
|
||||||
- `{seektime}` - the seek time specified in options for fast forward and rewind
|
- `{seektime}` - the seek time specified in options for fast forward and rewind
|
||||||
|
- `{title}` - the title of your media, if specified
|
||||||
|
|
||||||
You can include only the controls you need when specifying custom html.
|
You can include only the controls you need when specifying custom html.
|
||||||
|
|
||||||
|
2
demo/dist/demo.css
vendored
2
demo/dist/demo.css
vendored
File diff suppressed because one or more lines are too long
@ -1,5 +1,6 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en" class="error">
|
<html lang="en" class="error">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Doh. Looks like something went wrong.</title>
|
<title>Doh. Looks like something went wrong.</title>
|
||||||
@ -7,7 +8,12 @@
|
|||||||
|
|
||||||
<!-- Docs styles -->
|
<!-- Docs styles -->
|
||||||
<link rel="stylesheet" href="dist/demo.css">
|
<link rel="stylesheet" href="dist/demo.css">
|
||||||
|
|
||||||
|
<!-- Preload -->
|
||||||
|
<link rel="preload" as="font" crossorigin type="font/woff2" href="https://cdn.plyr.io/static/fonts/avenir-medium.woff2">
|
||||||
|
<link rel="preload" as="font" crossorigin type="font/woff2" href="https://cdn.plyr.io/static/fonts/avenir-bold.woff2">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<main>
|
<main>
|
||||||
<h1>Doh.</h1>
|
<h1>Doh.</h1>
|
||||||
@ -15,4 +21,5 @@
|
|||||||
<a href="http://plyr.io" class="btn btn--primary">Back to plyr.io</a>
|
<a href="http://plyr.io" class="btn btn--primary">Back to plyr.io</a>
|
||||||
</main>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -1,5 +1,6 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Plyr - A simple HTML5 media player</title>
|
<title>Plyr - A simple HTML5 media player</title>
|
||||||
@ -12,21 +13,31 @@
|
|||||||
|
|
||||||
<!-- Docs styles -->
|
<!-- Docs styles -->
|
||||||
<link rel="stylesheet" href="dist/demo.css">
|
<link rel="stylesheet" href="dist/demo.css">
|
||||||
|
|
||||||
|
<!-- Preload -->
|
||||||
|
<link rel="preload" as="font" crossorigin type="font/woff2" href="https://cdn.plyr.io/static/fonts/avenir-medium.woff2">
|
||||||
|
<link rel="preload" as="font" crossorigin type="font/woff2" href="https://cdn.plyr.io/static/fonts/avenir-bold.woff2">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<h1>Plyr</h1>
|
<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>
|
<p>A simple, accessible HTML5 media player by <a href="https://twitter.com/sam_potts" target="_blank">@sam_potts</a></p>
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://github.com/selz/plyr" target="_blank" class="btn btn--large btn--primary" data-shr-network="github">
|
<a href="https://github.com/sampotts/plyr" target="_blank" class="btn btn--large btn--primary" data-shr-network="github">
|
||||||
<svg class="icon"><use xlink:href="#icon-github"/></svg>Download on GitHub
|
<svg class="icon">
|
||||||
|
<use xlink:href="#icon-github" />
|
||||||
|
</svg>Download on GitHub
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<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--large btn--twitter" data-shr-network="twitter">
|
<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"
|
||||||
<svg class="icon"><use xlink:href="#icon-twitter"/></svg>Tweet
|
target="_blank" class="btn btn--large btn--twitter" data-shr-network="twitter">
|
||||||
|
<svg class="icon">
|
||||||
|
<use xlink:href="#icon-twitter" />
|
||||||
|
</svg>Tweet
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -51,16 +62,17 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<section>
|
<section>
|
||||||
<video poster="https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.jpg?v1" controls crossorigin>
|
<video poster="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg?v1" controls crossorigin>
|
||||||
<!-- Video files -->
|
<!-- Video files -->
|
||||||
<source src="https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.mp4" type="video/mp4">
|
<source src="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.mp4" type="video/mp4">
|
||||||
<source src="https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.webm" type="video/webm">
|
<source src="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.webm" type="video/webm">
|
||||||
|
|
||||||
<!-- Text track file -->
|
<!-- Text track file -->
|
||||||
<track kind="captions" label="English" srclang="en" src="https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.en.vtt" default>
|
<track kind="captions" label="English" srclang="en" src="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.en.vtt"
|
||||||
|
default>
|
||||||
|
|
||||||
<!-- Fallback for browsers that don't support the <video> element -->
|
<!-- Fallback for browsers that don't support the <video> element -->
|
||||||
<a href="https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.mp4" download>Download</a>
|
<a href="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.mp4" download>Download</a>
|
||||||
</video>
|
</video>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
@ -79,10 +91,13 @@
|
|||||||
<script src="dist/demo.js"></script>
|
<script src="dist/demo.js"></script>
|
||||||
|
|
||||||
<!-- Rangetouch to fix <input type="range"> on touch devices (see https://rangetouch.com) -->
|
<!-- Rangetouch to fix <input type="range"> on touch devices (see https://rangetouch.com) -->
|
||||||
<script src="https://cdn.rangetouch.com/0.0.9/rangetouch.js" async></script>
|
<script src="https://cdn.rangetouch.com/1.0.1/rangetouch.js" async></script>
|
||||||
|
|
||||||
<!-- Sharing libary (https://shr.one) -->
|
<!-- Sharing libary (https://shr.one) -->
|
||||||
<script src="https://cdn.shr.one/0.1.9/shr.js"></script>
|
<script src="https://cdn.shr.one/1.0.1/shr.js"></script>
|
||||||
<script>if(window.shr) { window.shr.setup({ count: { classname: 'btn__count' } }); }</script>
|
<script>
|
||||||
|
if (window.shr) { window.shr.setup({ count: { classname: 'btn__count' } }); }
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -7,14 +7,14 @@
|
|||||||
/*global plyr*/
|
/*global plyr*/
|
||||||
|
|
||||||
// General functions
|
// General functions
|
||||||
;(function() {
|
(function() {
|
||||||
//document.body.addEventListener('ready', function(event) { console.log(event); });
|
//document.body.addEventListener('ready', function(event) { console.log(event); });
|
||||||
|
|
||||||
// Setup the player
|
// Setup the player
|
||||||
var instances = plyr.setup({
|
var instances = plyr.setup({
|
||||||
debug: true,
|
debug: true,
|
||||||
title: 'Video demo',
|
title: "Video demo",
|
||||||
iconUrl: '../dist/plyr.svg',
|
iconUrl: "../dist/plyr.svg",
|
||||||
tooltips: {
|
tooltips: {
|
||||||
controls: true
|
controls: true
|
||||||
},
|
},
|
||||||
@ -22,38 +22,38 @@
|
|||||||
defaultActive: true
|
defaultActive: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
plyr.loadSprite('dist/demo.svg');
|
plyr.loadSprite("dist/demo.svg");
|
||||||
|
|
||||||
// Plyr returns an array regardless
|
// Plyr returns an array regardless
|
||||||
var player = instances[0];
|
var player = instances[0];
|
||||||
|
|
||||||
// Setup type toggle
|
// Setup type toggle
|
||||||
var buttons = document.querySelectorAll('[data-source]'),
|
var buttons = document.querySelectorAll("[data-source]"),
|
||||||
types = {
|
types = {
|
||||||
video: 'video',
|
video: "video",
|
||||||
audio: 'audio',
|
audio: "audio",
|
||||||
youtube: 'youtube',
|
youtube: "youtube",
|
||||||
vimeo: 'vimeo'
|
vimeo: "vimeo"
|
||||||
},
|
},
|
||||||
currentType = window.location.hash.replace('#', ''),
|
currentType = window.location.hash.replace("#", ""),
|
||||||
historySupport = (window.history && window.history.pushState);
|
historySupport = window.history && window.history.pushState;
|
||||||
|
|
||||||
// Bind to each button
|
// Bind to each button
|
||||||
for (var i = buttons.length - 1; i >= 0; i--) {
|
for (var i = buttons.length - 1; i >= 0; i--) {
|
||||||
buttons[i].addEventListener('click', function() {
|
buttons[i].addEventListener("click", function() {
|
||||||
var type = this.getAttribute('data-source');
|
var type = this.getAttribute("data-source");
|
||||||
|
|
||||||
newSource(type);
|
newSource(type);
|
||||||
|
|
||||||
if (historySupport) {
|
if (historySupport) {
|
||||||
history.pushState({ 'type': type }, '', '#' + type);
|
history.pushState({ type: type }, "", "#" + type);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// List for backwards/forwards
|
// List for backwards/forwards
|
||||||
window.addEventListener('popstate', function(event) {
|
window.addEventListener("popstate", function(event) {
|
||||||
if(event.state && 'type' in event.state) {
|
if (event.state && "type" in event.state) {
|
||||||
newSource(event.state.type);
|
newSource(event.state.type);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -69,7 +69,7 @@
|
|||||||
|
|
||||||
// Replace current history state
|
// Replace current history state
|
||||||
if (currentType in types) {
|
if (currentType in types) {
|
||||||
history.replaceState({ 'type': currentType }, '', (video ? '' : '#' + currentType));
|
history.replaceState({ type: currentType }, "", video ? "" : "#" + currentType);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If it's not video, load the source
|
// If it's not video, load the source
|
||||||
@ -82,11 +82,10 @@
|
|||||||
function toggleClass(element, className, state) {
|
function toggleClass(element, className, state) {
|
||||||
if (element) {
|
if (element) {
|
||||||
if (element.classList) {
|
if (element.classList) {
|
||||||
element.classList[state ? 'add' : 'remove'](className);
|
element.classList[state ? "add" : "remove"](className);
|
||||||
}
|
} else {
|
||||||
else {
|
var name = (" " + element.className + " ").replace(/\s+/g, " ").replace(" " + className + " ", "");
|
||||||
var name = (' ' + element.className + ' ').replace(/\s+/g, ' ').replace(' ' + className + ' ', '');
|
element.className = name + (state ? " " + className : "");
|
||||||
element.className = name + (state ? ' ' + className : '');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -101,61 +100,71 @@
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case types.video:
|
case types.video:
|
||||||
player.source({
|
player.source({
|
||||||
type: 'video',
|
type: "video",
|
||||||
title: 'View From A Blue Moon',
|
title: "View From A Blue Moon",
|
||||||
sources: [{
|
sources: [
|
||||||
src: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.mp4',
|
{
|
||||||
type: 'video/mp4'
|
src: "https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.mp4",
|
||||||
|
type: "video/mp4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
src: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.webm',
|
src: "https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.webm",
|
||||||
type: 'video/webm'
|
type: "video/webm"
|
||||||
}],
|
}
|
||||||
poster: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.jpg',
|
],
|
||||||
tracks: [{
|
poster: "https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg",
|
||||||
kind: 'captions',
|
tracks: [
|
||||||
label: 'English',
|
{
|
||||||
srclang:'en',
|
kind: "captions",
|
||||||
src: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.en.vtt',
|
label: "English",
|
||||||
|
srclang: "en",
|
||||||
|
src: "https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.en.vtt",
|
||||||
default: true
|
default: true
|
||||||
}]
|
}
|
||||||
|
]
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case types.audio:
|
case types.audio:
|
||||||
player.source({
|
player.source({
|
||||||
type: 'audio',
|
type: "audio",
|
||||||
title: 'Kishi Bashi – “It All Began With A Burst”',
|
title: "Kishi Bashi – “It All Began With A Burst”",
|
||||||
sources: [{
|
sources: [
|
||||||
src: 'https://cdn.selz.com/plyr/1.5/Kishi_Bashi_-_It_All_Began_With_a_Burst.mp3',
|
{
|
||||||
type: 'audio/mp3'
|
src: "https://cdn.plyr.io/static/demo/Kishi_Bashi_-_It_All_Began_With_a_Burst.mp3",
|
||||||
|
type: "audio/mp3"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
src: 'https://cdn.selz.com/plyr/1.5/Kishi_Bashi_-_It_All_Began_With_a_Burst.ogg',
|
src: "https://cdn.plyr.io/static/demo/Kishi_Bashi_-_It_All_Began_With_a_Burst.ogg",
|
||||||
type: 'audio/ogg'
|
type: "audio/ogg"
|
||||||
}]
|
}
|
||||||
|
]
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case types.youtube:
|
case types.youtube:
|
||||||
player.source({
|
player.source({
|
||||||
type: 'video',
|
type: "video",
|
||||||
title: 'View From A Blue Moon',
|
title: "View From A Blue Moon",
|
||||||
sources: [{
|
sources: [
|
||||||
src: 'bTqVqk7FSmY',
|
{
|
||||||
type: 'youtube'
|
src: "bTqVqk7FSmY",
|
||||||
}]
|
type: "youtube"
|
||||||
|
}
|
||||||
|
]
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case types.vimeo:
|
case types.vimeo:
|
||||||
player.source({
|
player.source({
|
||||||
type: 'video',
|
type: "video",
|
||||||
title: 'View From A Blue Moon',
|
title: "View From A Blue Moon",
|
||||||
sources: [{
|
sources: [
|
||||||
src: '143418951',
|
{
|
||||||
type: 'vimeo'
|
src: "147865858",
|
||||||
}]
|
type: "vimeo"
|
||||||
|
}
|
||||||
|
]
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -165,21 +174,30 @@
|
|||||||
|
|
||||||
// Remove active classes
|
// Remove active classes
|
||||||
for (var x = buttons.length - 1; x >= 0; x--) {
|
for (var x = buttons.length - 1; x >= 0; x--) {
|
||||||
toggleClass(buttons[x].parentElement, 'active', false);
|
toggleClass(buttons[x].parentElement, "active", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set active on parent
|
// Set active on parent
|
||||||
toggleClass(document.querySelector('[data-source="'+ type +'"]').parentElement, 'active', true);
|
toggleClass(document.querySelector('[data-source="' + type + '"]').parentElement, "active", true);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// Google analytics
|
// Google analytics
|
||||||
// For demo site (http://[www.]plyr.io) only
|
// For demo site (http://[www.]plyr.io) only
|
||||||
if(document.domain.indexOf('plyr.io') > -1) {
|
if (document.domain.indexOf("plyr.io") > -1) {
|
||||||
(function(i,s,o,g,r,a,m){i.GoogleAnalyticsObject=r;i[r]=i[r]||function(){
|
(function(i, s, o, g, r, a, m) {
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
i.GoogleAnalyticsObject = r;
|
||||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
(i[r] =
|
||||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
i[r] ||
|
||||||
ga('create', 'UA-40881672-11', 'auto');
|
function() {
|
||||||
ga('send', 'pageview');
|
(i[r].q = i[r].q || []).push(arguments);
|
||||||
|
}),
|
||||||
|
(i[r].l = 1 * new Date());
|
||||||
|
(a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]);
|
||||||
|
a.async = 1;
|
||||||
|
a.src = g;
|
||||||
|
m.parentNode.insertBefore(a, m);
|
||||||
|
})(window, document, "script", "//www.google-analytics.com/analytics.js", "ga");
|
||||||
|
ga("create", "UA-40881672-11", "auto");
|
||||||
|
ga("send", "pageview");
|
||||||
}
|
}
|
||||||
|
@ -4,15 +4,17 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "Avenir";
|
font-family: "Avenir";
|
||||||
src: url("//cdn.plyr.io/fonts/avenir-medium.woff2") format("woff2"),
|
src: url("//cdn.plyr.io/static/fonts/avenir-medium.woff2") format("woff2"),
|
||||||
url("//cdn.plyr.io/fonts/avenir-medium.woff") format("woff");
|
url("//cdn.plyr.io/static/fonts/avenir-medium.woff") format("woff");
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: @font-weight-base;
|
font-weight: @font-weight-base;
|
||||||
|
font-display: swap;
|
||||||
}
|
}
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "Avenir";
|
font-family: "Avenir";
|
||||||
src: url("//cdn.plyr.io/fonts/avenir-bold.woff2") format("woff2"),
|
src: url("//cdn.plyr.io/static/fonts/avenir-bold.woff2") format("woff2"),
|
||||||
url("//cdn.plyr.io/fonts/avenir-bold.woff") format("woff");
|
url("//cdn.plyr.io/static/fonts/avenir-bold.woff") format("woff");
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: @font-weight-bold;
|
font-weight: @font-weight-bold;
|
||||||
|
font-display: swap;
|
||||||
}
|
}
|
2
dist/plyr.css
vendored
2
dist/plyr.css
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2015 Selz.com
|
Copyright (c) 2017 Sam Potts
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
18
package.json
18
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "plyr",
|
"name": "plyr",
|
||||||
"version": "2.0.12",
|
"version": "2.0.16",
|
||||||
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
|
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
|
||||||
"homepage": "http://plyr.io",
|
"homepage": "http://plyr.io",
|
||||||
"main": "src/js/plyr.js",
|
"main": "src/js/plyr.js",
|
||||||
@ -24,22 +24,14 @@
|
|||||||
"run-sequence": "^1.1.5",
|
"run-sequence": "^1.1.5",
|
||||||
"through2": "^2.0.1"
|
"through2": "^2.0.1"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": ["HTML5 Video", "HTML5 Audio", "Media Player", "DASH", "Shaka", "WordPress", "HLS"],
|
||||||
"HTML5 Video",
|
|
||||||
"HTML5 Audio",
|
|
||||||
"Media Player",
|
|
||||||
"DASH",
|
|
||||||
"Shaka",
|
|
||||||
"WordPress",
|
|
||||||
"HLS"
|
|
||||||
],
|
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git://github.com/selz/plyr.git"
|
"url": "git://github.com/sampotts/plyr.git"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/selz/plyr/issues"
|
"url": "https://github.com/sampotts/plyr/issues"
|
||||||
},
|
},
|
||||||
"directories": {
|
"directories": {
|
||||||
"doc": "readme.md"
|
"doc": "readme.md"
|
||||||
@ -47,5 +39,5 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"author": "Sam Potts <sam@selz.com>"
|
"author": "Sam Potts <sam@potts.es>"
|
||||||
}
|
}
|
||||||
|
24
readme.md
24
readme.md
@ -5,7 +5,7 @@ A simple, accessible and customizable HTML5, YouTube and Vimeo media player.
|
|||||||
|
|
||||||
[Checkout the demo](https://plyr.io)
|
[Checkout the demo](https://plyr.io)
|
||||||
|
|
||||||
[](https://plyr.io)
|
[](https://plyr.io)
|
||||||
|
|
||||||
## Why?
|
## Why?
|
||||||
We wanted a lightweight, accessible and customizable media player that supports [*modern*](#browser-support) browsers. Sure, there are many other players out there but we wanted to keep things simple, using the right elements for the job.
|
We wanted a lightweight, accessible and customizable media player that supports [*modern*](#browser-support) browsers. Sure, there are many other players out there but we wanted to keep things simple, using the right elements for the job.
|
||||||
@ -39,7 +39,7 @@ Check out the [changelog](changelog.md) to see what's new with Plyr.
|
|||||||
- AirPlay
|
- AirPlay
|
||||||
- Picture in Picture (MacOS Sierra + Safari)
|
- Picture in Picture (MacOS Sierra + Safari)
|
||||||
|
|
||||||
[more info](https://github.com/Selz/plyr/issues?q=is%3Aissue+is%3Aopen+label%3A%22In+Development%22)
|
[more info](https://github.com/sampotts/plyr/issues?q=is%3Aissue+is%3Aopen+label%3A%22In+Development%22)
|
||||||
|
|
||||||
## Planned features
|
## Planned features
|
||||||
- Playlists
|
- Playlists
|
||||||
@ -48,9 +48,9 @@ Check out the [changelog](changelog.md) to see what's new with Plyr.
|
|||||||
- Wistia video support
|
- Wistia video support
|
||||||
- YouTube and Vimeo audio support
|
- YouTube and Vimeo audio support
|
||||||
- Audio captions
|
- Audio captions
|
||||||
...and whatever else has been raised in [issues](https://github.com/Selz/plyr/issues)
|
...and whatever else has been raised in [issues](https://github.com/sampotts/plyr/issues)
|
||||||
|
|
||||||
If you have any cool ideas or features, please let me know by [creating an issue](https://github.com/Selz/plyr/issues/new) or, of course, forking and sending a pull request.
|
If you have any cool ideas or features, please let me know by [creating an issue](https://github.com/sampotts/plyr/issues/new) or, of course, forking and sending a pull request.
|
||||||
|
|
||||||
## CMS plugins
|
## CMS plugins
|
||||||
|
|
||||||
@ -137,7 +137,7 @@ Include the `plyr.js` script before the closing `</body>` tag and then call `ply
|
|||||||
If you want to use our CDN (provided by [Fastly](https://www.fastly.com/)) for the JavaScript, you can use the following:
|
If you want to use our CDN (provided by [Fastly](https://www.fastly.com/)) for the JavaScript, you can use the following:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src="https://cdn.plyr.io/2.0.12/plyr.js"></script>
|
<script src="https://cdn.plyr.io/2.0.16/plyr.js"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
### CSS
|
### CSS
|
||||||
@ -150,11 +150,11 @@ Include the `plyr.css` stylsheet into your `<head>`
|
|||||||
If you want to use our CDN (provided by [Fastly](https://www.fastly.com/)) for the default CSS, you can use the following:
|
If you want to use our CDN (provided by [Fastly](https://www.fastly.com/)) for the default CSS, you can use the following:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<link rel="stylesheet" href="https://cdn.plyr.io/2.0.12/plyr.css">
|
<link rel="stylesheet" href="https://cdn.plyr.io/2.0.16/plyr.css">
|
||||||
```
|
```
|
||||||
|
|
||||||
### SVG Sprite
|
### SVG Sprite
|
||||||
The SVG sprite is loaded automatically from our CDN (provided by [Fastly](https://www.fastly.com/)). To change this, see the [options](#options) below. For reference, the CDN hosted SVG sprite can be found at `https://cdn.plyr.io/2.0.12/plyr.svg`.
|
The SVG sprite is loaded automatically from our CDN (provided by [Fastly](https://www.fastly.com/)). To change this, see the [options](#options) below. For reference, the CDN hosted SVG sprite can be found at `https://cdn.plyr.io/2.0.16/plyr.svg`.
|
||||||
|
|
||||||
## Advanced
|
## Advanced
|
||||||
|
|
||||||
@ -290,7 +290,7 @@ Note the single quotes encapsulating the JSON and double quotes on the object ke
|
|||||||
<td><code>blankUrl</code></td>
|
<td><code>blankUrl</code></td>
|
||||||
<td>String</td>
|
<td>String</td>
|
||||||
<td><code>https://cdn.selz.com/plyr/blank.mp4</code></td>
|
<td><code>https://cdn.selz.com/plyr/blank.mp4</code></td>
|
||||||
<td>Specify a URL or path to a blank video file used to properly cancel network requests. See <a href="https://github.com/Selz/plyr/issues/174">issue #174</a> for more info.</td>
|
<td>Specify a URL or path to a blank video file used to properly cancel network requests. See <a href="https://github.com/sampotts/plyr/issues/174">issue #174</a> for more info.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>debug</code></td>
|
<td><code>debug</code></td>
|
||||||
@ -904,16 +904,14 @@ These events also bubble up the DOM. The event target will be the container elem
|
|||||||
Details borrowed from: [https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events](https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events)
|
Details borrowed from: [https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events](https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events)
|
||||||
|
|
||||||
## Embeds
|
## Embeds
|
||||||
YouTube and Vimeo are currently supported and function much like a HTML5 video. Check the relevant documentation sections for any differences.
|
YouTube and Vimeo are currently supported and function much like a HTML5 video. Check the relevant documentation sections for any differences. You don't need to worry about including your own versions of the Vimeo or YouTube JavaScript APIs. Plyr will automatically include them.
|
||||||
|
|
||||||
Plyr references a custom version of the Vimeo Froogaloop API as Vimeo have neglected to maintain the library and there were bugs with their version. You don't need to worry about including your own versions of the Vimeo or YouTube JavaScript APIs.
|
|
||||||
|
|
||||||
The embed third party API's can be accessed through the `getEmbed()` API method.
|
The embed third party API's can be accessed through the `getEmbed()` API method.
|
||||||
|
|
||||||
More info on the respective API's here:
|
More info on the respective API's here:
|
||||||
|
|
||||||
- [YouTube API Reference](https://developers.google.com/youtube/js_api_reference)
|
- [YouTube API Reference](https://developers.google.com/youtube/js_api_reference)
|
||||||
- [Vimeo API Reference](https://developer.vimeo.com/player/js-api#reference)
|
- [Vimeo API Reference](https://github.com/vimeo/player.js)
|
||||||
|
|
||||||
*Please note*: not all API methods may work 100%. Your mileage may vary. It's better to use the universal plyr API where possible.
|
*Please note*: not all API methods may work 100%. Your mileage may vary. It's better to use the universal plyr API where possible.
|
||||||
|
|
||||||
@ -1039,7 +1037,7 @@ There's an API method for checking support. You can call `plyr.supported()` and
|
|||||||
If you find anything weird with Plyr, please let us know using the GitHub issues tracker.
|
If you find anything weird with Plyr, please let us know using the GitHub issues tracker.
|
||||||
|
|
||||||
## Author
|
## Author
|
||||||
Plyr is developed by [@sam_potts](https://twitter.com/sam_potts) / [sampotts.me](http://sampotts.me) with help from the awesome [contributors](https://github.com/Selz/plyr/graphs/contributors)
|
Plyr is developed by [@sam_potts](https://twitter.com/sam_potts) / [sampotts.me](http://sampotts.me) with help from the awesome [contributors](https://github.com/sampotts/plyr/graphs/contributors)
|
||||||
|
|
||||||
## Donate
|
## Donate
|
||||||
Plyr costs money to run, not my time - I donate that for free but domains, hosting and more. Any help is appreciated...
|
Plyr costs money to run, not my time - I donate that for free but domains, hosting and more. Any help is appreciated...
|
||||||
|
1363
src/js/plyr.js
1363
src/js/plyr.js
File diff suppressed because it is too large
Load Diff
@ -9,7 +9,9 @@
|
|||||||
// Animation
|
// Animation
|
||||||
// ---------------------------------------
|
// ---------------------------------------
|
||||||
@keyframes plyr-progress {
|
@keyframes plyr-progress {
|
||||||
to { background-position: @plyr-progress-loading-size 0; }
|
to {
|
||||||
|
background-position: @plyr-progress-loading-size 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Styles
|
// Styles
|
||||||
@ -35,7 +37,10 @@
|
|||||||
|
|
||||||
& when (@plyr-touch-action = true) {
|
& when (@plyr-touch-action = true) {
|
||||||
// Fix 300ms delay
|
// Fix 300ms delay
|
||||||
a, button, input, label {
|
a,
|
||||||
|
button,
|
||||||
|
input,
|
||||||
|
label {
|
||||||
touch-action: manipulation;
|
touch-action: manipulation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -56,7 +61,7 @@
|
|||||||
|
|
||||||
// Range inputs
|
// Range inputs
|
||||||
// Specificity is for bootstrap compatibility
|
// Specificity is for bootstrap compatibility
|
||||||
input[type='range'] {
|
input[type="range"] {
|
||||||
display: block;
|
display: block;
|
||||||
height: (@plyr-range-thumb-height * @plyr-range-thumb-active-scale);
|
height: (@plyr-range-thumb-height * @plyr-range-thumb-active-scale);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -137,12 +142,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Video range inputs
|
// Video range inputs
|
||||||
.plyr--video input[type='range'].tab-focus:focus {
|
.plyr--video input[type="range"].tab-focus:focus {
|
||||||
outline: 1px dotted fade(@plyr-video-control-color, 50%);
|
outline: 1px dotted fade(@plyr-video-control-color, 50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Audio range inputs
|
// Audio range inputs
|
||||||
.plyr--audio input[type='range'].tab-focus:focus {
|
.plyr--audio input[type="range"].tab-focus:focus {
|
||||||
outline: 1px dotted fade(@plyr-audio-control-color, 50%);
|
outline: 1px dotted fade(@plyr-audio-control-color, 50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,7 +226,7 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
padding: (@plyr-control-spacing * 2);
|
padding: (@plyr-control-spacing * 2);
|
||||||
transform: translateY(-(@plyr-control-spacing * 4));
|
transform: translateY(-(@plyr-control-spacing * 4));
|
||||||
transition: transform .3s ease;
|
transition: transform 0.3s ease;
|
||||||
color: @plyr-captions-color;
|
color: @plyr-captions-color;
|
||||||
font-size: @plyr-font-size-captions-base;
|
font-size: @plyr-font-size-captions-base;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -268,6 +273,11 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
pointer-events: none;
|
||||||
|
|
||||||
|
& > * {
|
||||||
|
pointer-events: all;
|
||||||
|
}
|
||||||
|
|
||||||
// Spacing
|
// Spacing
|
||||||
> button,
|
> button,
|
||||||
@ -298,7 +308,7 @@
|
|||||||
background: transparent;
|
background: transparent;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: background .3s ease, color .3s ease, opacity .3s ease;
|
transition: background 0.3s ease, color 0.3s ease, opacity 0.3s ease;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
@ -347,7 +357,7 @@
|
|||||||
border-bottom-left-radius: inherit;
|
border-bottom-left-radius: inherit;
|
||||||
border-bottom-right-radius: inherit;
|
border-bottom-right-radius: inherit;
|
||||||
color: @plyr-video-control-color;
|
color: @plyr-video-control-color;
|
||||||
transition: opacity .3s ease;
|
transition: opacity 0.3s ease;
|
||||||
|
|
||||||
button {
|
button {
|
||||||
// Hover and tab focus
|
// Hover and tab focus
|
||||||
@ -391,7 +401,7 @@
|
|||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
box-shadow: 0 1px 1px fade(#000, 15%);
|
box-shadow: 0 1px 1px fade(#000, 15%);
|
||||||
color: @plyr-video-control-color;
|
color: @plyr-video-control-color;
|
||||||
transition: all .3s ease;
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -418,11 +428,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// States
|
// States
|
||||||
.plyr__controls [data-plyr='pause'],
|
.plyr__controls [data-plyr="pause"],
|
||||||
.plyr--playing .plyr__controls [data-plyr='play'] {
|
.plyr--playing .plyr__controls [data-plyr="play"] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.plyr--playing .plyr__controls [data-plyr='pause'] {
|
.plyr--playing .plyr__controls [data-plyr="pause"] {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -438,12 +448,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Some options are hidden by default
|
// Some options are hidden by default
|
||||||
.plyr [data-plyr='captions'],
|
.plyr [data-plyr="captions"],
|
||||||
.plyr [data-plyr='fullscreen'] {
|
.plyr [data-plyr="fullscreen"] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.plyr--captions-enabled [data-plyr='captions'],
|
.plyr--captions-enabled [data-plyr="captions"],
|
||||||
.plyr--fullscreen-enabled [data-plyr='fullscreen'] {
|
.plyr--fullscreen-enabled [data-plyr="fullscreen"] {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -465,13 +475,13 @@
|
|||||||
font-size: @plyr-font-size-small;
|
font-size: @plyr-font-size-small;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
|
|
||||||
transform: translate(-50%, 10px) scale(.8);
|
transform: translate(-50%, 10px) scale(0.8);
|
||||||
transform-origin: 50% 100%;
|
transform-origin: 50% 100%;
|
||||||
transition: transform .2s .1s ease, opacity .2s .1s ease;
|
transition: transform 0.2s 0.1s ease, opacity 0.2s 0.1s ease;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
// Arrows
|
// Arrows
|
||||||
content: '';
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 0;
|
width: 0;
|
||||||
height: 0;
|
height: 0;
|
||||||
@ -499,7 +509,7 @@
|
|||||||
// First tooltip
|
// First tooltip
|
||||||
.plyr__controls button:first-child .plyr__tooltip {
|
.plyr__controls button:first-child .plyr__tooltip {
|
||||||
left: 0;
|
left: 0;
|
||||||
transform: translate(0, 10px) scale(.8);
|
transform: translate(0, 10px) scale(0.8);
|
||||||
transform-origin: 0 100%;
|
transform-origin: 0 100%;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
@ -510,7 +520,7 @@
|
|||||||
// Last tooltip
|
// Last tooltip
|
||||||
.plyr__controls button:last-child .plyr__tooltip {
|
.plyr__controls button:last-child .plyr__tooltip {
|
||||||
right: 0;
|
right: 0;
|
||||||
transform: translate(0, 10px) scale(.8);
|
transform: translate(0, 10px) scale(0.8);
|
||||||
transform-origin: 100% 100%;
|
transform-origin: 100% 100%;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
@ -529,7 +539,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Playback progress
|
// Playback progress
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
// <progress> element
|
// <progress> element
|
||||||
@ -621,13 +630,13 @@
|
|||||||
}
|
}
|
||||||
.plyr__progress--buffer {
|
.plyr__progress--buffer {
|
||||||
&::-webkit-progress-value {
|
&::-webkit-progress-value {
|
||||||
transition: width .2s ease;
|
transition: width 0.2s ease;
|
||||||
}
|
}
|
||||||
&::-moz-progress-bar {
|
&::-moz-progress-bar {
|
||||||
transition: width .2s ease;
|
transition: width 0.2s ease;
|
||||||
}
|
}
|
||||||
&::-ms-fill {
|
&::-ms-fill {
|
||||||
transition: width .2s ease;
|
transition: width 0.2s ease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.plyr--video .plyr__progress--buffer,
|
.plyr--video .plyr__progress--buffer,
|
||||||
@ -658,7 +667,8 @@
|
|||||||
@plyr-progress-loading-bg 50%,
|
@plyr-progress-loading-bg 50%,
|
||||||
@plyr-progress-loading-bg 75%,
|
@plyr-progress-loading-bg 75%,
|
||||||
transparent 75%,
|
transparent 75%,
|
||||||
transparent);
|
transparent
|
||||||
|
);
|
||||||
color: transparent;
|
color: transparent;
|
||||||
}
|
}
|
||||||
.plyr--video.plyr--loading .plyr__progress--buffer {
|
.plyr--video.plyr--loading .plyr__progress--buffer {
|
||||||
@ -685,7 +695,7 @@
|
|||||||
|
|
||||||
// Add a slash in before
|
// Add a slash in before
|
||||||
&::before {
|
&::before {
|
||||||
content: '\2044';
|
content: "\2044";
|
||||||
margin-right: @plyr-control-spacing;
|
margin-right: @plyr-control-spacing;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -716,21 +726,15 @@
|
|||||||
// It's not supported to change volume using JavaScript:
|
// It's not supported to change volume using JavaScript:
|
||||||
// https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html
|
// https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html
|
||||||
.plyr--is-ios .plyr__volume,
|
.plyr--is-ios .plyr__volume,
|
||||||
.plyr--is-ios [data-plyr='mute'] {
|
.plyr--is-ios [data-plyr="mute"] {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fullscreen
|
// Fullscreen
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
.plyr--fullscreen-active {
|
.plyr--fullscreen-active {
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 10000000;
|
|
||||||
background: #000;
|
background: #000;
|
||||||
border-radius: 0 !important;
|
border-radius: 0 !important;
|
||||||
|
|
||||||
@ -745,12 +749,6 @@
|
|||||||
// Revert overflow change
|
// Revert overflow change
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
}
|
}
|
||||||
.plyr__controls {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Vimeo requires some different styling
|
// Vimeo requires some different styling
|
||||||
&.plyr--vimeo .plyr__video-wrapper {
|
&.plyr--vimeo .plyr__video-wrapper {
|
||||||
@ -759,3 +757,13 @@
|
|||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fallback for unsupported browsers
|
||||||
|
.plyr--fullscreen-fallback.plyr--fullscreen-active {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: 10000000;
|
||||||
|
}
|
||||||
|
@ -9,7 +9,9 @@
|
|||||||
// Animation
|
// Animation
|
||||||
// ---------------------------------------
|
// ---------------------------------------
|
||||||
@keyframes plyr-progress {
|
@keyframes plyr-progress {
|
||||||
to { background-position: $plyr-progress-loading-size 0; }
|
to {
|
||||||
|
background-position: $plyr-progress-loading-size 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Styles
|
// Styles
|
||||||
@ -35,7 +37,10 @@
|
|||||||
|
|
||||||
@if $plyr-touch-action == true {
|
@if $plyr-touch-action == true {
|
||||||
// Fix 300ms delay
|
// Fix 300ms delay
|
||||||
a, button, input, label {
|
a,
|
||||||
|
button,
|
||||||
|
input,
|
||||||
|
label {
|
||||||
touch-action: manipulation;
|
touch-action: manipulation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -56,7 +61,7 @@
|
|||||||
|
|
||||||
// Range inputs
|
// Range inputs
|
||||||
// Specificity is for bootstrap compatibility
|
// Specificity is for bootstrap compatibility
|
||||||
input[type='range'] {
|
input[type="range"] {
|
||||||
display: block;
|
display: block;
|
||||||
height: ($plyr-range-thumb-height * $plyr-range-thumb-active-scale);
|
height: ($plyr-range-thumb-height * $plyr-range-thumb-active-scale);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -137,13 +142,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Video range inputs
|
// Video range inputs
|
||||||
.plyr--video input[type='range'].tab-focus:focus {
|
.plyr--video input[type="range"].tab-focus:focus {
|
||||||
outline: 1px dotted transparentize($plyr-video-control-color, .5);
|
outline: 1px dotted transparentize($plyr-video-control-color, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Audio range inputs
|
// Audio range inputs
|
||||||
.plyr--audio input[type='range'].tab-focus:focus {
|
.plyr--audio input[type="range"].tab-focus:focus {
|
||||||
outline: 1px dotted transparentize($plyr-audio-control-color, .5);
|
outline: 1px dotted transparentize($plyr-audio-control-color, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Screen reader only elements
|
// Screen reader only elements
|
||||||
@ -220,7 +225,7 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
padding: ($plyr-control-spacing * 2);
|
padding: ($plyr-control-spacing * 2);
|
||||||
transform: translateY(-($plyr-control-spacing * 6));
|
transform: translateY(-($plyr-control-spacing * 6));
|
||||||
transition: transform .3s ease;
|
transition: transform 0.3s ease;
|
||||||
color: $plyr-captions-color;
|
color: $plyr-captions-color;
|
||||||
font-size: $plyr-font-size-captions-base;
|
font-size: $plyr-font-size-captions-base;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -267,6 +272,11 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
pointer-events: none;
|
||||||
|
|
||||||
|
& > * {
|
||||||
|
pointer-events: all;
|
||||||
|
}
|
||||||
|
|
||||||
// Spacing
|
// Spacing
|
||||||
> button,
|
> button,
|
||||||
@ -292,12 +302,12 @@
|
|||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
overflow: visible; // IE11
|
overflow: visible; // IE11
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
padding: ($plyr-control-spacing * .7);
|
padding: ($plyr-control-spacing * 0.7);
|
||||||
border: 0;
|
border: 0;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: background .3s ease, color .3s ease, opacity .3s ease;
|
transition: background 0.3s ease, color 0.3s ease, opacity 0.3s ease;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
@ -341,11 +351,14 @@
|
|||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
padding: ($plyr-control-spacing * 5) $plyr-control-spacing $plyr-control-spacing;
|
padding: ($plyr-control-spacing * 5) $plyr-control-spacing $plyr-control-spacing;
|
||||||
background: linear-gradient(transparentize($plyr-video-controls-bg, 1), transparentize($plyr-video-controls-bg, .5));
|
background: linear-gradient(
|
||||||
|
transparentize($plyr-video-controls-bg, 1),
|
||||||
|
transparentize($plyr-video-controls-bg, 0.5)
|
||||||
|
);
|
||||||
border-bottom-left-radius: inherit;
|
border-bottom-left-radius: inherit;
|
||||||
border-bottom-right-radius: inherit;
|
border-bottom-right-radius: inherit;
|
||||||
color: $plyr-video-control-color;
|
color: $plyr-video-control-color;
|
||||||
transition: opacity .3s ease;
|
transition: opacity 0.3s ease;
|
||||||
|
|
||||||
button {
|
button {
|
||||||
// Hover and tab focus
|
// Hover and tab focus
|
||||||
@ -387,9 +400,9 @@
|
|||||||
background: $plyr-video-control-bg-hover;
|
background: $plyr-video-control-bg-hover;
|
||||||
border: 4px solid currentColor;
|
border: 4px solid currentColor;
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
box-shadow: 0 1px 1px transparentize(#000, .85);
|
box-shadow: 0 1px 1px transparentize(#000, 0.85);
|
||||||
color: $plyr-video-control-color;
|
color: $plyr-video-control-color;
|
||||||
transition: all .3s ease;
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -401,7 +414,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
outline: 1px dotted transparentize($plyr-video-control-color, .5);
|
outline: 1px dotted transparentize($plyr-video-control-color, 0.5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.plyr .plyr__play-large {
|
.plyr .plyr__play-large {
|
||||||
@ -416,11 +429,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// States
|
// States
|
||||||
.plyr__controls [data-plyr='pause'],
|
.plyr__controls [data-plyr="pause"],
|
||||||
.plyr--playing .plyr__controls [data-plyr='play'] {
|
.plyr--playing .plyr__controls [data-plyr="play"] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.plyr--playing .plyr__controls [data-plyr='pause'] {
|
.plyr--playing .plyr__controls [data-plyr="pause"] {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -436,12 +449,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Some options are hidden by default
|
// Some options are hidden by default
|
||||||
.plyr [data-plyr='captions'],
|
.plyr [data-plyr="captions"],
|
||||||
.plyr [data-plyr='fullscreen'] {
|
.plyr [data-plyr="fullscreen"] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.plyr--captions-enabled [data-plyr='captions'],
|
.plyr--captions-enabled [data-plyr="captions"],
|
||||||
.plyr--fullscreen-enabled [data-plyr='fullscreen'] {
|
.plyr--fullscreen-enabled [data-plyr="fullscreen"] {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -463,13 +476,13 @@
|
|||||||
font-size: $plyr-font-size-small;
|
font-size: $plyr-font-size-small;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
|
|
||||||
transform: translate(-50%, 10px) scale(.8);
|
transform: translate(-50%, 10px) scale(0.8);
|
||||||
transform-origin: 50% 100%;
|
transform-origin: 50% 100%;
|
||||||
transition: transform .2s .1s ease, opacity .2s .1s ease;
|
transition: transform 0.2s 0.1s ease, opacity 0.2s 0.1s ease;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
// Arrows
|
// Arrows
|
||||||
content: '';
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 0;
|
width: 0;
|
||||||
height: 0;
|
height: 0;
|
||||||
@ -497,7 +510,7 @@
|
|||||||
// First tooltip
|
// First tooltip
|
||||||
.plyr__controls button:first-child .plyr__tooltip {
|
.plyr__controls button:first-child .plyr__tooltip {
|
||||||
left: 0;
|
left: 0;
|
||||||
transform: translate(0, 10px) scale(.8);
|
transform: translate(0, 10px) scale(0.8);
|
||||||
transform-origin: 0 100%;
|
transform-origin: 0 100%;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
@ -508,7 +521,7 @@
|
|||||||
// Last tooltip
|
// Last tooltip
|
||||||
.plyr__controls button:last-child .plyr__tooltip {
|
.plyr__controls button:last-child .plyr__tooltip {
|
||||||
right: 0;
|
right: 0;
|
||||||
transform: translate(0, 10px) scale(.8);
|
transform: translate(0, 10px) scale(0.8);
|
||||||
transform-origin: 100% 100%;
|
transform-origin: 100% 100%;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
@ -618,13 +631,13 @@
|
|||||||
}
|
}
|
||||||
.plyr__progress--buffer {
|
.plyr__progress--buffer {
|
||||||
&::-webkit-progress-value {
|
&::-webkit-progress-value {
|
||||||
transition: width .2s ease;
|
transition: width 0.2s ease;
|
||||||
}
|
}
|
||||||
&::-moz-progress-bar {
|
&::-moz-progress-bar {
|
||||||
transition: width .2s ease;
|
transition: width 0.2s ease;
|
||||||
}
|
}
|
||||||
&::-ms-fill {
|
&::-ms-fill {
|
||||||
transition: width .2s ease;
|
transition: width 0.2s ease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.plyr--video .plyr__progress--buffer,
|
.plyr--video .plyr__progress--buffer,
|
||||||
@ -655,7 +668,8 @@
|
|||||||
$plyr-progress-loading-bg 50%,
|
$plyr-progress-loading-bg 50%,
|
||||||
$plyr-progress-loading-bg 75%,
|
$plyr-progress-loading-bg 75%,
|
||||||
transparent 75%,
|
transparent 75%,
|
||||||
transparent);
|
transparent
|
||||||
|
);
|
||||||
color: transparent;
|
color: transparent;
|
||||||
}
|
}
|
||||||
.plyr--video.plyr--loading .plyr__progress--buffer {
|
.plyr--video.plyr--loading .plyr__progress--buffer {
|
||||||
@ -682,7 +696,7 @@
|
|||||||
|
|
||||||
// Add a slash in before
|
// Add a slash in before
|
||||||
&::before {
|
&::before {
|
||||||
content: '\2044';
|
content: "\2044";
|
||||||
margin-right: $plyr-control-spacing;
|
margin-right: $plyr-control-spacing;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -713,21 +727,15 @@
|
|||||||
// It's not supported to change volume using JavaScript:
|
// It's not supported to change volume using JavaScript:
|
||||||
// https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html
|
// https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html
|
||||||
.plyr--is-ios .plyr__volume,
|
.plyr--is-ios .plyr__volume,
|
||||||
.plyr--is-ios [data-plyr='mute'] {
|
.plyr--is-ios [data-plyr="mute"] {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fullscreen
|
// Fullscreen
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
.plyr--fullscreen-active {
|
.plyr--fullscreen-active {
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 10000000;
|
|
||||||
background: #000;
|
background: #000;
|
||||||
border-radius: 0 !important;
|
border-radius: 0 !important;
|
||||||
|
|
||||||
@ -742,12 +750,6 @@
|
|||||||
// Revert overflow change
|
// Revert overflow change
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
}
|
}
|
||||||
.plyr__controls {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Vimeo requires some different styling
|
// Vimeo requires some different styling
|
||||||
&.plyr--vimeo .plyr__video-wrapper {
|
&.plyr--vimeo .plyr__video-wrapper {
|
||||||
@ -756,3 +758,13 @@
|
|||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fallback for unsupported browsers
|
||||||
|
.plyr--fullscreen-fallback.plyr--fullscreen-active {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: 10000000;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user