Merge branch 'develop' into blank-mp4
This commit is contained in:
commit
948e2cc66c
8
.gitignore
vendored
8
.gitignore
vendored
@ -3,10 +3,10 @@ node_modules
|
|||||||
*.sublime-workspace
|
*.sublime-workspace
|
||||||
.DS_Store
|
.DS_Store
|
||||||
aws.json
|
aws.json
|
||||||
docs/index.dev.html
|
|
||||||
*.mp4
|
*.mp4
|
||||||
!dist/blank.mp4
|
!dist/blank.mp4
|
||||||
index-dev.html
|
index-*.html
|
||||||
notes.txt
|
notes.txt
|
||||||
*.vtt
|
.idea
|
||||||
docs/index.dev.php
|
.DS_Store
|
||||||
|
npm-debug.log
|
@ -6,6 +6,27 @@
|
|||||||
"allowed_file_extensions": []
|
"allowed_file_extensions": []
|
||||||
},
|
},
|
||||||
"js": {
|
"js": {
|
||||||
"allowed_file_extensions": []
|
"allowed_file_extensions": ["js", "json", "jsbeautifyrc"],
|
||||||
|
"brace_style": "collapse",
|
||||||
|
"break_chained_methods": false,
|
||||||
|
"e4x": false,
|
||||||
|
"end_with_newline": false,
|
||||||
|
"indent_char": " ",
|
||||||
|
"indent_level": 0,
|
||||||
|
"indent_size": 4,
|
||||||
|
"indent_with_tabs": false,
|
||||||
|
"jslint_happy": false,
|
||||||
|
"keep_array_indentation": true,
|
||||||
|
"keep_function_indentation": true,
|
||||||
|
"max_preserve_newlines": 2,
|
||||||
|
"preserve_newlines": true,
|
||||||
|
"space_after_anon_function": false,
|
||||||
|
"space_before_conditional": true,
|
||||||
|
"space_in_empty_paren": false,
|
||||||
|
"space_in_paren": false,
|
||||||
|
"unescape_strings": false,
|
||||||
|
"wrap_line_length": 0,
|
||||||
|
"wrap_attributes": "auto",
|
||||||
|
"wrap_attributes_indent_size": 4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
"jquery" : false,
|
"jquery" : false,
|
||||||
|
|
||||||
// Development.
|
// Development.
|
||||||
"debug" : true, // Allow debugger statements e.g. browser breakpoints.
|
"debug" : false, // Allow debugger statements e.g. browser breakpoints.
|
||||||
"devel" : true, // Allow developments statements e.g. `console.log();`.
|
"devel" : false, // Allow developments statements e.g. `console.log();`.
|
||||||
|
|
||||||
// ECMAScript 5.
|
// ECMAScript 5.
|
||||||
"strict" : false, // Require `use strict` pragma in every file.
|
"strict" : false, // Require `use strict` pragma in every file.
|
||||||
|
2
demo/dist/demo.js
vendored
2
demo/dist/demo.js
vendored
@ -1 +1 @@
|
|||||||
"document"in self&&("classList"in document.createElement("_")?!function(){"use strict";var e=document.createElement("_");if(e.classList.add("c1","c2"),!e.classList.contains("c2")){var t=function(e){var t=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){var i,s=arguments.length;for(i=0;i<s;i++)e=arguments[i],t.call(this,e)}};t("add"),t("remove")}if(e.classList.toggle("c3",!1),e.classList.contains("c3")){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:i.call(this,e)}}e=null}():!function(e){"use strict";if("Element"in e){var t="classList",i="prototype",s=e.Element[i],o=Object,n=String[i].trim||function(){return this.replace(/^\s+|\s+$/g,"")},r=Array[i].indexOf||function(e){for(var t=0,i=this.length;t<i;t++)if(t in this&&this[t]===e)return t;return-1},a=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},c=function(e,t){if(""===t)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return r.call(e,t)},l=function(e){for(var t=n.call(e.getAttribute("class")||""),i=t?t.split(/\s+/):[],s=0,o=i.length;s<o;s++)this.push(i[s]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},u=l[i]=[],d=function(){return new l(this)};if(a[i]=Error[i],u.item=function(e){return this[e]||null},u.contains=function(e){return e+="",c(this,e)!==-1},u.add=function(){var e,t=arguments,i=0,s=t.length,o=!1;do e=t[i]+"",c(this,e)===-1&&(this.push(e),o=!0);while(++i<s);o&&this._updateClassName()},u.remove=function(){var e,t,i=arguments,s=0,o=i.length,n=!1;do for(e=i[s]+"",t=c(this,e);t!==-1;)this.splice(t,1),n=!0,t=c(this,e);while(++s<o);n&&this._updateClassName()},u.toggle=function(e,t){e+="";var i=this.contains(e),s=i?t!==!0&&"remove":t!==!1&&"add";return s&&this[s](e),t===!0||t===!1?t:!i},u.toString=function(){return this.join(" ")},o.defineProperty){var p={get:d,enumerable:!0,configurable:!0};try{o.defineProperty(s,t,p)}catch(e){e.number===-2146823252&&(p.enumerable=!1,o.defineProperty(s,t,p))}}else o[i].__defineGetter__&&s.__defineGetter__(t,d)}}(self)),function(){function e(e,t,i){if(e)if(e.classList)e.classList[i?"add":"remove"](t);else{var s=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=s+(i?" "+t:"")}}function t(t,i){if(t in n&&(i||t!==r)&&(r.length||t!==n.video)){switch(t){case n.video:s.source({type:"video",title:"View From A Blue Moon",sources:[{src:"https://cdn.selz.com/plyr/1.5/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",type:"video/webm"}],poster:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.jpg",tracks:[{kind:"captions",label:"English",srclang:"en",src:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.en.vtt",default:!0}]});break;case n.audio:s.source({type:"audio",title:"Kishi Bashi – “It All Began With A Burst”",sources:[{src:"https://cdn.selz.com/plyr/1.5/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",type:"audio/ogg"}]});break;case n.youtube:s.source({type:"video",title:"View From A Blue Moon",sources:[{src:"bTqVqk7FSmY",type:"youtube"}]});break;case n.vimeo:s.source({type:"video",title:"View From A Blue Moon",sources:[{src:"143418951",type:"vimeo"}]})}r=t;for(var a=o.length-1;a>=0;a--)e(o[a].parentElement,"active",!1);e(document.querySelector('[data-source="'+t+'"]').parentElement,"active",!0)}}var i=plyr.setup({debug:!0,title:"Video demo",iconUrl:"../dist/plyr.svg",tooltips:{controls:!0},captions:{defaultActive:!0}});plyr.loadSprite("dist/demo.svg");for(var s=i[0],o=document.querySelectorAll("[data-source]"),n={video:"video",audio:"audio",youtube:"youtube",vimeo:"vimeo"},r=window.location.hash.replace("#",""),a=window.history&&window.history.pushState,c=o.length-1;c>=0;c--)o[c].addEventListener("click",function(){var e=this.getAttribute("data-source");t(e),a&&history.pushState({type:e},"","#"+e)});if(window.addEventListener("popstate",function(e){e.state&&"type"in e.state&&t(e.state.type)}),a){var l=!r.length;l&&(r=n.video),r in n&&history.replaceState({type:r},"",l?"":"#"+r),r!==n.video&&t(r,!0)}}(),document.domain.indexOf("plyr.io")>-1&&(!function(e,t,i,s,o,n,r){e.GoogleAnalyticsObject=o,e[o]=e[o]||function(){(e[o].q=e[o].q||[]).push(arguments)},e[o].l=1*new Date,n=t.createElement(i),r=t.getElementsByTagName(i)[0],n.async=1,n.src=s,r.parentNode.insertBefore(n,r)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),ga("create","UA-40881672-11","auto"),ga("send","pageview"));
|
"document"in self&&("classList"in document.createElement("_")?!function(){"use strict";var e=document.createElement("_");if(e.classList.add("c1","c2"),!e.classList.contains("c2")){var t=function(e){var t=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){var i,s=arguments.length;for(i=0;i<s;i++)e=arguments[i],t.call(this,e)}};t("add"),t("remove")}if(e.classList.toggle("c3",!1),e.classList.contains("c3")){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:i.call(this,e)}}e=null}():!function(e){"use strict";if("Element"in e){var t="classList",i="prototype",s=e.Element[i],n=Object,o=String[i].trim||function(){return this.replace(/^\s+|\s+$/g,"")},r=Array[i].indexOf||function(e){for(var t=0,i=this.length;t<i;t++)if(t in this&&this[t]===e)return t;return-1},a=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},c=function(e,t){if(""===t)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return r.call(e,t)},l=function(e){for(var t=o.call(e.getAttribute("class")||""),i=t?t.split(/\s+/):[],s=0,n=i.length;s<n;s++)this.push(i[s]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},u=l[i]=[],d=function(){return new l(this)};if(a[i]=Error[i],u.item=function(e){return this[e]||null},u.contains=function(e){return e+="",c(this,e)!==-1},u.add=function(){var e,t=arguments,i=0,s=t.length,n=!1;do e=t[i]+"",c(this,e)===-1&&(this.push(e),n=!0);while(++i<s);n&&this._updateClassName()},u.remove=function(){var e,t,i=arguments,s=0,n=i.length,o=!1;do for(e=i[s]+"",t=c(this,e);t!==-1;)this.splice(t,1),o=!0,t=c(this,e);while(++s<n);o&&this._updateClassName()},u.toggle=function(e,t){e+="";var i=this.contains(e),s=i?t!==!0&&"remove":t!==!1&&"add";return s&&this[s](e),t===!0||t===!1?t:!i},u.toString=function(){return this.join(" ")},n.defineProperty){var p={get:d,enumerable:!0,configurable:!0};try{n.defineProperty(s,t,p)}catch(e){e.number===-2146823252&&(p.enumerable=!1,n.defineProperty(s,t,p))}}else n[i].__defineGetter__&&s.__defineGetter__(t,d)}}(self)),function(){function e(e,t,i){if(e)if(e.classList)e.classList[i?"add":"remove"](t);else{var s=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=s+(i?" "+t:"")}}function t(t,i){if(t in o&&(i||t!==r)&&(r.length||t!==o.video)){switch(t){case o.video:s.source({type:"video",title:"View From A Blue Moon",sources:[{src:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.mp4",type:"video/mp4"}],poster:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.jpg",tracks:[{kind:"captions",label:"English",srclang:"en",src:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.en.vtt",default:!0}]});break;case o.audio:s.source({type:"audio",title:"Kishi Bashi – “It All Began With A Burst”",sources:[{src:"https://cdn.selz.com/plyr/1.5/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",type:"audio/ogg"}]});break;case o.youtube:s.source({type:"video",title:"View From A Blue Moon",sources:[{src:"bTqVqk7FSmY",type:"youtube"}]});break;case o.vimeo:s.source({type:"video",title:"View From A Blue Moon",sources:[{src:"143418951",type:"vimeo"}]})}r=t;for(var a=n.length-1;a>=0;a--)e(n[a].parentElement,"active",!1);e(document.querySelector('[data-source="'+t+'"]').parentElement,"active",!0)}}var i=plyr.setup({debug:!0,title:"Video demo",iconUrl:"../dist/plyr.svg",tooltips:{controls:!0},captions:{defaultActive:!0},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","fullscreen","pip","airplay"]});plyr.loadSprite("dist/demo.svg");for(var s=i[0],n=document.querySelectorAll("[data-source]"),o={video:"video",audio:"audio",youtube:"youtube",vimeo:"vimeo"},r=window.location.hash.replace("#",""),a=window.history&&window.history.pushState,c=n.length-1;c>=0;c--)n[c].addEventListener("click",function(){var e=this.getAttribute("data-source");t(e),a&&history.pushState({type:e},"","#"+e)});if(window.addEventListener("popstate",function(e){e.state&&"type"in e.state&&t(e.state.type)}),a){var l=!r.length;l&&(r=o.video),r in o&&history.replaceState({type:r},"",l?"":"#"+r),r!==o.video&&t(r,!0)}}(),document.domain.indexOf("plyr.io")>-1&&(!function(e,t,i,s,n,o,r){e.GoogleAnalyticsObject=n,e[n]=e[n]||function(){(e[n].q=e[n].q||[]).push(arguments)},e[n].l=1*new Date,o=t.createElement(i),r=t.getElementsByTagName(i)[0],o.async=1,o.src=s,r.parentNode.insertBefore(o,r)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),ga("create","UA-40881672-11","auto"),ga("send","pageview"));
|
@ -51,13 +51,13 @@
|
|||||||
</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.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.jpg" 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.selz.com/plyr/1.5/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">
|
|
||||||
|
|
||||||
<!-- 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="webvtt/View_From_A_Blue_Moon_Trailer-HD.en.vtt" default>
|
||||||
|
<track kind="captions" label="Français" srclang="fr" src="webvtt/View_From_A_Blue_Moon_Trailer-HD.fr.vtt">
|
||||||
|
|
||||||
<!-- 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.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.mp4" download>Download</a>
|
||||||
@ -73,7 +73,7 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<!-- Plyr core script -->
|
<!-- Plyr core script -->
|
||||||
<script src="../dist/plyr.js"></script>
|
<script src="../src/js/plyr.js"></script>
|
||||||
|
|
||||||
<!-- Docs script -->
|
<!-- Docs script -->
|
||||||
<script src="dist/demo.js"></script>
|
<script src="dist/demo.js"></script>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
/*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
|
||||||
@ -20,7 +20,20 @@
|
|||||||
},
|
},
|
||||||
captions: {
|
captions: {
|
||||||
defaultActive: true
|
defaultActive: true
|
||||||
}
|
},
|
||||||
|
controls: [
|
||||||
|
'play-large',
|
||||||
|
'play',
|
||||||
|
'progress',
|
||||||
|
'current-time',
|
||||||
|
'mute',
|
||||||
|
'volume',
|
||||||
|
'captions',
|
||||||
|
'settings',
|
||||||
|
'fullscreen',
|
||||||
|
'pip',
|
||||||
|
'airplay'
|
||||||
|
]
|
||||||
});
|
});
|
||||||
plyr.loadSprite('dist/demo.svg');
|
plyr.loadSprite('dist/demo.svg');
|
||||||
|
|
||||||
@ -46,34 +59,38 @@
|
|||||||
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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// On load
|
// On load
|
||||||
if(historySupport) {
|
if (historySupport) {
|
||||||
var video = !currentType.length;
|
var video = !currentType.length;
|
||||||
|
|
||||||
// If there's no current type set, assume video
|
// If there's no current type set, assume video
|
||||||
if(video) {
|
if (video) {
|
||||||
currentType = types.video;
|
currentType = types.video;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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
|
||||||
if(currentType !== types.video) {
|
if (currentType !== types.video) {
|
||||||
newSource(currentType, true);
|
newSource(currentType, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -83,8 +100,7 @@
|
|||||||
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 : '');
|
||||||
}
|
}
|
||||||
@ -94,11 +110,11 @@
|
|||||||
// Set a new source
|
// Set a new source
|
||||||
function newSource(type, init) {
|
function newSource(type, init) {
|
||||||
// Bail if new type isn't known, it's the current type, or current type is empty (video is default) and new type is video
|
// Bail if new type isn't known, it's the current type, or current type is empty (video is default) and new type is video
|
||||||
if(!(type in types) || (!init && type === currentType) || (!currentType.length && type === types.video)) {
|
if (!(type in types) || (!init && type === currentType) || (!currentType.length && type === types.video)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(type) {
|
switch (type) {
|
||||||
case types.video:
|
case types.video:
|
||||||
player.source({
|
player.source({
|
||||||
type: 'video',
|
type: 'video',
|
||||||
@ -106,16 +122,12 @@
|
|||||||
sources: [{
|
sources: [{
|
||||||
src: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.mp4',
|
src: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.mp4',
|
||||||
type: 'video/mp4'
|
type: 'video/mp4'
|
||||||
},
|
|
||||||
{
|
|
||||||
src: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.webm',
|
|
||||||
type: 'video/webm'
|
|
||||||
}],
|
}],
|
||||||
poster: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.jpg',
|
poster: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.jpg',
|
||||||
tracks: [{
|
tracks: [{
|
||||||
kind: 'captions',
|
kind: 'captions',
|
||||||
label: 'English',
|
label: 'English',
|
||||||
srclang:'en',
|
srclang: 'en',
|
||||||
src: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.en.vtt',
|
src: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.en.vtt',
|
||||||
default: true
|
default: true
|
||||||
}]
|
}]
|
||||||
@ -169,17 +181,24 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 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] = i[r] || function() {
|
||||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
(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('create', 'UA-40881672-11', 'auto');
|
||||||
ga('send', 'pageview');
|
ga('send', 'pageview');
|
||||||
}
|
}
|
||||||
|
29
demo/webvtt/View_From_A_Blue_Moon_Trailer-HD.en.vtt
Normal file
29
demo/webvtt/View_From_A_Blue_Moon_Trailer-HD.en.vtt
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
WEBVTT FILE
|
||||||
|
|
||||||
|
1
|
||||||
|
00:00:09.500 --> 00:00:12.000
|
||||||
|
The ocean floor rises 5 miles to the shores
|
||||||
|
|
||||||
|
2
|
||||||
|
00:00:12.001 --> 00:00:16.500
|
||||||
|
of what people call, the seven mile miracle
|
||||||
|
|
||||||
|
3
|
||||||
|
00:00:25.500 --> 00:00:28.000
|
||||||
|
What would it be like to be born on this island?
|
||||||
|
|
||||||
|
4
|
||||||
|
00:00:32.500 --> 00:00:34.500
|
||||||
|
To grow up on these shores
|
||||||
|
|
||||||
|
5
|
||||||
|
00:00:37.500 --> 00:00:40.000
|
||||||
|
To witness this water, every day
|
||||||
|
|
||||||
|
6
|
||||||
|
00:00:43.500 --> 00:00:46.000
|
||||||
|
You're about to meet someone, who did
|
||||||
|
|
||||||
|
7
|
||||||
|
00:02:45.500 --> 00:02:49.000
|
||||||
|
This is a film about John John Florence
|
29
demo/webvtt/View_From_A_Blue_Moon_Trailer-HD.fr.vtt
Normal file
29
demo/webvtt/View_From_A_Blue_Moon_Trailer-HD.fr.vtt
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
WEBVTT FILE
|
||||||
|
|
||||||
|
1
|
||||||
|
00:00:09.500 --> 00:00:12.000
|
||||||
|
Le fond de l'océan monte 5 miles des rives
|
||||||
|
|
||||||
|
2
|
||||||
|
00:00:12.001 --> 00:00:16.500
|
||||||
|
de ce que les gens appellent le miracle de sept mile
|
||||||
|
|
||||||
|
3
|
||||||
|
00:00:25.500 --> 00:00:28.000
|
||||||
|
Que serait-il d'être né sur cette île?
|
||||||
|
|
||||||
|
4
|
||||||
|
00:00:32.500 --> 00:00:34.500
|
||||||
|
Pour grandir sur ces rivages
|
||||||
|
|
||||||
|
5
|
||||||
|
00:00:37.500 --> 00:00:40.000
|
||||||
|
Pour assister à cette eau, tous les jours
|
||||||
|
|
||||||
|
6
|
||||||
|
00:00:43.500 --> 00:00:46.000
|
||||||
|
Vous êtes sur le point de rencontrer quelqu'un, qui ne
|
||||||
|
|
||||||
|
7
|
||||||
|
00:02:45.500 --> 00:02:49.000
|
||||||
|
Ceci est un film sur John John Florence
|
2
dist/plyr.css
vendored
2
dist/plyr.css
vendored
File diff suppressed because one or more lines are too long
4
dist/plyr.js
vendored
4
dist/plyr.js
vendored
File diff suppressed because one or more lines are too long
2
dist/plyr.svg
vendored
2
dist/plyr.svg
vendored
@ -1 +1 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg"><symbol id="plyr-captions-off" viewBox="0 0 18 18"><path d="M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z" fill-rule="evenodd" fill-opacity=".5"/></symbol><symbol id="plyr-captions-on" viewBox="0 0 18 18"><path d="M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z" fill-rule="evenodd"/></symbol><symbol id="plyr-enter-fullscreen" viewBox="0 0 18 18"><path d="M10 3h3.6l-4 4L11 8.4l4-4V8h2V1h-7zM7 9.6l-4 4V10H1v7h7v-2H4.4l4-4z"/></symbol><symbol id="plyr-exit-fullscreen" viewBox="0 0 18 18"><path d="M1 12h3.6l-4 4L2 17.4l4-4V17h2v-7H1zM16 .6l-4 4V1h-2v7h7V6h-3.6l4-4z"/></symbol><symbol id="plyr-fast-forward" viewBox="0 0 18 18"><path d="M7.875 7.171L0 1v16l7.875-6.171V17L18 9 7.875 1z"/></symbol><symbol id="plyr-muted" viewBox="0 0 18 18"><path d="M12.4 12.5l2.1-2.1 2.1 2.1 1.4-1.4L15.9 9 18 6.9l-1.4-1.4-2.1 2.1-2.1-2.1L11 6.9 13.1 9 11 11.1zM3.786 6.008H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"/></symbol><symbol id="plyr-pause" viewBox="0 0 18 18"><path d="M6 1H3c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1zM12 1c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1h-3z"/></symbol><symbol id="plyr-play" viewBox="0 0 18 18"><path d="M15.562 8.1L3.87.225C3.052-.337 2 .225 2 1.125v15.75c0 .9 1.052 1.462 1.87.9L15.563 9.9c.584-.45.584-1.35 0-1.8z"/></symbol><symbol id="plyr-restart" viewBox="0 0 18 18"><path d="M9.7 1.2l.7 6.4 2.1-2.1c1.9 1.9 1.9 5.1 0 7-.9 1-2.2 1.5-3.5 1.5-1.3 0-2.6-.5-3.5-1.5-1.9-1.9-1.9-5.1 0-7 .6-.6 1.4-1.1 2.3-1.3l-.6-1.9C6 2.6 4.9 3.2 4 4.1 1.3 6.8 1.3 11.2 4 14c1.3 1.3 3.1 2 4.9 2 1.9 0 3.6-.7 4.9-2 2.7-2.7 2.7-7.1 0-9.9L16 1.9l-6.3-.7z"/></symbol><symbol id="plyr-rewind" viewBox="0 0 18 18"><path d="M10.125 1L0 9l10.125 8v-6.171L18 17V1l-7.875 6.171z"/></symbol><symbol id="plyr-volume" viewBox="0 0 18 18"><path d="M15.6 3.3c-.4-.4-1-.4-1.4 0-.4.4-.4 1 0 1.4C15.4 5.9 16 7.4 16 9c0 1.6-.6 3.1-1.8 4.3-.4.4-.4 1 0 1.4.2.2.5.3.7.3.3 0 .5-.1.7-.3C17.1 13.2 18 11.2 18 9s-.9-4.2-2.4-5.7z"/><path d="M11.282 5.282a.909.909 0 0 0 0 1.316c.735.735.995 1.458.995 2.402 0 .936-.425 1.917-.995 2.487a.909.909 0 0 0 0 1.316c.145.145.636.262 1.018.156a.725.725 0 0 0 .298-.156C13.773 11.733 14.13 10.16 14.13 9c0-.17-.002-.34-.011-.51-.053-.992-.319-2.005-1.522-3.208a.909.909 0 0 0-1.316 0zM3.786 6.008H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"/></symbol></svg>
|
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg"><symbol id="plyr-airplay" viewBox="0 0 18 18"><path d="M16 1H2a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h3v-2H3V3h12v8h-2v2h3a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z"/><path d="M4 17h10l-5-6z"/></symbol><symbol id="plyr-captions-off" viewBox="0 0 18 18"><path d="M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z" fill-rule="evenodd" fill-opacity=".5"/></symbol><symbol id="plyr-captions-on" viewBox="0 0 18 18"><path d="M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z" fill-rule="evenodd"/></symbol><symbol id="plyr-enter-fullscreen" viewBox="0 0 18 18"><path d="M10 3h3.6l-4 4L11 8.4l4-4V8h2V1h-7zM7 9.6l-4 4V10H1v7h7v-2H4.4l4-4z"/></symbol><symbol id="plyr-exit-fullscreen" viewBox="0 0 18 18"><path d="M1 12h3.6l-4 4L2 17.4l4-4V17h2v-7H1zM16 .6l-4 4V1h-2v7h7V6h-3.6l4-4z"/></symbol><symbol id="plyr-fast-forward" viewBox="0 0 18 18"><path d="M7.875 7.171L0 1v16l7.875-6.171V17L18 9 7.875 1z"/></symbol><symbol id="plyr-muted" viewBox="0 0 18 18"><path d="M12.4 12.5l2.1-2.1 2.1 2.1 1.4-1.4L15.9 9 18 6.9l-1.4-1.4-2.1 2.1-2.1-2.1L11 6.9 13.1 9 11 11.1zM3.786 6.008H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"/></symbol><symbol id="plyr-pause" viewBox="0 0 18 18"><path d="M6 1H3c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1zM12 1c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1h-3z"/></symbol><symbol id="plyr-pip" viewBox="0 0 18 18"><path d="M13.293 3.293L7.022 9.564l1.414 1.414 6.271-6.271L17 7V1h-6z"/><path d="M13 15H3V5h5V3H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-6h-2v5z"/></symbol><symbol id="plyr-play" viewBox="0 0 18 18"><path d="M15.562 8.1L3.87.225C3.052-.337 2 .225 2 1.125v15.75c0 .9 1.052 1.462 1.87.9L15.563 9.9c.584-.45.584-1.35 0-1.8z"/></symbol><symbol id="plyr-restart" viewBox="0 0 18 18"><path d="M9.7 1.2l.7 6.4 2.1-2.1c1.9 1.9 1.9 5.1 0 7-.9 1-2.2 1.5-3.5 1.5-1.3 0-2.6-.5-3.5-1.5-1.9-1.9-1.9-5.1 0-7 .6-.6 1.4-1.1 2.3-1.3l-.6-1.9C6 2.6 4.9 3.2 4 4.1 1.3 6.8 1.3 11.2 4 14c1.3 1.3 3.1 2 4.9 2 1.9 0 3.6-.7 4.9-2 2.7-2.7 2.7-7.1 0-9.9L16 1.9l-6.3-.7z"/></symbol><symbol id="plyr-rewind" viewBox="0 0 18 18"><path d="M10.125 1L0 9l10.125 8v-6.171L18 17V1l-7.875 6.171z"/></symbol><symbol id="plyr-settings" viewBox="0 0 18 18"><path d="M16.135 7.784a2 2 0 0 1-1.23-2.969c.322-.536.225-.998-.094-1.316l-.31-.31c-.318-.318-.78-.415-1.316-.094a2 2 0 0 1-2.969-1.23C10.065 1.258 9.669 1 9.219 1h-.438c-.45 0-.845.258-.997.865a2 2 0 0 1-2.969 1.23c-.536-.322-.999-.225-1.317.093l-.31.31c-.318.318-.415.781-.093 1.317a2 2 0 0 1-1.23 2.969C1.26 7.935 1 8.33 1 8.781v.438c0 .45.258.845.865.997a2 2 0 0 1 1.23 2.969c-.322.536-.225.998.094 1.316l.31.31c.319.319.782.415 1.316.094a2 2 0 0 1 2.969 1.23c.151.607.547.865.997.865h.438c.45 0 .845-.258.997-.865a2 2 0 0 1 2.969-1.23c.535.321.997.225 1.316-.094l.31-.31c.318-.318.415-.781.094-1.316a2 2 0 0 1 1.23-2.969c.607-.151.865-.547.865-.997v-.438c0-.451-.26-.846-.865-.997zM9 12a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"/></symbol><symbol id="plyr-volume" viewBox="0 0 18 18"><path d="M15.6 3.3c-.4-.4-1-.4-1.4 0-.4.4-.4 1 0 1.4C15.4 5.9 16 7.4 16 9c0 1.6-.6 3.1-1.8 4.3-.4.4-.4 1 0 1.4.2.2.5.3.7.3.3 0 .5-.1.7-.3C17.1 13.2 18 11.2 18 9s-.9-4.2-2.4-5.7z"/><path d="M11.282 5.282a.909.909 0 0 0 0 1.316c.735.735.995 1.458.995 2.402 0 .936-.425 1.917-.995 2.487a.909.909 0 0 0 0 1.316c.145.145.636.262 1.018.156a.725.725 0 0 0 .298-.156C13.773 11.733 14.13 10.16 14.13 9c0-.17-.002-.34-.011-.51-.053-.992-.319-2.005-1.522-3.208a.909.909 0 0 0-1.316 0zM3.786 6.008H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"/></symbol></svg>
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 4.9 KiB |
14
gulpfile.js
14
gulpfile.js
@ -1,9 +1,9 @@
|
|||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Gulp build script
|
// Gulp build script
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
/*global require, __dirname,Buffer*/
|
/* global require, __dirname,Buffer */
|
||||||
/*jshint -W079 */
|
/* jshint -W079 */
|
||||||
|
/* beautify ignore:start */
|
||||||
var fs = require("fs"),
|
var fs = require("fs"),
|
||||||
path = require("path"),
|
path = require("path"),
|
||||||
gulp = require("gulp"),
|
gulp = require("gulp"),
|
||||||
@ -296,7 +296,7 @@ gulp.task("demo", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Open the demo site to check it's sweet
|
// Open the demo site to check it's sweet
|
||||||
gulp.task("symlinks", function () {
|
/*gulp.task("symlinks", function () {
|
||||||
console.log("Updating symlinks...");
|
console.log("Updating symlinks...");
|
||||||
|
|
||||||
return gulp.src(paths.upload)
|
return gulp.src(paths.upload)
|
||||||
@ -316,7 +316,7 @@ gulp.task("symlinks", function () {
|
|||||||
|
|
||||||
callback(null, chunk);
|
callback(null, chunk);
|
||||||
}));
|
}));
|
||||||
});
|
});*/
|
||||||
|
|
||||||
// Open the demo site to check it's sweet
|
// Open the demo site to check it's sweet
|
||||||
gulp.task("open", function () {
|
gulp.task("open", function () {
|
||||||
@ -333,5 +333,7 @@ gulp.task("open", function () {
|
|||||||
|
|
||||||
// Do everything
|
// Do everything
|
||||||
gulp.task("publish", function () {
|
gulp.task("publish", function () {
|
||||||
run(tasks.js, tasks.less, tasks.sprite, "cdn", "demo", "symlinks");
|
run(tasks.js, tasks.less, tasks.sprite, "cdn", "demo");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* beautify ignore:end */
|
||||||
|
34
notes.md
Normal file
34
notes.md
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
### Todo
|
||||||
|
|
||||||
|
#### To build
|
||||||
|
- Get list of subtitles/captions available (HTML5)
|
||||||
|
- Add preferred quality option into config
|
||||||
|
- Update quality options on YouTube play (can't get up front?!)
|
||||||
|
- Update speed options on YouTube load
|
||||||
|
|
||||||
|
- Get quality options for HTML5 somehow (multi source?)
|
||||||
|
- Build templating for controls somehow
|
||||||
|
- Finish and test PiP (need Sierra VM)
|
||||||
|
- Finish and test AirPlay (need Sierra VM)
|
||||||
|
|
||||||
|
- Download button - grab first <source> or src attribute (or maybe use currentSrc?) for HTML5 and links for embedded players
|
||||||
|
|
||||||
|
# Notes
|
||||||
|
- No quality HTML5 support (yet)
|
||||||
|
- No Vimeo quality support
|
||||||
|
- No Vimeo or YouTube caption support
|
||||||
|
- No PiP or AirPlay for Vimeo/YouTube
|
||||||
|
|
||||||
|
#### Bugs
|
||||||
|
- Fix audio setup bug when calling .setup() again
|
||||||
|
- Fix events on unsupported devices (iOS)
|
||||||
|
- Investigate iOS inline playback
|
||||||
|
- Look at Vimeo's "background" option
|
||||||
|
|
||||||
|
#### Breaking changes
|
||||||
|
- Custom controls HTML removed (temporarily, will return) - perhaps can re-instate but no options UI
|
||||||
|
- Selectors changes (new `input` and `display` object) - DOCUMENT
|
||||||
|
|
||||||
|
## Added
|
||||||
|
- Seek i8n label
|
||||||
|
- Loop related i8n labels
|
12
package.json
12
package.json
@ -7,21 +7,21 @@
|
|||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"gulp": "^3.9.1",
|
"gulp": "^3.9.1",
|
||||||
"gulp-autoprefixer": "^3.1.0",
|
"gulp-autoprefixer": "^3.1.1",
|
||||||
"gulp-clean-css": "^2.0.6",
|
"gulp-clean-css": "^2.0.12",
|
||||||
"gulp-concat": "^2.3.3",
|
"gulp-concat": "^2.3.3",
|
||||||
"gulp-less": "^3.0.5",
|
"gulp-less": "^3.0.5",
|
||||||
"gulp-open": "^2.0.0",
|
"gulp-open": "^2.0.0",
|
||||||
"gulp-rename": "^1.2.0",
|
"gulp-rename": "^1.2.0",
|
||||||
"gulp-replace": "^0.5.3",
|
"gulp-replace": "^0.5.3",
|
||||||
"gulp-s3": "^0.3.0",
|
"gulp-s3": "^0.3.0",
|
||||||
"gulp-sass": "^2.3.1",
|
"gulp-sass": "^2.3.2",
|
||||||
"gulp-size": "^2.1.0",
|
"gulp-size": "^2.1.0",
|
||||||
"gulp-svgmin": "^1.2.2",
|
"gulp-svgmin": "^1.2.2",
|
||||||
"gulp-svgstore": "^5.0.5",
|
"gulp-svgstore": "^6.0.0",
|
||||||
"gulp-uglify": "^1.5.3",
|
"gulp-uglify": "^2.0.0",
|
||||||
"gulp-util": "^3.0.7",
|
"gulp-util": "^3.0.7",
|
||||||
"run-sequence": "^1.1.5",
|
"run-sequence": "^1.2.2",
|
||||||
"through2": "^2.0.1"
|
"through2": "^2.0.1"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
53
readme.md
53
readme.md
@ -368,29 +368,17 @@ Note the single quotes encapsulating the JSON and double quotes on the object ke
|
|||||||
<td><code>true</code></td>
|
<td><code>true</code></td>
|
||||||
<td>Displays the duration of the media on the "metadataloaded" event (on startup) in the current time display. This will only work if the `preload` attribute is not set to `none` (or is not set at all) and you choose not to display the duration (see <code>controls</code> option).</td>
|
<td>Displays the duration of the media on the "metadataloaded" event (on startup) in the current time display. This will only work if the `preload` attribute is not set to `none` (or is not set at all) and you choose not to display the duration (see <code>controls</code> option).</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td><code>selectors</code></td>
|
|
||||||
<td>Object</td>
|
|
||||||
<td>—</td>
|
|
||||||
<td>See <code>plyr.js</code> in <code>/src</code> for more info. You probably don't need to change any of these.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>listeners</code></td>
|
<td><code>listeners</code></td>
|
||||||
<td>Object</td>
|
<td>Object</td>
|
||||||
<td>—</td>
|
<td>—</td>
|
||||||
<td>Allows early binding of event listeners to the controls. See <code>controls</code> above for list of controls and see <code>plyr.js</code> in <code>/src</code> for more info.</td>
|
<td>Allows early binding of event listeners to the controls. See <code>controls</code> above for list of controls and see <code>plyr.js</code> in <code>/src</code> for more info.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td><code>classes</code></td>
|
|
||||||
<td>Object</td>
|
|
||||||
<td>—</td>
|
|
||||||
<td>Similar to above, these are the classes added to the player when state changes occur.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>captions</code></td>
|
<td><code>captions</code></td>
|
||||||
<td>Object</td>
|
<td>Object</td>
|
||||||
<td>—</td>
|
<td>—</td>
|
||||||
<td>One property <code>defaultActive</code> which toggles if captions should be on by default. The default value is <code>false</code>.</td>
|
<td>Two properties: <code>defaultActive</code> which toggles if captions should be on by default. The default value is <code>false</code>. The <code>selectedIndex</code> property sets the default starting index for the caption tracks.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>fullscreen</code></td>
|
<td><code>fullscreen</code></td>
|
||||||
@ -404,6 +392,18 @@ Note the single quotes encapsulating the JSON and double quotes on the object ke
|
|||||||
<td>—</td>
|
<td>—</td>
|
||||||
<td>Two properties; <code>enabled</code> which toggles if local storage should be enabled (if the browser supports it). The default value is `true`. This enables storing user settings, currently it only stores volume but more will be added later. The second property <code>key</code> is the key used for the local storage. The default is <code>plyr_volume</code> until more settings are stored.</td>
|
<td>Two properties; <code>enabled</code> which toggles if local storage should be enabled (if the browser supports it). The default value is `true`. This enables storing user settings, currently it only stores volume but more will be added later. The second property <code>key</code> is the key used for the local storage. The default is <code>plyr_volume</code> until more settings are stored.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>speeds</code></td>
|
||||||
|
<td>Array</td>
|
||||||
|
<td>[1.0, 1.5, 2.0, 0.5]</td>
|
||||||
|
<td>Playback speed list.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>loops</code></td>
|
||||||
|
<td>Array</td>
|
||||||
|
<td>[Loop All, Loop in, Loop out, No Loop]</td>
|
||||||
|
<td>Playback loop list.</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@ -595,6 +595,11 @@ Here's a list of the methods supported:
|
|||||||
<td>—</td>
|
<td>—</td>
|
||||||
<td>Toggles whether captions are enabled.</td>
|
<td>Toggles whether captions are enabled.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>setCaptionIndex()</code></td>
|
||||||
|
<td>Number</td>
|
||||||
|
<td>Set the active track to the provided number. Index starts with 0.</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>toggleFullscreen()</code></td>
|
<td><code>toggleFullscreen()</code></td>
|
||||||
<td>Event</td>
|
<td>Event</td>
|
||||||
@ -663,7 +668,12 @@ player.source({
|
|||||||
srclang:'en',
|
srclang:'en',
|
||||||
src: '/path/to/captions.vtt',
|
src: '/path/to/captions.vtt',
|
||||||
default: true
|
default: true
|
||||||
}]
|
}],
|
||||||
|
loopKeyEvents: {
|
||||||
|
toggleLoop: 76,
|
||||||
|
loopin: 73,
|
||||||
|
loopout: 79
|
||||||
|
}
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -979,6 +989,21 @@ By default, a player will bind the following keyboard shortcuts when it has focu
|
|||||||
<td>✔</td>
|
<td>✔</td>
|
||||||
<td>Toggle captions</td>
|
<td>Toggle captions</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>l</code></td>
|
||||||
|
<td></td>
|
||||||
|
<td>Toggle Loop All/No Loop</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>i</code></td>
|
||||||
|
<td></td>
|
||||||
|
<td>Set the start marker of the loop</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>o</code></td>
|
||||||
|
<td></td>
|
||||||
|
<td>Set the end marker of the loop</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
4537
src/js/plyr.js
4537
src/js/plyr.js
File diff suppressed because it is too large
Load Diff
@ -11,6 +11,16 @@
|
|||||||
@keyframes plyr-progress {
|
@keyframes plyr-progress {
|
||||||
to { background-position: @plyr-progress-loading-size 0; }
|
to { background-position: @plyr-progress-loading-size 0; }
|
||||||
}
|
}
|
||||||
|
@keyframes plyr-popup {
|
||||||
|
from {
|
||||||
|
transform: translateY(10px);
|
||||||
|
opacity: .5;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
transform: translateY(0);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Styles
|
// Styles
|
||||||
// -------------------------------
|
// -------------------------------
|
||||||
@ -20,6 +30,7 @@
|
|||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
font-family: @plyr-font-family;
|
font-family: @plyr-font-family;
|
||||||
|
font-weight: 500;
|
||||||
direction: ltr;
|
direction: ltr;
|
||||||
|
|
||||||
& when (@plyr-border-box = true) {
|
& when (@plyr-border-box = true) {
|
||||||
@ -40,6 +51,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ARIA
|
||||||
|
[aria-hidden='true'] {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
// Focus
|
// Focus
|
||||||
&:focus {
|
&:focus {
|
||||||
outline: 0;
|
outline: 0;
|
||||||
@ -173,6 +189,9 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
background: #000;
|
background: #000;
|
||||||
border-radius: inherit;
|
border-radius: inherit;
|
||||||
|
// Require z-index to force border-radius
|
||||||
|
z-index: 0;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Container for embeds
|
// Container for embeds
|
||||||
@ -180,11 +199,11 @@
|
|||||||
padding-bottom: 56.25%; /* 16:9 */
|
padding-bottom: 56.25%; /* 16:9 */
|
||||||
height: 0;
|
height: 0;
|
||||||
border-radius: inherit;
|
border-radius: inherit;
|
||||||
|
|
||||||
// Require overflow and z-index to force border-radius
|
// Require overflow and z-index to force border-radius
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
|
|
||||||
|
|
||||||
iframe {
|
iframe {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@ -225,7 +244,6 @@
|
|||||||
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;
|
||||||
font-weight: 400;
|
|
||||||
|
|
||||||
span {
|
span {
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
@ -270,24 +288,44 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
// Spacing
|
// Spacing
|
||||||
> button,
|
> .plyr__control,
|
||||||
.plyr__progress,
|
.plyr__progress,
|
||||||
.plyr__time {
|
.plyr__time,
|
||||||
|
.plyr__menu {
|
||||||
margin-left: (@plyr-control-spacing / 2);
|
margin-left: (@plyr-control-spacing / 2);
|
||||||
|
|
||||||
&:first-child {
|
&:first-child,
|
||||||
|
&:first-child + [data-plyr="pause"] {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.plyr__volume {
|
.plyr__volume {
|
||||||
margin-left: (@plyr-control-spacing / 2);
|
margin-left: (@plyr-control-spacing / 2);
|
||||||
}
|
}
|
||||||
[data-plyr="pause"] {
|
|
||||||
margin-left: 0;
|
@media (min-width: @plyr-bp-screen-sm) {
|
||||||
|
> .plyr__control,
|
||||||
|
.plyr__progress,
|
||||||
|
.plyr__time,
|
||||||
|
.plyr__menu {
|
||||||
|
margin-left: @plyr-control-spacing;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Buttons
|
> .plyr__control + .plyr__control,
|
||||||
button {
|
.plyr__menu + .plyr__control,
|
||||||
|
> .plyr__control + .plyr__menu {
|
||||||
|
margin-left: (@plyr-control-spacing / 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Hide controls
|
||||||
|
.plyr--hide-controls .plyr__controls {
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Buttons
|
||||||
|
.plyr__control {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
@ -306,14 +344,8 @@
|
|||||||
height: @plyr-control-icon-size;
|
height: @plyr-control-icon-size;
|
||||||
display: block;
|
display: block;
|
||||||
fill: currentColor;
|
fill: currentColor;
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default focus
|
|
||||||
&:focus {
|
|
||||||
outline: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Hide toggle icons by default
|
// Hide toggle icons by default
|
||||||
.icon--exit-fullscreen,
|
.icon--exit-fullscreen,
|
||||||
.icon--muted,
|
.icon--muted,
|
||||||
@ -321,18 +353,10 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: @plyr-bp-screen-sm) {
|
// Default focus
|
||||||
> button,
|
&:focus {
|
||||||
.plyr__progress,
|
outline: 0;
|
||||||
.plyr__time {
|
|
||||||
margin-left: @plyr-control-spacing;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
// Hide controls
|
|
||||||
.plyr--hide-controls .plyr__controls {
|
|
||||||
opacity: 0;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Video controls
|
// Video controls
|
||||||
@ -343,16 +367,17 @@
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
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(fade(@plyr-video-controls-bg, 0%), fade(@plyr-video-controls-bg, 50%));
|
background: linear-gradient(fade(@plyr-video-controls-bg, 0%), fade(@plyr-video-controls-bg, 70%));
|
||||||
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 .3s ease;
|
||||||
|
|
||||||
button {
|
.plyr__control {
|
||||||
// Hover and tab focus
|
// Hover and tab focus
|
||||||
&.tab-focus:focus,
|
&.tab-focus:focus,
|
||||||
&:hover {
|
&:hover,
|
||||||
|
&[aria-expanded='true'] {
|
||||||
background: @plyr-video-control-bg-hover;
|
background: @plyr-video-control-bg-hover;
|
||||||
color: @plyr-video-control-color-hover;
|
color: @plyr-video-control-color-hover;
|
||||||
}
|
}
|
||||||
@ -367,10 +392,11 @@
|
|||||||
border: @plyr-audio-controls-border;
|
border: @plyr-audio-controls-border;
|
||||||
color: @plyr-audio-control-color;
|
color: @plyr-audio-control-color;
|
||||||
|
|
||||||
button {
|
.plyr__control {
|
||||||
// Hover and tab focus
|
// Hover and tab focus
|
||||||
&.tab-focus:focus,
|
&.tab-focus:focus,
|
||||||
&:hover {
|
&:hover,
|
||||||
|
&[aria-expanded='true'] {
|
||||||
background: @plyr-audio-control-bg-hover;
|
background: @plyr-audio-control-bg-hover;
|
||||||
color: @plyr-audio-control-color-hover;
|
color: @plyr-audio-control-color-hover;
|
||||||
}
|
}
|
||||||
@ -400,6 +426,7 @@
|
|||||||
height: 20px;
|
height: 20px;
|
||||||
display: block;
|
display: block;
|
||||||
fill: currentColor;
|
fill: currentColor;
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
@ -427,9 +454,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Change icons on state change
|
// Change icons on state change
|
||||||
.plyr--fullscreen-active .icon--exit-fullscreen,
|
.plyr--fullscreen-active .plyr__control .icon--exit-fullscreen,
|
||||||
.plyr--muted .plyr__controls .icon--muted,
|
.plyr--muted .plyr__control .icon--muted,
|
||||||
.plyr--captions-active .plyr__controls .icon--captions-on {
|
.plyr--captions-active .plyr__control .icon--captions-on {
|
||||||
display: block;
|
display: block;
|
||||||
|
|
||||||
& + svg {
|
& + svg {
|
||||||
@ -439,14 +466,173 @@
|
|||||||
|
|
||||||
// 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'],
|
||||||
|
.plyr [data-plyr='pip'],
|
||||||
|
.plyr [data-plyr='airplay'] {
|
||||||
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'],
|
||||||
|
.plyr--pip-enabled [data-plyr='pip'],
|
||||||
|
.plyr--airplay-enabled [data-plyr='airplay'] {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Menus
|
||||||
|
// --------------------------------------------------------------
|
||||||
|
.plyr__menu {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
// Hide tooltip
|
||||||
|
.plyr__control svg {
|
||||||
|
transition: transform .3s ease;
|
||||||
|
}
|
||||||
|
.plyr__control[aria-expanded='true'] {
|
||||||
|
svg {
|
||||||
|
transform: rotate(45deg);
|
||||||
|
}
|
||||||
|
.plyr__tooltip {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// The actual menu container
|
||||||
|
&__container {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 1;
|
||||||
|
bottom: 100%;
|
||||||
|
right: -5px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
animation: plyr-popup .2s ease;
|
||||||
|
|
||||||
|
background: @plyr-menu-bg;
|
||||||
|
border-radius: 4px;
|
||||||
|
|
||||||
|
white-space: nowrap;
|
||||||
|
text-align: left;
|
||||||
|
color: @plyr-menu-color;
|
||||||
|
font-size: @plyr-font-size-small;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
overflow: hidden;
|
||||||
|
transition: height .35s cubic-bezier(.4,0,.2,1), width .35s cubic-bezier(.4,0,.2,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Arrow
|
||||||
|
&::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: 100%;
|
||||||
|
right: 15px;
|
||||||
|
height: 0;
|
||||||
|
width: 0;
|
||||||
|
border: 6px solid transparent;
|
||||||
|
border-top-color: @plyr-menu-bg;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
margin: 0;
|
||||||
|
padding: @plyr-control-padding;
|
||||||
|
list-style: none;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Options
|
||||||
|
.plyr__control {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
padding: @plyr-control-padding (@plyr-control-padding * 2);
|
||||||
|
color: @plyr-menu-color;
|
||||||
|
font-weight: 600;
|
||||||
|
user-select: none;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
border: 5px solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
&--forward {
|
||||||
|
padding-right: ceil(@plyr-control-padding * 4);
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
right: 5px;
|
||||||
|
border-left-color: fade(@plyr-menu-color, 80%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&--back {
|
||||||
|
position: relative;
|
||||||
|
@horizontal-padding: (@plyr-control-padding * 2);
|
||||||
|
width: ~"calc(100% - @{horizontal-padding})";
|
||||||
|
margin: @plyr-control-padding;
|
||||||
|
margin-bottom: floor(@plyr-control-padding / 2);
|
||||||
|
padding-left: ceil(@plyr-control-padding * 4);
|
||||||
|
font-weight: 500;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
left: 5px;
|
||||||
|
border-right-color: fade(@plyr-menu-color, 80%);
|
||||||
|
}
|
||||||
|
&::before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: 100%;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 1px;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-top: ceil(@plyr-control-padding / 2);
|
||||||
|
background: fade(#000, 15%);
|
||||||
|
box-shadow: 0 1px 0 fade(#fff, 10%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
label.plyr__control {
|
||||||
|
padding-left: ceil(@plyr-control-padding * 2.5);
|
||||||
|
|
||||||
|
input[type="radio"] {
|
||||||
|
position: relative;
|
||||||
|
left: -@plyr-control-padding;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Option value
|
||||||
|
.plyr__menu__value {
|
||||||
|
display: inherit;
|
||||||
|
margin-left: auto;
|
||||||
|
padding-left: ceil(@plyr-control-padding * 3.5);
|
||||||
|
pointer-events: none;
|
||||||
|
overflow: hidden;
|
||||||
|
font-weight: 500;
|
||||||
|
color: fade(@plyr-menu-color, 80%);
|
||||||
|
|
||||||
|
.plyr__badge {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// When animating between menus
|
||||||
|
&.is-resizing {
|
||||||
|
overflow: hidden;
|
||||||
|
transition: height .35s cubic-bezier(.4,0,.2,1), width .35s cubic-bezier(.4,0,.2,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Badge
|
||||||
|
// --------------------------------------------------------------
|
||||||
|
.plyr__badge {
|
||||||
|
padding: 2px 4px;
|
||||||
|
border-radius: 2px;
|
||||||
|
background: @plyr-menu-color;
|
||||||
|
color: @plyr-menu-bg;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
// Tooltips
|
// Tooltips
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
.plyr__tooltip {
|
.plyr__tooltip {
|
||||||
@ -463,6 +649,7 @@
|
|||||||
|
|
||||||
color: @plyr-tooltip-color;
|
color: @plyr-tooltip-color;
|
||||||
font-size: @plyr-font-size-small;
|
font-size: @plyr-font-size-small;
|
||||||
|
font-weight: 500;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
|
|
||||||
transform: translate(-50%, 10px) scale(.8);
|
transform: translate(-50%, 10px) scale(.8);
|
||||||
@ -486,18 +673,19 @@
|
|||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.plyr button:hover .plyr__tooltip,
|
.plyr .plyr__control:hover .plyr__tooltip,
|
||||||
.plyr button.tab-focus:focus .plyr__tooltip,
|
.plyr .plyr__control.tab-focus:focus .plyr__tooltip,
|
||||||
.plyr__tooltip--visible {
|
.plyr__tooltip--visible {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: translate(-50%, 0) scale(1);
|
transform: translate(-50%, 0) scale(1);
|
||||||
}
|
}
|
||||||
.plyr button:hover .plyr__tooltip {
|
.plyr .plyr__control:hover .plyr__tooltip {
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// First tooltip
|
// First tooltip
|
||||||
.plyr__controls button:first-child .plyr__tooltip {
|
.plyr__controls > .plyr__control:first-child .plyr__tooltip,
|
||||||
|
.plyr__controls > .plyr__control:first-child + .plyr__control .plyr__tooltip {
|
||||||
left: 0;
|
left: 0;
|
||||||
transform: translate(0, 10px) scale(.8);
|
transform: translate(0, 10px) scale(.8);
|
||||||
transform-origin: 0 100%;
|
transform-origin: 0 100%;
|
||||||
@ -508,7 +696,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Last tooltip
|
// Last tooltip
|
||||||
.plyr__controls button:last-child .plyr__tooltip {
|
.plyr__controls > .plyr__control:last-child .plyr__tooltip {
|
||||||
right: 0;
|
right: 0;
|
||||||
transform: translate(0, 10px) scale(.8);
|
transform: translate(0, 10px) scale(.8);
|
||||||
transform-origin: 100% 100%;
|
transform-origin: 100% 100%;
|
||||||
@ -520,8 +708,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.plyr__controls button:first-child,
|
.plyr__controls > .plyr__control:first-child,
|
||||||
.plyr__controls button:last-child {
|
.plyr__controls > .plyr__control:first-child + .plyr__control,
|
||||||
|
.plyr__controls > .plyr__control:last-child {
|
||||||
&:hover .plyr__tooltip,
|
&:hover .plyr__tooltip,
|
||||||
&.tab-focus:focus .plyr__tooltip,
|
&.tab-focus:focus .plyr__tooltip,
|
||||||
.plyr__tooltip--visible {
|
.plyr__tooltip--visible {
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
@plyr-font-size-base: 16px;
|
@plyr-font-size-base: 16px;
|
||||||
|
|
||||||
// Captions
|
// Captions
|
||||||
@plyr-captions-bg: fade(#000, 70%);
|
@plyr-captions-bg: fade(#000, 60%);
|
||||||
@plyr-captions-color: #fff;
|
@plyr-captions-color: #fff;
|
||||||
@plyr-font-size-captions-base: @plyr-font-size-base;
|
@plyr-font-size-captions-base: @plyr-font-size-base;
|
||||||
@plyr-font-size-captions-medium: ceil(@plyr-font-size-base * 1.5);
|
@plyr-font-size-captions-medium: ceil(@plyr-font-size-base * 1.5);
|
||||||
@ -38,15 +38,20 @@
|
|||||||
@plyr-audio-control-bg-hover: @plyr-color-main;
|
@plyr-audio-control-bg-hover: @plyr-color-main;
|
||||||
|
|
||||||
// Tooltips
|
// Tooltips
|
||||||
@plyr-tooltip-bg: fade(#000, 70%);
|
@plyr-tooltip-bg: fade(#343f4a, 90%);
|
||||||
@plyr-tooltip-color: #fff;
|
@plyr-tooltip-color: #fff;
|
||||||
@plyr-tooltip-padding: (@plyr-control-spacing / 2);
|
@plyr-tooltip-padding: (@plyr-control-spacing / 2);
|
||||||
@plyr-tooltip-arrow-size: 4px;
|
@plyr-tooltip-arrow-size: 4px;
|
||||||
@plyr-tooltip-radius: 3px;
|
@plyr-tooltip-radius: 3px;
|
||||||
|
|
||||||
|
// Menus
|
||||||
|
@plyr-menu-bg: @plyr-tooltip-bg;
|
||||||
|
@plyr-menu-color: @plyr-tooltip-color;
|
||||||
|
@plyr-menu-arrow-size: 6px;
|
||||||
|
|
||||||
// Progress
|
// Progress
|
||||||
@plyr-progress-loading-size: 25px;
|
@plyr-progress-loading-size: 25px;
|
||||||
@plyr-progress-loading-bg: fade(#000, 15%);
|
@plyr-progress-loading-bg: fade(#343f4a, 20%);
|
||||||
@plyr-video-progress-bg: fade(#fff, 25%);
|
@plyr-video-progress-bg: fade(#fff, 25%);
|
||||||
@plyr-video-progress-buffered-bg: @plyr-video-progress-bg;
|
@plyr-video-progress-buffered-bg: @plyr-video-progress-bg;
|
||||||
@plyr-audio-progress-bg: fade(#C6D6DB, 66%);
|
@plyr-audio-progress-bg: fade(#C6D6DB, 66%);
|
||||||
@ -58,7 +63,7 @@
|
|||||||
@plyr-range-thumb-width: floor(@plyr-range-track-height * 2);
|
@plyr-range-thumb-width: floor(@plyr-range-track-height * 2);
|
||||||
@plyr-range-thumb-bg: #fff;
|
@plyr-range-thumb-bg: #fff;
|
||||||
@plyr-range-thumb-border: 2px solid transparent;
|
@plyr-range-thumb-border: 2px solid transparent;
|
||||||
@plyr-range-thumb-shadow: 0 1px 1px fade(@plyr-video-controls-bg, 15%), 0 0 0 1px fade(#000, 15%);
|
@plyr-range-thumb-shadow: 0 1px 1px fade(@plyr-video-controls-bg, 15%), 0 0 0 1px fade(#343f4a, 20%);
|
||||||
@plyr-range-thumb-active-border-color: #fff;
|
@plyr-range-thumb-active-border-color: #fff;
|
||||||
@plyr-range-thumb-active-bg: @plyr-video-control-bg-hover;
|
@plyr-range-thumb-active-bg: @plyr-video-control-bg-hover;
|
||||||
@plyr-range-thumb-active-scale: 1.25;
|
@plyr-range-thumb-active-scale: 1.25;
|
||||||
|
@ -172,6 +172,9 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
background: #000;
|
background: #000;
|
||||||
border-radius: inherit;
|
border-radius: inherit;
|
||||||
|
// Require z-index to force border-radius
|
||||||
|
z-index: 0;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Container for embeds
|
// Container for embeds
|
||||||
@ -269,21 +272,20 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
// Spacing
|
// Spacing
|
||||||
> button,
|
> .plyr__control,
|
||||||
.plyr__progress,
|
.plyr__progress,
|
||||||
.plyr__time {
|
.plyr__time,
|
||||||
|
.plyr__menu {
|
||||||
margin-left: ($plyr-control-spacing / 2);
|
margin-left: ($plyr-control-spacing / 2);
|
||||||
|
|
||||||
&:first-child {
|
&:first-child,
|
||||||
|
&:first-child + [data-plyr="pause"] {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.plyr__volume {
|
.plyr__volume {
|
||||||
margin-left: ($plyr-control-spacing / 2);
|
margin-left: ($plyr-control-spacing / 2);
|
||||||
}
|
}
|
||||||
[data-plyr="pause"] {
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Buttons
|
// Buttons
|
||||||
button {
|
button {
|
||||||
@ -305,6 +307,7 @@
|
|||||||
height: $plyr-control-icon-size;
|
height: $plyr-control-icon-size;
|
||||||
display: block;
|
display: block;
|
||||||
fill: currentColor;
|
fill: currentColor;
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default focus
|
// Default focus
|
||||||
@ -398,6 +401,7 @@
|
|||||||
height: 20px;
|
height: 20px;
|
||||||
display: block;
|
display: block;
|
||||||
fill: currentColor;
|
fill: currentColor;
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
@ -495,7 +499,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// First tooltip
|
// First tooltip
|
||||||
.plyr__controls button:first-child .plyr__tooltip {
|
.plyr__controls > button:first-child .plyr__tooltip,
|
||||||
|
.plyr__controls > button:first-child + button .plyr__tooltip {
|
||||||
left: 0;
|
left: 0;
|
||||||
transform: translate(0, 10px) scale(.8);
|
transform: translate(0, 10px) scale(.8);
|
||||||
transform-origin: 0 100%;
|
transform-origin: 0 100%;
|
||||||
@ -506,7 +511,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(.8);
|
||||||
transform-origin: 100% 100%;
|
transform-origin: 100% 100%;
|
||||||
@ -518,8 +523,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.plyr__controls button:first-child,
|
.plyr__controls > button:first-child,
|
||||||
.plyr__controls button:last-child {
|
.plyr__controls > button:first-child + button,
|
||||||
|
.plyr__controls > button:last-child {
|
||||||
&:hover .plyr__tooltip,
|
&:hover .plyr__tooltip,
|
||||||
&.tab-focus:focus .plyr__tooltip,
|
&.tab-focus:focus .plyr__tooltip,
|
||||||
.plyr__tooltip--visible {
|
.plyr__tooltip--visible {
|
||||||
|
@ -18,7 +18,7 @@ $plyr-font-size-small: 14px !default;
|
|||||||
$plyr-font-size-base: 16px !default;
|
$plyr-font-size-base: 16px !default;
|
||||||
|
|
||||||
// Captions
|
// Captions
|
||||||
$plyr-captions-bg: transparentize(#000, .3) !default;
|
$plyr-captions-bg: transparentize(#000, .4) !default;
|
||||||
$plyr-captions-color: #fff !default;
|
$plyr-captions-color: #fff !default;
|
||||||
$plyr-font-size-captions-base: $plyr-font-size-base !default;
|
$plyr-font-size-captions-base: $plyr-font-size-base !default;
|
||||||
$plyr-font-size-captions-medium: ceil($plyr-font-size-base * 1.5) !default;
|
$plyr-font-size-captions-medium: ceil($plyr-font-size-base * 1.5) !default;
|
||||||
|
7
src/sprite/plyr-airplay.svg
Normal file
7
src/sprite/plyr-airplay.svg
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<g>
|
||||||
|
<path d="M16,1 L2,1 C1.447,1 1,1.447 1,2 L1,12 C1,12.553 1.447,13 2,13 L5,13 L5,11 L3,11 L3,3 L15,3 L15,11 L13,11 L13,13 L16,13 C16.553,13 17,12.553 17,12 L17,2 C17,1.447 16.553,1 16,1 L16,1 Z"></path>
|
||||||
|
<polygon points="4 17 14 17 9 11"></polygon>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 486 B |
7
src/sprite/plyr-pip.svg
Normal file
7
src/sprite/plyr-pip.svg
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<g>
|
||||||
|
<polygon points="13.293 3.293 7.022 9.564 8.436 10.978 14.707 4.707 17 7 17 1 11 1"></polygon>
|
||||||
|
<path d="M13,15 L3,15 L3,5 L8,5 L8,3 L2,3 C1.448,3 1,3.448 1,4 L1,16 C1,16.552 1.448,17 2,17 L14,17 C14.552,17 15,16.552 15,16 L15,10 L13,10 L13,15 L13,15 Z"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 500 B |
6
src/sprite/plyr-settings.svg
Normal file
6
src/sprite/plyr-settings.svg
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<g>
|
||||||
|
<path d="M16.135,7.784 C14.832,7.458 14.214,5.966 14.905,4.815 C15.227,4.279 15.13,3.817 14.811,3.499 L14.501,3.189 C14.183,2.871 13.721,2.774 13.185,3.095 C12.033,3.786 10.541,3.168 10.216,1.865 C10.065,1.258 9.669,1 9.219,1 L8.781,1 C8.331,1 7.936,1.258 7.784,1.865 C7.458,3.168 5.966,3.786 4.815,3.095 C4.279,2.773 3.816,2.87 3.498,3.188 L3.188,3.498 C2.87,3.816 2.773,4.279 3.095,4.815 C3.786,5.967 3.168,7.459 1.865,7.784 C1.26,7.935 1,8.33 1,8.781 L1,9.219 C1,9.669 1.258,10.064 1.865,10.216 C3.168,10.542 3.786,12.034 3.095,13.185 C2.773,13.721 2.87,14.183 3.189,14.501 L3.499,14.811 C3.818,15.13 4.281,15.226 4.815,14.905 C5.967,14.214 7.459,14.832 7.784,16.135 C7.935,16.742 8.331,17 8.781,17 L9.219,17 C9.669,17 10.064,16.742 10.216,16.135 C10.542,14.832 12.034,14.214 13.185,14.905 C13.72,15.226 14.182,15.13 14.501,14.811 L14.811,14.501 C15.129,14.183 15.226,13.72 14.905,13.185 C14.214,12.033 14.832,10.541 16.135,10.216 C16.742,10.065 17,9.669 17,9.219 L17,8.781 C17,8.33 16.74,7.935 16.135,7.784 L16.135,7.784 Z M9,12 C7.343,12 6,10.657 6,9 C6,7.343 7.343,6 9,6 C10.657,6 12,7.343 12,9 C12,10.657 10.657,12 9,12 L9,12 Z"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.3 KiB |
Loading…
x
Reference in New Issue
Block a user