diff options
author | Sam Potts <me@sampotts.me> | 2015-12-11 10:41:29 +1100 |
---|---|---|
committer | Sam Potts <me@sampotts.me> | 2015-12-11 10:41:29 +1100 |
commit | 1371c1341fcc95d52394dc3f69900ae5041a5701 (patch) | |
tree | 9f79c1ab6b162d21b70cda618a1cb5ad2123052a | |
parent | 05bf08a4389ec5c72627f709761578d80b40603f (diff) | |
download | plyr-1371c1341fcc95d52394dc3f69900ae5041a5701.tar.lz plyr-1371c1341fcc95d52394dc3f69900ae5041a5701.tar.xz plyr-1371c1341fcc95d52394dc3f69900ae5041a5701.zip |
Removed Hogan from Docs (Fixes #128)
-rw-r--r-- | bundles.json | 4 | ||||
-rw-r--r-- | controls.md | 12 | ||||
-rw-r--r-- | dist/plyr.js | 2 | ||||
-rw-r--r-- | docs/dist/docs.css | 2 | ||||
-rw-r--r-- | docs/dist/docs.js | 2 | ||||
-rw-r--r-- | docs/dist/templates.js | 2 | ||||
-rw-r--r-- | docs/error.html | 2 | ||||
-rw-r--r-- | docs/index.html | 61 | ||||
-rw-r--r-- | docs/index.master.html | 130 | ||||
-rw-r--r-- | docs/src/js/docs.js | 52 | ||||
-rw-r--r-- | docs/src/js/lib/hogan-3.0.2.mustache.js | 802 | ||||
-rw-r--r-- | docs/src/less/components/buttons.less | 31 | ||||
-rw-r--r-- | docs/src/less/components/icons.less | 22 | ||||
-rw-r--r-- | docs/src/less/components/type.less | 20 | ||||
-rw-r--r-- | docs/src/less/docs.less | 15 | ||||
-rw-r--r-- | docs/src/less/variables.less | 10 | ||||
-rw-r--r-- | docs/src/templates/controls.html | 61 | ||||
-rw-r--r-- | gulpfile.js | 40 | ||||
-rw-r--r-- | package.json | 3 | ||||
-rw-r--r-- | readme.md | 8 |
20 files changed, 281 insertions, 1000 deletions
diff --git a/bundles.json b/bundles.json index f96c12d2..850a0b55 100644 --- a/bundles.json +++ b/bundles.json @@ -16,11 +16,9 @@ }, "js": { "docs.js": [ - "docs/src/js/lib/hogan-3.0.2.mustache.js", "docs/src/js/lib/classlist.js", - "docs/dist/templates.js", "docs/src/js/docs.js" ] } } -}
\ No newline at end of file +} diff --git a/controls.md b/controls.md index bc536f0a..c58c966b 100644 --- a/controls.md +++ b/controls.md @@ -1,10 +1,10 @@ # Controls -This is the markup that is rendered for the Plyr controls. You can use the default controls or provide a customized version of markup based on your needs. +This is the markup that is rendered for the Plyr controls. You can use the default controls or provide a customized version of markup based on your needs. ## Internationalization using default controls -You can provide an `i18n` object as one of your options when initialising the plugin which we be used when rendering the controls. +You can provide an `i18n` object as one of your options when initialising the plugin which we be used when rendering the controls. ### Example @@ -30,16 +30,16 @@ Note: `{seektime}` will be replaced with your configured seek time or the defaul ## Using custom HTML -The example on [plyr.io](http://plyr.io) setup uses a Hogan template. Check out `controls.html` in `/src/templates` to get an idea of how the default html is structured. +You can specify the HTML for the controls using the `html` option. -The classes and data attributes used in your template should match the `selectors` option. +The classes and data attributes used in your template should match the `selectors` option. You need to add several placeholders to your html template that are replaced when rendering: - `{id}` - the dynamically generated ID for the player (for form controls) - `{seektime}` - the seek time specified in options for fast forward and rewind -You can include only the controls you need when specifying custom html. +You can include only the controls you need when specifying custom html. ### Example @@ -107,4 +107,4 @@ This is an example `html` option with all controls. "</button>", "</span>", "</div>"].join("\n"); -```
\ No newline at end of file +``` diff --git a/dist/plyr.js b/dist/plyr.js index e9fab7df..51c4cc20 100644 --- a/dist/plyr.js +++ b/dist/plyr.js @@ -1 +1 @@ -!function(e){"use strict";function t(){var e=['<div class="player-controls">','<div class="player-progress">','<label for="seek{id}" class="sr-only">Seek</label>','<input id="seek{id}" class="player-progress-seek" type="range" min="0" max="100" step="0.5" value="0" data-player="seek">','<progress class="player-progress-played" max="100" value="0">',"<span>0</span>% "+C.i18n.played,"</progress>",'<progress class="player-progress-buffer" max="100" value="0">',"<span>0</span>% "+C.i18n.buffered,"</progress>","</div>",'<span class="player-controls-left">'];return o(C.controls,"restart")&&e.push('<button type="button" data-player="restart">','<svg><use xlink:href="#'+C.iconPrefix+'-restart" /></svg>','<span class="sr-only">'+C.i18n.restart+"</span>","</button>"),o(C.controls,"rewind")&&e.push('<button type="button" data-player="rewind">','<svg><use xlink:href="#'+C.iconPrefix+'-rewind" /></svg>','<span class="sr-only">'+C.i18n.rewind+"</span>","</button>"),o(C.controls,"play")&&e.push('<button type="button" data-player="play">','<svg><use xlink:href="#'+C.iconPrefix+'-play" /></svg>','<span class="sr-only">'+C.i18n.play+"</span>","</button>",'<button type="button" data-player="pause">','<svg><use xlink:href="#'+C.iconPrefix+'-pause" /></svg>','<span class="sr-only">'+C.i18n.pause+"</span>","</button>"),o(C.controls,"fast-forward")&&e.push('<button type="button" data-player="fast-forward">','<svg><use xlink:href="#'+C.iconPrefix+'-fast-forward" /></svg>','<span class="sr-only">'+C.i18n.forward+"</span>","</button>"),o(C.controls,"current-time")&&e.push('<span class="player-time">','<span class="sr-only">'+C.i18n.currentTime+"</span>",'<span class="player-current-time">00:00</span>',"</span>"),o(C.controls,"duration")&&e.push('<span class="player-time">','<span class="sr-only">'+C.i18n.duration+"</span>",'<span class="player-duration">00:00</span>',"</span>"),e.push("</span>",'<span class="player-controls-right">'),o(C.controls,"mute")&&e.push('<button type="button" data-player="mute">','<svg class="icon-muted"><use xlink:href="#'+C.iconPrefix+'-muted" /></svg>','<svg><use xlink:href="#'+C.iconPrefix+'-volume" /></svg>','<span class="sr-only">'+C.i18n.toggleMute+"</span>","</button>"),o(C.controls,"volume")&&e.push('<label for="volume{id}" class="sr-only">'+C.i18n.volume+"</label>",'<input id="volume{id}" class="player-volume" type="range" min="0" max="10" value="5" data-player="volume">'),o(C.controls,"captions")&&e.push('<button type="button" data-player="captions">','<svg class="icon-captions-on"><use xlink:href="#'+C.iconPrefix+'-captions-on" /></svg>','<svg><use xlink:href="#'+C.iconPrefix+'-captions-off" /></svg>','<span class="sr-only">'+C.i18n.toggleCaptions+"</span>","</button>"),o(C.controls,"fullscreen")&&e.push('<button type="button" data-player="fullscreen">','<svg class="icon-exit-fullscreen"><use xlink:href="#'+C.iconPrefix+'-exit-fullscreen" /></svg>','<svg><use xlink:href="#'+C.iconPrefix+'-enter-fullscreen" /></svg>','<span class="sr-only">'+C.i18n.toggleFullscreen+"</span>","</button>"),e.push("</span>","</div>"),e.join("")}function n(e,t){C.debug&&window.console&&console[t?"error":"log"](e)}function r(){var e,t,n,r=navigator.userAgent,a=navigator.appName,s=""+parseFloat(navigator.appVersion),o=parseInt(navigator.appVersion,10);return-1!==navigator.appVersion.indexOf("Windows NT")&&-1!==navigator.appVersion.indexOf("rv:11")?(a="IE",s="11;"):-1!==(t=r.indexOf("MSIE"))?(a="IE",s=r.substring(t+5)):-1!==(t=r.indexOf("Chrome"))?(a="Chrome",s=r.substring(t+7)):-1!==(t=r.indexOf("Safari"))?(a="Safari",s=r.substring(t+7),-1!==(t=r.indexOf("Version"))&&(s=r.substring(t+8))):-1!==(t=r.indexOf("Firefox"))?(a="Firefox",s=r.substring(t+8)):(e=r.lastIndexOf(" ")+1)<(t=r.lastIndexOf("/"))&&(a=r.substring(e,t),s=r.substring(t+1),a.toLowerCase()==a.toUpperCase()&&(a=navigator.appName)),-1!==(n=s.indexOf(";"))&&(s=s.substring(0,n)),-1!==(n=s.indexOf(" "))&&(s=s.substring(0,n)),o=parseInt(""+s,10),isNaN(o)&&(s=""+parseFloat(navigator.appVersion),o=parseInt(navigator.appVersion,10)),{name:a,version:o,ios:/(iPad|iPhone|iPod)/g.test(navigator.platform)}}function a(e,t){var n=e.media;if("video"==e.type)switch(t){case"video/webm":return!(!n.canPlayType||!n.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/no/,""));case"video/mp4":return!(!n.canPlayType||!n.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/,""));case"video/ogg":return!(!n.canPlayType||!n.canPlayType('video/ogg; codecs="theora"').replace(/no/,""))}else if("audio"==e.type)switch(t){case"audio/mpeg":return!(!n.canPlayType||!n.canPlayType("audio/mpeg;").replace(/no/,""));case"audio/ogg":return!(!n.canPlayType||!n.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/,""));case"audio/wav":return!(!n.canPlayType||!n.canPlayType('audio/wav; codecs="1"').replace(/no/,""))}return!1}function s(e){if(!document.querySelectorAll('script[src="'+e+'"]').length){var t=document.createElement("script");t.src=e;var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n)}}function o(e,t){return Array.prototype.indexOf&&-1!=e.indexOf(t)}function i(e,t,n){return e.replace(new RegExp(t.replace(/([.*+?\^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),n)}function u(e,t){e.length||(e=[e]);for(var n=e.length-1;n>=0;n--){var r=n>0?t.cloneNode(!0):t,a=e[n],s=a.parentNode,o=a.nextSibling;r.appendChild(a),o?s.insertBefore(r,o):s.appendChild(r)}}function l(e){for(var t=e.parentNode;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}function c(e){e.parentNode.removeChild(e)}function p(e,t){e.insertBefore(t,e.firstChild)}function d(e,t){for(var n in t)e.setAttribute(n,t[n])}function f(e,t,n){if(e)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=r+(n?" "+t:"")}}function m(e,t,n,r){var a=t.split(" ");if(e instanceof NodeList)for(var s=0;s<e.length;s++)e[s]instanceof Node&&m(e[s],arguments[1],arguments[2],arguments[3]);else for(var o=0;o<a.length;o++)e[r?"addEventListener":"removeEventListener"](a[o],n,!1)}function y(e,t,n){e&&m(e,t,n,!0)}function b(e,t,n){e&&m(e,t,n,!1)}function v(e,t){var n=document.createEvent("MouseEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function g(e,t){return t="boolean"==typeof t?t:!e.getAttribute("aria-pressed"),e.setAttribute("aria-pressed",t),t}function h(e,t){return 0===e||0===t||isNaN(e)||isNaN(t)?0:(e/t*100).toFixed(2)}function w(e,t){for(var n in t)t[n]&&t[n].constructor&&t[n].constructor===Object?(e[n]=e[n]||{},w(e[n],t[n])):e[n]=t[n];return e}function k(){var e={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",element:null,prefix:""},t="webkit moz o ms khtml".split(" ");if("undefined"!=typeof document.cancelFullScreen)e.supportsFullScreen=!0;else for(var n=0,r=t.length;r>n;n++){if(e.prefix=t[n],"undefined"!=typeof document[e.prefix+"CancelFullScreen"]){e.supportsFullScreen=!0;break}if("undefined"!=typeof document.msExitFullscreen&&document.msFullscreenEnabled){e.prefix="ms",e.supportsFullScreen=!0;break}}return e.supportsFullScreen&&(e.fullScreenEventName="ms"==e.prefix?"MSFullscreenChange":e.prefix+"fullscreenchange",e.isFullScreen=function(e){switch("undefined"==typeof e&&(e=document.body),this.prefix){case"":return document.fullscreenElement==e;case"moz":return document.mozFullScreenElement==e;default:return document[this.prefix+"FullscreenElement"]==e}},e.requestFullScreen=function(e){return"undefined"==typeof e&&(e=document.body),""===this.prefix?e.requestFullScreen():e[this.prefix+("ms"==this.prefix?"RequestFullscreen":"RequestFullScreen")]()},e.cancelFullScreen=function(){return""===this.prefix?document.cancelFullScreen():document[this.prefix+("ms"==this.prefix?"ExitFullscreen":"CancelFullScreen")]()},e.element=function(){return""===this.prefix?document.fullscreenElement:document[this.prefix+"FullscreenElement"]}),e}function x(){var e={supported:function(){try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}}()};return e}function T(o){function w(e){if(!fe.usingTextTracks&&"video"===fe.type&&fe.supported.full){for(fe.subcount=0,e="number"==typeof e?e:fe.media.currentTime;A(fe.captions[fe.subcount][0])<e.toFixed(1);)if(fe.subcount++,fe.subcount>fe.captions.length-1){fe.subcount=fe.captions.length-1;break}if(fe.media.currentTime.toFixed(1)>=E(fe.captions[fe.subcount][0])&&fe.media.currentTime.toFixed(1)<=A(fe.captions[fe.subcount][0])){fe.currentCaption=fe.captions[fe.subcount][1];var t=fe.currentCaption.trim();fe.captionsContainer.innerHTML!=t&&(fe.captionsContainer.innerHTML="",fe.captionsContainer.innerHTML=t)}else fe.captionsContainer.innerHTML=""}}function T(){fe.buttons.captions&&(f(fe.container,C.classes.captions.enabled,!0),C.captions.defaultActive&&(f(fe.container,C.classes.captions.active,!0),g(fe.buttons.captions,!0)))}function E(e){var t=[];return t=e.split(" --> "),P(t[0])}function A(e){var t=[];return t=e.split(" --> "),P(t[1])}function P(e){if(null===e||void 0===e)return 0;var t,n=[],r=[];return n=e.split(","),r=n[0].split(":"),t=Math.floor(60*r[0]*60)+Math.floor(60*r[1])+Math.floor(r[2])}function N(e){return fe.container.querySelectorAll(e)}function M(e){return N(e)[0]}function I(){try{return window.self!==window.top}catch(e){return!0}}function L(){var e=C.html;if(n("Injecting custom controls."),e||(e=t()),e=i(e,"{seektime}",C.seekTime),e=i(e,"{id}",Math.floor(1e4*Math.random())),fe.container.insertAdjacentHTML("beforeend",e),C.tooltips)for(var r=N(C.selectors.labels),a=r.length-1;a>=0;a--){var s=r[a];f(s,C.classes.hidden,!1),f(s,C.classes.tooltip,!0)}}function O(){try{return fe.controls=M(C.selectors.controls),fe.buttons={},fe.buttons.seek=M(C.selectors.buttons.seek),fe.buttons.play=M(C.selectors.buttons.play),fe.buttons.pause=M(C.selectors.buttons.pause),fe.buttons.restart=M(C.selectors.buttons.restart),fe.buttons.rewind=M(C.selectors.buttons.rewind),fe.buttons.forward=M(C.selectors.buttons.forward),fe.buttons.fullscreen=M(C.selectors.buttons.fullscreen),fe.buttons.mute=M(C.selectors.buttons.mute),fe.buttons.captions=M(C.selectors.buttons.captions),fe.checkboxes=N('[type="checkbox"]'),fe.progress={},fe.progress.container=M(C.selectors.progress.container),fe.progress.buffer={},fe.progress.buffer.bar=M(C.selectors.progress.buffer),fe.progress.buffer.text=fe.progress.buffer.bar&&fe.progress.buffer.bar.getElementsByTagName("span")[0],fe.progress.played={},fe.progress.played.bar=M(C.selectors.progress.played),fe.progress.played.text=fe.progress.played.bar&&fe.progress.played.bar.getElementsByTagName("span")[0],fe.volume=M(C.selectors.buttons.volume),fe.duration=M(C.selectors.duration),fe.currentTime=M(C.selectors.currentTime),fe.seekTime=N(C.selectors.seekTime),!0}catch(e){return n("It looks like there's a problem with your controls html. Bailing.",!0),fe.media.setAttribute("controls",""),!1}}function q(){if(fe.buttons.play){var e=fe.buttons.play.innerText||C.i18n.play;"undefined"!=typeof C.title&&C.title.length&&(e+=", "+C.title),fe.buttons.play.setAttribute("aria-label",e)}}function V(){if(!fe.media)return n("No audio or video element found!",!0),!1;if(fe.supported.full&&(fe.media.removeAttribute("controls"),f(fe.container,C.classes.type.replace("{0}",fe.type),!0),f(fe.container,C.classes.stopped,null===fe.media.getAttribute("autoplay")),fe.browser.ios&&f(fe.container,"ios",!0),"video"===fe.type)){var e=document.createElement("div");e.setAttribute("class",C.classes.videoWrapper),u(fe.media,e),fe.videoContainer=e}"youtube"==fe.type&&H(fe.media.getAttribute("data-video-id")),null!==fe.media.getAttribute("autoplay")&&D()}function H(e){for(var t=N('[id^="youtube"]'),n=t.length-1;n>=0;n--)c(t[n]);var r=document.createElement("div");r.setAttribute("id","youtube-"+Math.floor(1e4*Math.random())),fe.media.appendChild(r),f(fe.media,C.classes.videoWrapper,!0),f(fe.media,C.classes.embedWrapper,!0),"object"==typeof YT?R(e,r):(s("https://www.youtube.com/iframe_api"),S.youtube.push(function(){R(e,r)}),window.onYouTubeIframeAPIReady=function(){for(var e=S.youtube.length-1;e>=0;e--)S.youtube[e](),S.youtube.splice(e,1)})}function R(e,t){n("YouTube API Ready"),"timer"in fe||(fe.timer={}),fe.embed=new YT.Player(t.id,{videoId:e,playerVars:{autoplay:0,controls:fe.supported.full?0:1,rel:0,showinfo:0,iv_load_policy:3,cc_load_policy:C.captions.defaultActive?1:0,cc_lang_pref:"en",wmode:"transparent",modestbranding:1,disablekb:1},events:{onReady:function(e){var t=e.target;fe.media.play=function(){t.playVideo()},fe.media.pause=function(){t.pauseVideo()},fe.media.stop=function(){t.stopVideo()},fe.media.duration=t.getDuration(),fe.media.paused=!0,fe.media.currentTime=t.getCurrentTime(),fe.media.muted=t.isMuted(),v(fe.media,"timeupdate"),window.clearInterval(fe.timer.buffering),fe.timer.buffering=window.setInterval(function(){fe.media.buffered=t.getVideoLoadedFraction(),v(fe.media,"progress"),1===fe.media.buffered&&window.clearInterval(fe.timer.buffering)},200),fe.supported.full&&(fe.container.querySelectorAll(C.selectors.controls).length||de(),C.displayDuration&&re())},onStateChange:function(e){var t=e.target;switch(window.clearInterval(fe.timer.playing),e.data){case 0:fe.media.paused=!0,v(fe.media,"ended");break;case 1:fe.media.paused=!1,v(fe.media,"play"),fe.timer.playing=window.setInterval(function(){fe.media.currentTime=t.getCurrentTime(),v(fe.media,"timeupdate")},200);break;case 2:fe.media.paused=!0,v(fe.media,"pause")}}}})}function B(){if("video"===fe.type){fe.videoContainer.insertAdjacentHTML("afterbegin",'<div class="'+C.selectors.captions.replace(".","")+'"><span></span></div>'),fe.captionsContainer=M(C.selectors.captions).querySelector("span"),fe.usingTextTracks=!1,fe.media.textTracks&&(fe.usingTextTracks=!0);for(var e,t="",r=fe.media.childNodes,a=0;a<r.length;a++)"track"===r[a].nodeName.toLowerCase()&&(e=r[a].kind,("captions"===e||"subtitles"===e)&&(t=r[a].getAttribute("src")));if(fe.captionExists=!0,""===t?(fe.captionExists=!1,n("No caption track found.")):n("Caption track found; URI: "+t),fe.captionExists){for(var s=fe.media.textTracks,o=0;o<s.length;o++)s[o].mode="hidden";if(T(fe),("IE"===fe.browser.name&&fe.browser.version>=10||"Firefox"===fe.browser.name&&fe.browser.version>=31||"Chrome"===fe.browser.name&&fe.browser.version>=43||"Safari"===fe.browser.name&&fe.browser.version>=7)&&(n("Detected unsupported browser for HTML5 captions. Using fallback."),fe.usingTextTracks=!1),fe.usingTextTracks){n("TextTracks supported.");for(var i=0;i<s.length;i++){var u=s[i];("captions"===u.kind||"subtitles"===u.kind)&&y(u,"cuechange",function(){fe.captionsContainer.innerHTML="",this.activeCues[0]&&this.activeCues[0].hasOwnProperty("text")&&fe.captionsContainer.appendChild(this.activeCues[0].getCueAsHTML().trim())})}}else if(n("TextTracks not supported so rendering captions manually."),fe.currentCaption="",fe.captions=[],""!==t){var l=new XMLHttpRequest;l.onreadystatechange=function(){if(4===l.readyState)if(200===l.status){var e,t=[],r=l.responseText;t=r.split("\n\n");for(var a=0;a<t.length;a++)e=t[a],fe.captions[a]=[],fe.captions[a]=e.split("\n");fe.captions.shift(),n("Successfully loaded the caption file via AJAX.")}else n("There was a problem loading the caption file via AJAX.",!0)},l.open("get",t,!0),l.send()}if("Safari"===fe.browser.name&&fe.browser.version>=7){n("Safari 7+ detected; removing track from DOM."),s=fe.media.getElementsByTagName("track");for(var c=0;c<s.length;c++)fe.media.removeChild(s[c])}}else f(fe.container,C.classes.captions.enabled)}}function j(){if("audio"!=fe.type&&C.fullscreen.enabled){var e=F.supportsFullScreen;e||C.fullscreen.fallback&&!I()?(n((e?"Native":"Fallback")+" fullscreen enabled."),f(fe.container,C.classes.fullscreen.enabled,!0)):n("Fullscreen not supported and fallback disabled."),g(fe.buttons.fullscreen,!1),C.fullscreen.hideControls&&f(fe.container,C.classes.fullscreen.hideControls,!0)}}function D(){fe.media.play()}function _(){fe.media.pause()}function W(e){e===!0?D():e===!1?_():fe.media[fe.media.paused?"play":"pause"]()}function Y(e){"number"!=typeof e&&(e=C.seekTime),U(fe.media.currentTime-e)}function z(e){"number"!=typeof e&&(e=C.seekTime),U(fe.media.currentTime+e)}function U(e){var t=0,r=fe.media.paused;"number"==typeof e?t=e:"object"!=typeof e||"input"!==e.type&&"change"!==e.type||(t=e.target.value/e.target.max*fe.media.duration),0>t?t=0:t>fe.media.duration&&(t=fe.media.duration);try{fe.media.currentTime=t.toFixed(1)}catch(a){}"youtube"==fe.type&&(fe.embed.seekTo(t),r&&_(),v(fe.media,"timeupdate")),n("Seeking to "+fe.media.currentTime+" seconds"),w(t)}function X(){f(fe.container,C.classes.playing,!fe.media.paused),f(fe.container,C.classes.stopped,fe.media.paused)}function J(e){function t(){f(fe.container,C.classes.hover,!0),window.clearTimeout(a),s||(a=window.setTimeout(function(){f(fe.container,C.classes.hover,!1)},2e3))}function n(e){s="mouseenter"===e.type}var r=F.supportsFullScreen;e&&e.type===F.fullScreenEventName?fe.isFullscreen=F.isFullScreen(fe.container):r?(F.isFullScreen(fe.container)?F.cancelFullScreen():F.requestFullScreen(fe.container),fe.isFullscreen=F.isFullScreen(fe.container)):(fe.isFullscreen=!fe.isFullscreen,fe.isFullscreen?(y(document,"keyup",$),document.body.style.overflow="hidden"):(b(document,"keyup",$),document.body.style.overflow="")),f(fe.container,C.classes.fullscreen.active,fe.isFullscreen),g(fe.buttons.fullscreen,fe.isFullscreen);var a,s=!1;C.fullscreen.hideControls&&(f(fe.controls,C.classes.hover,!1),m(fe.controls,"mouseenter mouseleave",n,fe.isFullscreen),m(fe.container,"mousemove",t,fe.isFullscreen))}function $(e){27===(e.which||e.charCode||e.keyCode)&&fe.isFullscreen&&J()}function G(e){"undefined"==typeof e&&(e=C.storage.enabled&&x().supported?window.localStorage[C.storage.key]||C.volume:C.volume),e>10&&(e=10),0>e&&(e=0),fe.media.volume=parseFloat(e/10),"youtube"==fe.type&&(fe.embed.setVolume(100*fe.media.volume),v(fe.media,"volumechange")),fe.media.muted&&e>0&&K()}function K(e){"boolean"!=typeof e&&(e=!fe.media.muted),g(fe.buttons.mute,e),fe.media.muted=e,"youtube"===fe.type&&(fe.embed[fe.media.muted?"mute":"unMute"](),v(fe.media,"volumechange"))}function Q(){var e=fe.media.muted?0:10*fe.media.volume;fe.supported.full&&fe.volume&&(fe.volume.value=e),C.storage.enabled&&x().supported&&window.localStorage.setItem(C.storage.key,e),f(fe.container,C.classes.muted,0===e),fe.supported.full&&fe.buttons.mute&&g(fe.buttons.mute,0===e)}function Z(e){fe.supported.full&&fe.buttons.captions&&("boolean"!=typeof e&&(e=-1===fe.container.className.indexOf(C.classes.captions.active)),g(fe.buttons.captions,e),f(fe.container,C.classes.captions.active,e))}function ee(e){var t="waiting"===e.type;clearTimeout(fe.loadingTimer),fe.loadingTimer=setTimeout(function(){f(fe.container,C.classes.loading,t)},t?250:0)}function te(e){var t=fe.progress.played.bar,n=fe.progress.played.text,r=0;if(e)switch(e.type){case"timeupdate":case"seeking":r=h(fe.media.currentTime,fe.media.duration),"timeupdate"==e.type&&fe.buttons.seek&&(fe.buttons.seek.value=r);break;case"change":case"input":r=e.target.value;break;case"playing":case"progress":t=fe.progress.buffer.bar,n=fe.progress.buffer.text,r=function(){var e=fe.media.buffered;return e&&e.length?h(e.end(0),fe.media.duration):"number"==typeof e?100*e:0}()}t&&(t.value=r),n&&(n.innerHTML=r)}function ne(e,t){if(t){fe.secs=parseInt(e%60),fe.mins=parseInt(e/60%60),fe.hours=parseInt(e/60/60%60);var n=parseInt(fe.media.duration/60/60%60)>0;fe.secs=("0"+fe.secs).slice(-2),fe.mins=("0"+fe.mins).slice(-2),t.innerHTML=(n?fe.hours+":":"")+fe.mins+":"+fe.secs}}function re(){var e=fe.media.duration||0;!fe.duration&&C.displayDuration&&fe.media.paused&&ne(e,fe.currentTime),fe.duration&&ne(e,fe.duration)}function ae(e){ne(fe.media.currentTime,fe.currentTime),te(e)}function se(){for(var e=fe.media.querySelectorAll("source"),t=e.length-1;t>=0;t--)c(e[t]);fe.media.removeAttribute("src")}function oe(e){if(e.src){var t=document.createElement("source");d(t,e),p(fe.media,t)}}function ie(e){if("youtube"===fe.type&&"string"==typeof e)return fe.embed.destroy(),H(e),void ae();if(_(),U(),se(),"string"==typeof e)oe({src:e});else if(e.constructor===Array)for(var t in e)oe(e[t]);fe.supported.full&&(ae(),X()),fe.media.load(),null!==fe.media.getAttribute("autoplay")&&D()}function ue(e){"video"===fe.type&&fe.media.setAttribute("poster",e)}function le(){function e(){var e=document.activeElement;e&&e!=document.body?document.querySelector&&(e=document.querySelector(":focus")):e=null;for(var t in fe.buttons){var n=fe.buttons[t];f(n,"tab-focus",n===e)}}var t="IE"==fe.browser.name?"change":"input";y(window,"keyup",function(t){var n=t.keyCode?t.keyCode:t.which;9==n&&e()});for(var n in fe.buttons){var r=fe.buttons[n];y(r,"blur",function(){f(r,"tab-focus",!1)})}y(fe.buttons.play,"click",function(){D(),setTimeout(function(){fe.buttons.pause.focus()},100)}),y(fe.buttons.pause,"click",function(){_(),setTimeout(function(){fe.buttons.play.focus()},100)}),y(fe.buttons.restart,"click",U),y(fe.buttons.rewind,"click",Y),y(fe.buttons.forward,"click",z),y(fe.buttons.seek,t,U),y(fe.volume,t,function(){G(this.value)}),y(fe.buttons.mute,"click",K),y(fe.buttons.fullscreen,"click",J),F.supportsFullScreen&&y(document,F.fullScreenEventName,J),y(fe.media,"timeupdate seeking",ae),y(fe.media,"timeupdate",w),y(fe.media,"loadedmetadata",re),y(fe.buttons.captions,"click",Z),y(fe.media,"ended",function(){"video"===fe.type&&(fe.captionsContainer.innerHTML=""),X()}),y(fe.media,"progress playing",te),y(fe.media,"volumechange",Q),y(fe.media,"play pause",X),y(fe.media,"waiting canplay seeked",ee),"video"===fe.type&&C.click&&y(fe.videoContainer,"click",function(){fe.media.paused?v(fe.buttons.play,"click"):fe.media.ended?(U(),v(fe.buttons.play,"click")):v(fe.buttons.pause,"click")})}function ce(){if(!fe.init)return null;if(fe.container.setAttribute("class",C.selectors.container.replace(".","")),fe.init=!1,c(M(C.selectors.controls)),"youtube"===fe.type)return void fe.embed.destroy();"video"===fe.type&&(c(M(C.selectors.captions)),l(fe.videoContainer)),fe.media.setAttribute("controls","");var e=fe.media.cloneNode(!0);fe.media.parentNode.replaceChild(e,fe.media)}function pe(){if(fe.init)return null;F=k(),fe.browser=r(),fe.media=fe.container.querySelectorAll("audio, video, div")[0];var t=fe.media.tagName.toLowerCase();if("div"===t?fe.type=fe.media.getAttribute("data-type"):fe.type=t,fe.supported=e.supported(fe.type),!fe.supported.basic)return!1;if(n(fe.browser.name+" "+fe.browser.version),V(),"video"==fe.type||"audio"==fe.type){if(!fe.supported.full)return void(fe.init=!0);de(),C.displayDuration&&re(),q()}fe.init=!0}function de(){return L(),O()?(B(),G(),Q(),j(),void le()):!1}var fe=this;return fe.container=o,pe(),fe.init?{media:fe.media,play:D,pause:_,restart:U,rewind:Y,forward:z,seek:U,source:ie,poster:ue,setVolume:G,togglePlay:W,toggleMute:K,toggleCaptions:Z,toggleFullscreen:J,isFullscreen:function(){return fe.isFullscreen||!1},support:function(e){return a(fe,e)},destroy:ce,restore:pe}:{}}var F,C,S={youtube:[]},E={enabled:!0,debug:!1,seekTime:10,volume:5,click:!0,tooltips:!1,displayDuration:!0,iconPrefix:"icon",selectors:{container:".player",controls:".player-controls",labels:"[data-player] .sr-only, label .sr-only",buttons:{seek:'[data-player="seek"]',play:'[data-player="play"]',pause:'[data-player="pause"]',restart:'[data-player="restart"]',rewind:'[data-player="rewind"]',forward:'[data-player="fast-forward"]',mute:'[data-player="mute"]',volume:'[data-player="volume"]',captions:'[data-player="captions"]',fullscreen:'[data-player="fullscreen"]'},progress:{container:".player-progress",buffer:".player-progress-buffer",played:".player-progress-played"},captions:".player-captions",currentTime:".player-current-time",duration:".player-duration"},classes:{videoWrapper:"player-video-wrapper",embedWrapper:"player-video-embed",type:"player-{0}",stopped:"stopped",playing:"playing",muted:"muted",loading:"loading",tooltip:"player-tooltip",hidden:"sr-only",hover:"player-hover",captions:{enabled:"captions-enabled",active:"captions-active"},fullscreen:{enabled:"fullscreen-enabled",active:"fullscreen-active",hideControls:"fullscreen-hide-controls"}},captions:{defaultActive:!1},fullscreen:{enabled:!0,fallback:!0,hideControls:!0},storage:{enabled:!0,key:"plyr_volume"},controls:["restart","rewind","play","fast-forward","current-time","duration","mute","volume","captions","fullscreen"],i18n:{restart:"Restart",rewind:"Rewind {seektime} secs",play:"Play",pause:"Pause",forward:"Forward {seektime} secs",played:"played",buffered:"buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",toggleMute:"Toggle Mute",toggleCaptions:"Toggle Captions",toggleFullscreen:"Toggle Fullscreen"}};e.supported=function(e){var t,n,a=r(),s="IE"===a.name&&a.version<=9,o=/iPhone|iPod/i.test(navigator.userAgent),i=!!document.createElement("audio").canPlayType,u=!!document.createElement("video").canPlayType;switch(e){case"video":t=u,n=t&&!s&&!o;break;case"audio":t=i,n=t&&!s;break;case"youtube":t=!0,n=!s&&!o;break;default:t=i&&u,n=t&&!s}return{basic:t,full:n}},e.setup=function(t){if(C=w(E,t),!C.enabled||!e.supported().basic)return!1;for(var n=document.querySelectorAll(C.selectors.container),r=[],a=n.length-1;a>=0;a--){var s=n[a];if("undefined"==typeof s.plyr){var o=new T(s);s.plyr=Object.keys(o).length?o:!1,"function"==typeof C.onSetup&&C.onSetup.apply(s.plyr)}r.push(s.plyr)}return r}}(this.plyr=this.plyr||{});
\ No newline at end of file +!function(e){"use strict";function t(){var e=['<div class="player-controls">','<div class="player-progress">','<label for="seek{id}" class="sr-only">Seek</label>','<input id="seek{id}" class="player-progress-seek" type="range" min="0" max="100" step="0.5" value="0" data-player="seek">','<progress class="player-progress-played" max="100" value="0">',"<span>0</span>% "+C.i18n.played,"</progress>",'<progress class="player-progress-buffer" max="100" value="0">',"<span>0</span>% "+C.i18n.buffered,"</progress>","</div>",'<span class="player-controls-left">'];return o(C.controls,"restart")&&e.push('<button type="button" data-player="restart">','<svg><use xlink:href="#'+C.iconPrefix+'-restart" /></svg>','<span class="sr-only">'+C.i18n.restart+"</span>","</button>"),o(C.controls,"rewind")&&e.push('<button type="button" data-player="rewind">','<svg><use xlink:href="#'+C.iconPrefix+'-rewind" /></svg>','<span class="sr-only">'+C.i18n.rewind+"</span>","</button>"),o(C.controls,"play")&&e.push('<button type="button" data-player="play">','<svg><use xlink:href="#'+C.iconPrefix+'-play" /></svg>','<span class="sr-only">'+C.i18n.play+"</span>","</button>",'<button type="button" data-player="pause">','<svg><use xlink:href="#'+C.iconPrefix+'-pause" /></svg>','<span class="sr-only">'+C.i18n.pause+"</span>","</button>"),o(C.controls,"fast-forward")&&e.push('<button type="button" data-player="fast-forward">','<svg><use xlink:href="#'+C.iconPrefix+'-fast-forward" /></svg>','<span class="sr-only">'+C.i18n.forward+"</span>","</button>"),o(C.controls,"current-time")&&e.push('<span class="player-time">','<span class="sr-only">'+C.i18n.currentTime+"</span>",'<span class="player-current-time">00:00</span>',"</span>"),o(C.controls,"duration")&&e.push('<span class="player-time">','<span class="sr-only">'+C.i18n.duration+"</span>",'<span class="player-duration">00:00</span>',"</span>"),e.push("</span>",'<span class="player-controls-right">'),o(C.controls,"mute")&&e.push('<button type="button" data-player="mute">','<svg class="icon-muted"><use xlink:href="#'+C.iconPrefix+'-muted" /></svg>','<svg><use xlink:href="#'+C.iconPrefix+'-volume" /></svg>','<span class="sr-only">'+C.i18n.toggleMute+"</span>","</button>"),o(C.controls,"volume")&&e.push('<label for="volume{id}" class="sr-only">'+C.i18n.volume+"</label>",'<input id="volume{id}" class="player-volume" type="range" min="0" max="10" value="5" data-player="volume">'),o(C.controls,"captions")&&e.push('<button type="button" data-player="captions">','<svg class="icon-captions-on"><use xlink:href="#'+C.iconPrefix+'-captions-on" /></svg>','<svg><use xlink:href="#'+C.iconPrefix+'-captions-off" /></svg>','<span class="sr-only">'+C.i18n.toggleCaptions+"</span>","</button>"),o(C.controls,"fullscreen")&&e.push('<button type="button" data-player="fullscreen">','<svg class="icon-exit-fullscreen"><use xlink:href="#'+C.iconPrefix+'-exit-fullscreen" /></svg>','<svg><use xlink:href="#'+C.iconPrefix+'-enter-fullscreen" /></svg>','<span class="sr-only">'+C.i18n.toggleFullscreen+"</span>","</button>"),e.push("</span>","</div>"),e.join("")}function n(e,t){C.debug&&window.console&&console[t?"error":"log"](e)}function r(){var e,t,n,r=navigator.userAgent,a=navigator.appName,s=""+parseFloat(navigator.appVersion),o=parseInt(navigator.appVersion,10);return-1!==navigator.appVersion.indexOf("Windows NT")&&-1!==navigator.appVersion.indexOf("rv:11")?(a="IE",s="11;"):-1!==(t=r.indexOf("MSIE"))?(a="IE",s=r.substring(t+5)):-1!==(t=r.indexOf("Chrome"))?(a="Chrome",s=r.substring(t+7)):-1!==(t=r.indexOf("Safari"))?(a="Safari",s=r.substring(t+7),-1!==(t=r.indexOf("Version"))&&(s=r.substring(t+8))):-1!==(t=r.indexOf("Firefox"))?(a="Firefox",s=r.substring(t+8)):(e=r.lastIndexOf(" ")+1)<(t=r.lastIndexOf("/"))&&(a=r.substring(e,t),s=r.substring(t+1),a.toLowerCase()==a.toUpperCase()&&(a=navigator.appName)),-1!==(n=s.indexOf(";"))&&(s=s.substring(0,n)),-1!==(n=s.indexOf(" "))&&(s=s.substring(0,n)),o=parseInt(""+s,10),isNaN(o)&&(s=""+parseFloat(navigator.appVersion),o=parseInt(navigator.appVersion,10)),{name:a,version:o,ios:/(iPad|iPhone|iPod)/g.test(navigator.platform)}}function a(e,t){var n=e.media;if("video"==e.type)switch(t){case"video/webm":return!(!n.canPlayType||!n.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/no/,""));case"video/mp4":return!(!n.canPlayType||!n.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/,""));case"video/ogg":return!(!n.canPlayType||!n.canPlayType('video/ogg; codecs="theora"').replace(/no/,""))}else if("audio"==e.type)switch(t){case"audio/mpeg":return!(!n.canPlayType||!n.canPlayType("audio/mpeg;").replace(/no/,""));case"audio/ogg":return!(!n.canPlayType||!n.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/,""));case"audio/wav":return!(!n.canPlayType||!n.canPlayType('audio/wav; codecs="1"').replace(/no/,""))}return!1}function s(e){if(!document.querySelectorAll('script[src="'+e+'"]').length){var t=document.createElement("script");t.src=e;var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n)}}function o(e,t){return Array.prototype.indexOf&&-1!=e.indexOf(t)}function i(e,t,n){return e.replace(new RegExp(t.replace(/([.*+?\^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),n)}function u(e,t){e.length||(e=[e]);for(var n=e.length-1;n>=0;n--){var r=n>0?t.cloneNode(!0):t,a=e[n],s=a.parentNode,o=a.nextSibling;r.appendChild(a),o?s.insertBefore(r,o):s.appendChild(r)}}function l(e){for(var t=e.parentNode;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}function c(e){e.parentNode.removeChild(e)}function p(e,t){e.insertBefore(t,e.firstChild)}function d(e,t){for(var n in t)e.setAttribute(n,t[n])}function f(e,t,n){if(e)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=r+(n?" "+t:"")}}function m(e,t,n,r){var a=t.split(" ");if(e instanceof NodeList)for(var s=0;s<e.length;s++)e[s]instanceof Node&&m(e[s],arguments[1],arguments[2],arguments[3]);else for(var o=0;o<a.length;o++)e[r?"addEventListener":"removeEventListener"](a[o],n,!1)}function y(e,t,n){e&&m(e,t,n,!0)}function b(e,t,n){e&&m(e,t,n,!1)}function v(e,t){var n=document.createEvent("MouseEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function g(e,t){return t="boolean"==typeof t?t:!e.getAttribute("aria-pressed"),e.setAttribute("aria-pressed",t),t}function h(e,t){return 0===e||0===t||isNaN(e)||isNaN(t)?0:(e/t*100).toFixed(2)}function w(e,t){for(var n in t)t[n]&&t[n].constructor&&t[n].constructor===Object?(e[n]=e[n]||{},w(e[n],t[n])):e[n]=t[n];return e}function k(){var e={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",element:null,prefix:""},t="webkit moz o ms khtml".split(" ");if("undefined"!=typeof document.cancelFullScreen)e.supportsFullScreen=!0;else for(var n=0,r=t.length;r>n;n++){if(e.prefix=t[n],"undefined"!=typeof document[e.prefix+"CancelFullScreen"]){e.supportsFullScreen=!0;break}if("undefined"!=typeof document.msExitFullscreen&&document.msFullscreenEnabled){e.prefix="ms",e.supportsFullScreen=!0;break}}return e.supportsFullScreen&&(e.fullScreenEventName="ms"==e.prefix?"MSFullscreenChange":e.prefix+"fullscreenchange",e.isFullScreen=function(e){switch("undefined"==typeof e&&(e=document.body),this.prefix){case"":return document.fullscreenElement==e;case"moz":return document.mozFullScreenElement==e;default:return document[this.prefix+"FullscreenElement"]==e}},e.requestFullScreen=function(e){return"undefined"==typeof e&&(e=document.body),""===this.prefix?e.requestFullScreen():e[this.prefix+("ms"==this.prefix?"RequestFullscreen":"RequestFullScreen")]()},e.cancelFullScreen=function(){return""===this.prefix?document.cancelFullScreen():document[this.prefix+("ms"==this.prefix?"ExitFullscreen":"CancelFullScreen")]()},e.element=function(){return""===this.prefix?document.fullscreenElement:document[this.prefix+"FullscreenElement"]}),e}function x(){var e={supported:function(){try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}}()};return e}function T(o){function w(e){if(!fe.usingTextTracks&&"video"===fe.type&&fe.supported.full){for(fe.subcount=0,e="number"==typeof e?e:fe.media.currentTime;A(fe.captions[fe.subcount][0])<e.toFixed(1);)if(fe.subcount++,fe.subcount>fe.captions.length-1){fe.subcount=fe.captions.length-1;break}if(fe.media.currentTime.toFixed(1)>=E(fe.captions[fe.subcount][0])&&fe.media.currentTime.toFixed(1)<=A(fe.captions[fe.subcount][0])){fe.currentCaption=fe.captions[fe.subcount][1];var t=fe.currentCaption.trim();fe.captionsContainer.innerHTML!=t&&(fe.captionsContainer.innerHTML="",fe.captionsContainer.innerHTML=t)}else fe.captionsContainer.innerHTML=""}}function T(){fe.buttons.captions&&(f(fe.container,C.classes.captions.enabled,!0),C.captions.defaultActive&&(f(fe.container,C.classes.captions.active,!0),g(fe.buttons.captions,!0)))}function E(e){var t=[];return t=e.split(" --> "),P(t[0])}function A(e){var t=[];return t=e.split(" --> "),P(t[1])}function P(e){if(null===e||void 0===e)return 0;var t,n=[],r=[];return n=e.split(","),r=n[0].split(":"),t=Math.floor(60*r[0]*60)+Math.floor(60*r[1])+Math.floor(r[2])}function N(e){return fe.container.querySelectorAll(e)}function M(e){return N(e)[0]}function I(){try{return window.self!==window.top}catch(e){return!0}}function L(){var e=C.html;if(n("Injecting custom controls."),e||(e=t()),e=i(e,"{seektime}",C.seekTime),e=i(e,"{id}",Math.floor(1e4*Math.random())),fe.container.insertAdjacentHTML("beforeend",e),C.tooltips)for(var r=N(C.selectors.labels),a=r.length-1;a>=0;a--){var s=r[a];f(s,C.classes.hidden,!1),f(s,C.classes.tooltip,!0)}}function O(){try{return fe.controls=M(C.selectors.controls),fe.buttons={},fe.buttons.seek=M(C.selectors.buttons.seek),fe.buttons.play=M(C.selectors.buttons.play),fe.buttons.pause=M(C.selectors.buttons.pause),fe.buttons.restart=M(C.selectors.buttons.restart),fe.buttons.rewind=M(C.selectors.buttons.rewind),fe.buttons.forward=M(C.selectors.buttons.forward),fe.buttons.fullscreen=M(C.selectors.buttons.fullscreen),fe.buttons.mute=M(C.selectors.buttons.mute),fe.buttons.captions=M(C.selectors.buttons.captions),fe.checkboxes=N('[type="checkbox"]'),fe.progress={},fe.progress.container=M(C.selectors.progress.container),fe.progress.buffer={},fe.progress.buffer.bar=M(C.selectors.progress.buffer),fe.progress.buffer.text=fe.progress.buffer.bar&&fe.progress.buffer.bar.getElementsByTagName("span")[0],fe.progress.played={},fe.progress.played.bar=M(C.selectors.progress.played),fe.progress.played.text=fe.progress.played.bar&&fe.progress.played.bar.getElementsByTagName("span")[0],fe.volume=M(C.selectors.buttons.volume),fe.duration=M(C.selectors.duration),fe.currentTime=M(C.selectors.currentTime),fe.seekTime=N(C.selectors.seekTime),!0}catch(e){return n("It looks like there's a problem with your controls html. Bailing.",!0),fe.media.setAttribute("controls",""),!1}}function q(){if(fe.buttons.play){var e=fe.buttons.play.innerText||C.i18n.play;"undefined"!=typeof C.title&&C.title.length&&(e+=", "+C.title),fe.buttons.play.setAttribute("aria-label",e)}}function V(){if(!fe.media)return n("No audio or video element found!",!0),!1;if(fe.supported.full&&(fe.media.removeAttribute("controls"),f(fe.container,C.classes.type.replace("{0}",fe.type),!0),f(fe.container,C.classes.stopped,null===fe.media.getAttribute("autoplay")&&!C.autoplay),fe.browser.ios&&f(fe.container,"ios",!0),"video"===fe.type)){var e=document.createElement("div");e.setAttribute("class",C.classes.videoWrapper),u(fe.media,e),fe.videoContainer=e}"youtube"==fe.type&&H(fe.media.getAttribute("data-video-id")),(null!==fe.media.getAttribute("autoplay")||C.autoplay)&&D()}function H(e){for(var t=N('[id^="youtube"]'),n=t.length-1;n>=0;n--)c(t[n]);var r=document.createElement("div");r.setAttribute("id","youtube-"+Math.floor(1e4*Math.random())),fe.media.appendChild(r),f(fe.media,C.classes.videoWrapper,!0),f(fe.media,C.classes.embedWrapper,!0),"object"==typeof YT?R(e,r):(s("https://www.youtube.com/iframe_api"),S.youtube.push(function(){R(e,r)}),window.onYouTubeIframeAPIReady=function(){for(var e=S.youtube.length-1;e>=0;e--)S.youtube[e](),S.youtube.splice(e,1)})}function R(e,t){n("YouTube API Ready"),"timer"in fe||(fe.timer={}),fe.embed=new YT.Player(t.id,{videoId:e,playerVars:{autoplay:C.autoplay?1:0,controls:fe.supported.full?0:1,rel:0,showinfo:0,iv_load_policy:3,cc_load_policy:C.captions.defaultActive?1:0,cc_lang_pref:"en",wmode:"transparent",modestbranding:1,disablekb:1},events:{onReady:function(e){var t=e.target;fe.media.play=function(){t.playVideo()},fe.media.pause=function(){t.pauseVideo()},fe.media.stop=function(){t.stopVideo()},fe.media.duration=t.getDuration(),fe.media.paused=!0,fe.media.currentTime=t.getCurrentTime(),fe.media.muted=t.isMuted(),v(fe.media,"timeupdate"),window.clearInterval(fe.timer.buffering),fe.timer.buffering=window.setInterval(function(){fe.media.buffered=t.getVideoLoadedFraction(),v(fe.media,"progress"),1===fe.media.buffered&&window.clearInterval(fe.timer.buffering)},200),fe.supported.full&&(fe.container.querySelectorAll(C.selectors.controls).length||de(),C.displayDuration&&re())},onStateChange:function(e){var t=e.target;switch(window.clearInterval(fe.timer.playing),e.data){case 0:fe.media.paused=!0,v(fe.media,"ended");break;case 1:fe.media.paused=!1,v(fe.media,"play"),fe.timer.playing=window.setInterval(function(){fe.media.currentTime=t.getCurrentTime(),v(fe.media,"timeupdate")},200);break;case 2:fe.media.paused=!0,v(fe.media,"pause")}}}})}function B(){if("video"===fe.type){fe.videoContainer.insertAdjacentHTML("afterbegin",'<div class="'+C.selectors.captions.replace(".","")+'"><span></span></div>'),fe.captionsContainer=M(C.selectors.captions).querySelector("span"),fe.usingTextTracks=!1,fe.media.textTracks&&(fe.usingTextTracks=!0);for(var e,t="",r=fe.media.childNodes,a=0;a<r.length;a++)"track"===r[a].nodeName.toLowerCase()&&(e=r[a].kind,("captions"===e||"subtitles"===e)&&(t=r[a].getAttribute("src")));if(fe.captionExists=!0,""===t?(fe.captionExists=!1,n("No caption track found.")):n("Caption track found; URI: "+t),fe.captionExists){for(var s=fe.media.textTracks,o=0;o<s.length;o++)s[o].mode="hidden";if(T(fe),("IE"===fe.browser.name&&fe.browser.version>=10||"Firefox"===fe.browser.name&&fe.browser.version>=31||"Chrome"===fe.browser.name&&fe.browser.version>=43||"Safari"===fe.browser.name&&fe.browser.version>=7)&&(n("Detected unsupported browser for HTML5 captions. Using fallback."),fe.usingTextTracks=!1),fe.usingTextTracks){n("TextTracks supported.");for(var i=0;i<s.length;i++){var u=s[i];("captions"===u.kind||"subtitles"===u.kind)&&y(u,"cuechange",function(){fe.captionsContainer.innerHTML="",this.activeCues[0]&&this.activeCues[0].hasOwnProperty("text")&&fe.captionsContainer.appendChild(this.activeCues[0].getCueAsHTML().trim())})}}else if(n("TextTracks not supported so rendering captions manually."),fe.currentCaption="",fe.captions=[],""!==t){var l=new XMLHttpRequest;l.onreadystatechange=function(){if(4===l.readyState)if(200===l.status){var e,t=[],r=l.responseText;t=r.split("\n\n");for(var a=0;a<t.length;a++)e=t[a],fe.captions[a]=[],fe.captions[a]=e.split("\n");fe.captions.shift(),n("Successfully loaded the caption file via AJAX.")}else n("There was a problem loading the caption file via AJAX.",!0)},l.open("get",t,!0),l.send()}if("Safari"===fe.browser.name&&fe.browser.version>=7){n("Safari 7+ detected; removing track from DOM."),s=fe.media.getElementsByTagName("track");for(var c=0;c<s.length;c++)fe.media.removeChild(s[c])}}else f(fe.container,C.classes.captions.enabled)}}function j(){if("audio"!=fe.type&&C.fullscreen.enabled){var e=F.supportsFullScreen;e||C.fullscreen.fallback&&!I()?(n((e?"Native":"Fallback")+" fullscreen enabled."),f(fe.container,C.classes.fullscreen.enabled,!0)):n("Fullscreen not supported and fallback disabled."),g(fe.buttons.fullscreen,!1),C.fullscreen.hideControls&&f(fe.container,C.classes.fullscreen.hideControls,!0)}}function D(){fe.media.play()}function _(){fe.media.pause()}function W(e){e===!0?D():e===!1?_():fe.media[fe.media.paused?"play":"pause"]()}function Y(e){"number"!=typeof e&&(e=C.seekTime),U(fe.media.currentTime-e)}function z(e){"number"!=typeof e&&(e=C.seekTime),U(fe.media.currentTime+e)}function U(e){var t=0,r=fe.media.paused;"number"==typeof e?t=e:"object"!=typeof e||"input"!==e.type&&"change"!==e.type||(t=e.target.value/e.target.max*fe.media.duration),0>t?t=0:t>fe.media.duration&&(t=fe.media.duration);try{fe.media.currentTime=t.toFixed(1)}catch(a){}"youtube"==fe.type&&(fe.embed.seekTo(t),r&&_(),v(fe.media,"timeupdate")),n("Seeking to "+fe.media.currentTime+" seconds"),w(t)}function X(){f(fe.container,C.classes.playing,!fe.media.paused),f(fe.container,C.classes.stopped,fe.media.paused)}function J(e){function t(){f(fe.container,C.classes.hover,!0),window.clearTimeout(a),s||(a=window.setTimeout(function(){f(fe.container,C.classes.hover,!1)},2e3))}function n(e){s="mouseenter"===e.type}var r=F.supportsFullScreen;e&&e.type===F.fullScreenEventName?fe.isFullscreen=F.isFullScreen(fe.container):r?(F.isFullScreen(fe.container)?F.cancelFullScreen():F.requestFullScreen(fe.container),fe.isFullscreen=F.isFullScreen(fe.container)):(fe.isFullscreen=!fe.isFullscreen,fe.isFullscreen?(y(document,"keyup",$),document.body.style.overflow="hidden"):(b(document,"keyup",$),document.body.style.overflow="")),f(fe.container,C.classes.fullscreen.active,fe.isFullscreen),g(fe.buttons.fullscreen,fe.isFullscreen);var a,s=!1;C.fullscreen.hideControls&&(f(fe.controls,C.classes.hover,!1),m(fe.controls,"mouseenter mouseleave",n,fe.isFullscreen),m(fe.container,"mousemove",t,fe.isFullscreen))}function $(e){27===(e.which||e.charCode||e.keyCode)&&fe.isFullscreen&&J()}function G(e){"undefined"==typeof e&&(e=C.storage.enabled&&x().supported?window.localStorage[C.storage.key]||C.volume:C.volume),e>10&&(e=10),0>e&&(e=0),fe.media.volume=parseFloat(e/10),"youtube"==fe.type&&(fe.embed.setVolume(100*fe.media.volume),v(fe.media,"volumechange")),fe.media.muted&&e>0&&K()}function K(e){"boolean"!=typeof e&&(e=!fe.media.muted),g(fe.buttons.mute,e),fe.media.muted=e,"youtube"===fe.type&&(fe.embed[fe.media.muted?"mute":"unMute"](),v(fe.media,"volumechange"))}function Q(){var e=fe.media.muted?0:10*fe.media.volume;fe.supported.full&&fe.volume&&(fe.volume.value=e),C.storage.enabled&&x().supported&&window.localStorage.setItem(C.storage.key,e),f(fe.container,C.classes.muted,0===e),fe.supported.full&&fe.buttons.mute&&g(fe.buttons.mute,0===e)}function Z(e){fe.supported.full&&fe.buttons.captions&&("boolean"!=typeof e&&(e=-1===fe.container.className.indexOf(C.classes.captions.active)),g(fe.buttons.captions,e),f(fe.container,C.classes.captions.active,e))}function ee(e){var t="waiting"===e.type;clearTimeout(fe.loadingTimer),fe.loadingTimer=setTimeout(function(){f(fe.container,C.classes.loading,t)},t?250:0)}function te(e){var t=fe.progress.played.bar,n=fe.progress.played.text,r=0;if(e)switch(e.type){case"timeupdate":case"seeking":r=h(fe.media.currentTime,fe.media.duration),"timeupdate"==e.type&&fe.buttons.seek&&(fe.buttons.seek.value=r);break;case"change":case"input":r=e.target.value;break;case"playing":case"progress":t=fe.progress.buffer.bar,n=fe.progress.buffer.text,r=function(){var e=fe.media.buffered;return e&&e.length?h(e.end(0),fe.media.duration):"number"==typeof e?100*e:0}()}t&&(t.value=r),n&&(n.innerHTML=r)}function ne(e,t){if(t){fe.secs=parseInt(e%60),fe.mins=parseInt(e/60%60),fe.hours=parseInt(e/60/60%60);var n=parseInt(fe.media.duration/60/60%60)>0;fe.secs=("0"+fe.secs).slice(-2),fe.mins=("0"+fe.mins).slice(-2),t.innerHTML=(n?fe.hours+":":"")+fe.mins+":"+fe.secs}}function re(){var e=fe.media.duration||0;!fe.duration&&C.displayDuration&&fe.media.paused&&ne(e,fe.currentTime),fe.duration&&ne(e,fe.duration)}function ae(e){ne(fe.media.currentTime,fe.currentTime),te(e)}function se(){for(var e=fe.media.querySelectorAll("source"),t=e.length-1;t>=0;t--)c(e[t]);fe.media.removeAttribute("src")}function oe(e){if(e.src){var t=document.createElement("source");d(t,e),p(fe.media,t)}}function ie(e){if("youtube"===fe.type&&"string"==typeof e)return fe.embed.destroy(),H(e),void ae();if(_(),U(),se(),"string"==typeof e)oe({src:e});else if(e.constructor===Array)for(var t in e)oe(e[t]);fe.supported.full&&(ae(),X()),fe.media.load(),(null!==fe.media.getAttribute("autoplay")||C.autoplay)&&D()}function ue(e){"video"===fe.type&&fe.media.setAttribute("poster",e)}function le(){function e(){var e=document.activeElement;e=e&&e!=document.body?document.querySelector(":focus"):null;for(var t in fe.buttons){var n=fe.buttons[t];f(n,"tab-focus",n===e)}}var t="IE"==fe.browser.name?"change":"input";y(window,"keyup",function(t){var n=t.keyCode?t.keyCode:t.which;9==n&&e()});for(var n in fe.buttons){var r=fe.buttons[n];y(r,"blur",function(){f(r,"tab-focus",!1)})}y(fe.buttons.play,"click",function(){D(),setTimeout(function(){fe.buttons.pause.focus()},100)}),y(fe.buttons.pause,"click",function(){_(),setTimeout(function(){fe.buttons.play.focus()},100)}),y(fe.buttons.restart,"click",U),y(fe.buttons.rewind,"click",Y),y(fe.buttons.forward,"click",z),y(fe.buttons.seek,t,U),y(fe.volume,t,function(){G(this.value)}),y(fe.buttons.mute,"click",K),y(fe.buttons.fullscreen,"click",J),F.supportsFullScreen&&y(document,F.fullScreenEventName,J),y(fe.media,"timeupdate seeking",ae),y(fe.media,"timeupdate",w),y(fe.media,"loadedmetadata",re),y(fe.buttons.captions,"click",Z),y(fe.media,"ended",function(){"video"===fe.type&&(fe.captionsContainer.innerHTML=""),X()}),y(fe.media,"progress playing",te),y(fe.media,"volumechange",Q),y(fe.media,"play pause",X),y(fe.media,"waiting canplay seeked",ee),"video"===fe.type&&C.click&&y(fe.videoContainer,"click",function(){fe.media.paused?v(fe.buttons.play,"click"):fe.media.ended?(U(),v(fe.buttons.play,"click")):v(fe.buttons.pause,"click")})}function ce(){if(!fe.init)return null;if(fe.container.setAttribute("class",C.selectors.container.replace(".","")),fe.init=!1,c(M(C.selectors.controls)),"youtube"===fe.type)return void fe.embed.destroy();"video"===fe.type&&(c(M(C.selectors.captions)),l(fe.videoContainer)),fe.media.setAttribute("controls","");var e=fe.media.cloneNode(!0);fe.media.parentNode.replaceChild(e,fe.media)}function pe(){if(fe.init)return null;F=k(),fe.browser=r(),fe.media=fe.container.querySelectorAll("audio, video, div")[0];var t=fe.media.tagName.toLowerCase();if("div"===t?fe.type=fe.media.getAttribute("data-type"):fe.type=t,fe.supported=e.supported(fe.type),!fe.supported.basic)return!1;if(n(fe.browser.name+" "+fe.browser.version),V(),"video"==fe.type||"audio"==fe.type){if(!fe.supported.full)return void(fe.init=!0);de(),C.displayDuration&&re(),q()}fe.init=!0}function de(){return L(),O()?(B(),G(),Q(),j(),void le()):!1}var fe=this;return fe.container=o,pe(),fe.init?{media:fe.media,play:D,pause:_,restart:U,rewind:Y,forward:z,seek:U,source:ie,poster:ue,setVolume:G,togglePlay:W,toggleMute:K,toggleCaptions:Z,toggleFullscreen:J,isFullscreen:function(){return fe.isFullscreen||!1},support:function(e){return a(fe,e)},destroy:ce,restore:pe}:{}}var F,C,S={youtube:[]},E={enabled:!0,debug:!1,autoplay:!1,seekTime:10,volume:5,click:!0,tooltips:!1,displayDuration:!0,iconPrefix:"icon",selectors:{container:".player",controls:".player-controls",labels:"[data-player] .sr-only, label .sr-only",buttons:{seek:'[data-player="seek"]',play:'[data-player="play"]',pause:'[data-player="pause"]',restart:'[data-player="restart"]',rewind:'[data-player="rewind"]',forward:'[data-player="fast-forward"]',mute:'[data-player="mute"]',volume:'[data-player="volume"]',captions:'[data-player="captions"]',fullscreen:'[data-player="fullscreen"]'},progress:{container:".player-progress",buffer:".player-progress-buffer",played:".player-progress-played"},captions:".player-captions",currentTime:".player-current-time",duration:".player-duration"},classes:{videoWrapper:"player-video-wrapper",embedWrapper:"player-video-embed",type:"player-{0}",stopped:"stopped",playing:"playing",muted:"muted",loading:"loading",tooltip:"player-tooltip",hidden:"sr-only",hover:"player-hover",captions:{enabled:"captions-enabled",active:"captions-active"},fullscreen:{enabled:"fullscreen-enabled",active:"fullscreen-active",hideControls:"fullscreen-hide-controls"}},captions:{defaultActive:!1},fullscreen:{enabled:!0,fallback:!0,hideControls:!0},storage:{enabled:!0,key:"plyr_volume"},controls:["restart","rewind","play","fast-forward","current-time","duration","mute","volume","captions","fullscreen"],i18n:{restart:"Restart",rewind:"Rewind {seektime} secs",play:"Play",pause:"Pause",forward:"Forward {seektime} secs",played:"played",buffered:"buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",toggleMute:"Toggle Mute",toggleCaptions:"Toggle Captions",toggleFullscreen:"Toggle Fullscreen"}};e.supported=function(e){var t,n,a=r(),s="IE"===a.name&&a.version<=9,o=/iPhone|iPod/i.test(navigator.userAgent),i=!!document.createElement("audio").canPlayType,u=!!document.createElement("video").canPlayType;switch(e){case"video":t=u,n=t&&!s&&!o;break;case"audio":t=i,n=t&&!s;break;case"youtube":t=!0,n=!s&&!o;break;default:t=i&&u,n=t&&!s}return{basic:t,full:n}},e.setup=function(t){if(C=w(E,t),!C.enabled||!e.supported().basic)return!1;for(var n=document.querySelectorAll(C.selectors.container),r=[],a=n.length-1;a>=0;a--){var s=n[a];if("undefined"==typeof s.plyr){var o=new T(s);s.plyr=Object.keys(o).length?o:!1,"function"==typeof C.onSetup&&C.onSetup.apply(s.plyr)}r.push(s.plyr)}return r}}(this.plyr=this.plyr||{});
\ No newline at end of file diff --git a/docs/dist/docs.css b/docs/dist/docs.css index 3411cf5f..dfbc0cb4 100644 --- a/docs/dist/docs.css +++ b/docs/dist/docs.css @@ -1 +1 @@ -/*! normalize.css v2.1.3 | MIT License | git.io/normalize */[hidden],template{display:none}body,h1,h2{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,small,summary{display:block}body,small{padding:0 10px}body,figure,nav ul{margin:0}legend,nav ul{padding:0}.btn-bar,sub,sup{position:relative}.example-video .player iframe,.example-video .player-video iframe,.example-video .player-youtube iframe{-webkit-mask-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC)}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}a{background:0 0;text-decoration:none;color:#3498db;border-bottom:1px solid currentColor;transition:background .3s ease,color .3s ease}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}hr{box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}.btn-bar,nav li{white-space:nowrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}sub,sup{font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}.btn-bar::before,.btn-count::before{content:"";top:50%}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}a.logo,legend{border:0}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}@-webkit-keyframes fade-in{0%{opacity:0}100%{opacity:1}}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}*,::after,::before{box-sizing:border-box}html{height:100%;font-size:100%;background:linear-gradient(#fff,#f2f5f7) fixed}body{font-family:Avenir,"Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1.5;text-align:center;color:#55646b}header{padding:20px;margin-bottom:20px}header p{font-size:18px;font-size:1.125rem}section{padding-bottom:20px}@media (min-width:480px){header{padding-top:60px;padding-bottom:60px}section{padding-bottom:40px}}@font-face{font-family:Avenir;src:url(//cdn.plyr.io/fonts/avenir-medium.woff2) format("woff2"),url(//cdn.plyr.io/fonts/avenir-medium.woff) format("woff");font-style:normal;font-weight:400}@font-face{font-family:Avenir;src:url(//cdn.plyr.io/fonts/avenir-bold.woff2) format("woff2"),url(//cdn.plyr.io/fonts/avenir-bold.woff) format("woff");font-style:normal;font-weight:600}h1,h2{letter-spacing:-.025em;color:#2E3C44;margin:0 0 10px;line-height:1.2}h1{font-size:64px;font-size:4rem;color:#3498DB}p,small{margin:0 0 20px}small{font-size:14px;font-size:.875rem}.btn-bar ul,nav li{display:inline-block}a:focus,a:hover{color:#343f4a}a:focus{outline:#343f4a dotted thin;outline-offset:1px}nav ul{list-style:none;font-size:0}nav li{margin-top:10px;font-size:16px;font-size:1rem}nav li+li{margin-left:20px}.btn-bar{margin:0 auto 20px;max-width:1200px}.btn-bar::before{position:absolute;left:0;right:0;height:1px;background:#dbe3e8}.btn-bar ul{position:relative;z-index:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn-bar li{margin:0}.btn-bar li:first-child .btn{border-radius:4px 0 0 4px}.btn-bar li:last-child .btn{border-radius:0 4px 4px 0}.btn-bar li+li .btn{margin-left:-1px}.btn-bar .btn{display:block;border-radius:0}.btn-bar .btn.active{box-shadow:inset 0 1px 1px rgba(0,0,0,.2);position:relative;z-index:1}@media (min-width:560px){.btn-bar{margin-bottom:40px}}.btn,.btn-count{display:inline-block;vertical-align:middle;border-radius:4px;font-weight:600;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn{padding:10px 20px;background:#f2f5f7;border:1px solid #cbd0d3;box-shadow:inset 0 1px 0 #fff,0 1px 1px rgba(0,0,0,.05);text-shadow:0 1px 1px #fff;color:#55646b}.btn:focus,.btn:hover{background-color:#fff;border-color:#bdc4c7;color:#3498db;outline:0}.btn-bar .active,.btn-primary{background-image:linear-gradient(#3498db,#2791d9);background-color:#3498db;border-color:#217dbb;box-shadow:0 1px 1px rgba(0,0,0,.15);text-shadow:0 1px 1px rgba(0,0,0,.1);color:#fff}.btn-primary:focus,.btn-primary:hover{color:#fff;border-color:#196090}.btn-small{padding-top:7px;padding-bottom:7px}.btn-count{position:relative;margin-left:6px;padding:9px;background:#fff;border:1px solid #cbd0d3}.btn-count::before{position:absolute;display:block;width:8px;height:8px;left:1px;margin-top:-4px;background:inherit;border:inherit;border-width:1px 0 0 1px;-webkit-transform:rotate(-45deg) translate(-50%,-50%);transform:rotate(-45deg) translate(-50%,-50%)}.panel{display:none}.panel.active{display:block;-webkit-animation:fade-in .3s ease;animation:fade-in .3s ease}.error body,html.error{height:100%}.error body{width:100%;display:table;table-layout:fixed}.error main{display:table-cell;width:100%;vertical-align:middle}.example-audio .player,.example-video .player{margin:0 auto 20px}.example-audio .player-controls,.example-video .player-controls{border-radius:0 0 4px 4px}.example-audio .player{max-width:520px}.example-audio .player-controls{border-radius:4px}.example-audio .player-progress{border-radius:4px 4px 0 0;overflow:hidden}.example-video .player{max-width:1200px}.example-video .player iframe,.example-video .player video{border-radius:4px}.example-video .player-video iframe,.example-video .player-video video,.example-video .player-youtube iframe,.example-video .player-youtube video{border-radius:4px 4px 0 0}.example-video .player-video-fullscreen,.example-video .player-video.fullscreen-active,.example-video .player-youtube-fullscreen,.example-video .player-youtube.fullscreen-active{max-width:none}.example-video .player-video-fullscreen .player-controls,.example-video .player-video-fullscreen iframe,.example-video .player-video-fullscreen video,.example-video .player-video.fullscreen-active .player-controls,.example-video .player-video.fullscreen-active iframe,.example-video .player-video.fullscreen-active video,.example-video .player-youtube-fullscreen .player-controls,.example-video .player-youtube-fullscreen iframe,.example-video .player-youtube-fullscreen video,.example-video .player-youtube.fullscreen-active .player-controls,.example-video .player-youtube.fullscreen-active iframe,.example-video .player-youtube.fullscreen-active video{border-radius:0}.example-video .player-video-fullscreen iframe,.example-video .player-video.fullscreen-active iframe,.example-video .player-youtube-fullscreen iframe,.example-video .player-youtube.fullscreen-active iframe{-webkit-mask-image:none}
\ No newline at end of file +/*! normalize.css v2.1.3 | MIT License | git.io/normalize */a.logo,img,legend{border:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,small,summary{display:block}[hidden],template{display:none}body,figure,ul li{margin:0}body,h1,h2{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}body,small{padding:0 10px}nav ul,ul li{list-style:none;padding:0}legend,nav ul,ul li{padding:0}.btn-bar,sub,sup{position:relative}.example-video .player iframe,.example-video .player-video iframe,.example-video .player-youtube iframe{-webkit-mask-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC)}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}a{background:0 0;text-decoration:none;color:#3498db;border-bottom:1px dotted currentColor;transition:background .3s ease,color .3s ease,border .3s ease}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}hr{box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}.btn-bar,nav li{white-space:nowrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}sub,sup{font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}.btn-bar::before,.btn-count::before{content:"";top:50%}sub{bottom:-.25em}svg:not(:root){overflow:hidden}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}@-webkit-keyframes fade-in{0%{opacity:0}100%{opacity:1}}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}@font-face{font-family:Avenir;src:url(//cdn.plyr.io/fonts/avenir-medium.woff2) format("woff2"),url(//cdn.plyr.io/fonts/avenir-medium.woff) format("woff");font-style:normal;font-weight:400}@font-face{font-family:Avenir;src:url(//cdn.plyr.io/fonts/avenir-bold.woff2) format("woff2"),url(//cdn.plyr.io/fonts/avenir-bold.woff) format("woff");font-style:normal;font-weight:600}h1,h2{letter-spacing:-.025em;color:#2E3C44;margin:0 0 10px;line-height:1.2}h1{font-size:64px;font-size:4rem;color:#3498DB}p,small{margin:0 0 20px}small{font-size:14px;font-size:.875rem}a:focus,a:hover{color:#343f4a;border-bottom-color:transparent}a:focus{outline:#343f4a dotted thin;outline-offset:1px}.color-vimeo{color:#19b7ed}.color-youtube{color:#cc181e}*,::after,::before{box-sizing:border-box}.btn-bar ul,nav li{display:inline-block}html{height:100%;font-size:100%;background:linear-gradient(#fff,#f2f5f7) fixed}body{font-family:Avenir,"Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1.5;text-align:center;color:#55646b}header{padding:20px;margin-bottom:20px}header p{font-size:18px;font-size:1.125rem}section{padding-bottom:20px}@media (min-width:480px){header{padding-top:60px;padding-bottom:60px}section{padding-bottom:40px}}.icon{fill:currentColor;width:18px;height:18px;vertical-align:-3px}a svg,button svg,label svg{pointer-events:none}.btn .icon,a .icon{margin-right:10px}nav ul{margin:0;font-size:0}nav li{margin-top:10px;font-size:16px;font-size:1rem}nav li+li{margin-left:20px}.btn-bar{margin:0 auto 20px;max-width:1200px}.btn-bar::before{position:absolute;left:0;right:0;height:1px;background:#dbe3e8}.btn-bar ul{position:relative;z-index:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn-bar li{margin:0}.btn-bar li:first-child .btn{border-radius:4px 0 0 4px}.btn-bar li:last-child .btn{border-radius:0 4px 4px 0}.btn-bar li+li .btn{margin-left:-1px}.btn-bar .btn{display:block;border-radius:0}.btn-bar .btn.active{box-shadow:inset 0 1px 1px rgba(0,0,0,.2);position:relative;z-index:1}.btn-bar .btn.active .icon{color:inherit}@media (min-width:560px){.btn-bar{margin-bottom:40px}}.btn,.btn-count{display:inline-block;vertical-align:middle;border-radius:4px;font-weight:600;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn{padding:10px 20px;background:#f2f5f7;border:1px solid #cbd0d3;box-shadow:inset 0 1px 0 #fff,0 1px 1px rgba(0,0,0,.05);text-shadow:0 1px 1px #fff;color:#55646b;transition:background .3s ease,border .3s ease,color .3s ease}.btn:focus,.btn:hover{border-color:#b5bcc0;color:#55646b;outline:0}.btn-youtube .icon{color:#cc181e}.btn-vimeo .icon{color:#19b7ed}.btn-twitter .icon{color:#4BAAF4}.btn-bar .active,.btn-primary{background-image:linear-gradient(#3498db,#2791d9);background-color:#3498db;border-color:#217dbb;box-shadow:0 1px 1px rgba(0,0,0,.15);text-shadow:0 1px 1px rgba(0,0,0,.1);color:#fff}.btn-primary:focus,.btn-primary:hover{color:#fff;border-color:#196090}.btn-small{padding-top:7px;padding-bottom:7px}.btn-count{position:relative;margin-left:10px;padding:10px 15px;background:#fff;border:1px solid #cbd0d3}.btn-count::before{position:absolute;display:block;width:8px;height:8px;left:1px;margin-top:-4px;background:inherit;border:inherit;border-width:1px 0 0 1px;-webkit-transform:rotate(-45deg) translate(-50%,-50%);transform:rotate(-45deg) translate(-50%,-50%)}.panel{display:none}.panel.active{display:block;-webkit-animation:fade-in .3s ease;animation:fade-in .3s ease}.error body,html.error{height:100%}.error body{width:100%;display:table;table-layout:fixed}.error main{display:table-cell;width:100%;vertical-align:middle}.example-audio .player,.example-video .player{margin:0 auto 20px}.example-audio .player-controls,.example-video .player-controls{border-radius:0 0 4px 4px}.example-audio .player{max-width:520px}.example-audio .player-controls{border-radius:4px}.example-audio .player-progress{border-radius:4px 4px 0 0;overflow:hidden}.example-video .player{max-width:1200px}.example-video .player iframe,.example-video .player video{border-radius:4px}.example-video .player-video iframe,.example-video .player-video video,.example-video .player-youtube iframe,.example-video .player-youtube video{border-radius:4px 4px 0 0}.example-video .player-video-fullscreen,.example-video .player-video.fullscreen-active,.example-video .player-youtube-fullscreen,.example-video .player-youtube.fullscreen-active{max-width:none}.example-video .player-video-fullscreen .player-controls,.example-video .player-video-fullscreen iframe,.example-video .player-video-fullscreen video,.example-video .player-video.fullscreen-active .player-controls,.example-video .player-video.fullscreen-active iframe,.example-video .player-video.fullscreen-active video,.example-video .player-youtube-fullscreen .player-controls,.example-video .player-youtube-fullscreen iframe,.example-video .player-youtube-fullscreen video,.example-video .player-youtube.fullscreen-active .player-controls,.example-video .player-youtube.fullscreen-active iframe,.example-video .player-youtube.fullscreen-active video{border-radius:0}.example-video .player-video-fullscreen iframe,.example-video .player-video.fullscreen-active iframe,.example-video .player-youtube-fullscreen iframe,.example-video .player-youtube.fullscreen-active iframe{-webkit-mask-image:none}
\ No newline at end of file diff --git a/docs/dist/docs.js b/docs/dist/docs.js index cea5c257..d4b4b57a 100644 --- a/docs/dist/docs.js +++ b/docs/dist/docs.js @@ -1 +1 @@ -var Hogan={};!function(t){function n(t,n,e){var s;return n&&"object"==typeof n&&(void 0!==n[t]?s=n[t]:e&&n.get&&"function"==typeof n.get&&(s=n.get(t))),s}function e(t,n,e,s,r,i){function a(){}function o(){}a.prototype=t,o.prototype=t.subs;var l,u=new a;u.subs=new o,u.subsText={},u.buf="",s=s||{},u.stackSubs=s,u.subsText=i;for(l in n)s[l]||(s[l]=n[l]);for(l in s)u.subs[l]=s[l];r=r||{},u.stackPartials=r;for(l in e)r[l]||(r[l]=e[l]);for(l in r)u.partials[l]=r[l];return u}function s(t){return String(null===t||void 0===t?"":t)}function r(t){return t=s(t),c.test(t)?t.replace(i,"&").replace(a,"<").replace(o,">").replace(l,"'").replace(u,"""):t}t.Template=function(t,n,e,s){t=t||{},this.r=t.code||this.r,this.c=e,this.options=s||{},this.text=n||"",this.partials=t.partials||{},this.subs=t.subs||{},this.buf=""},t.Template.prototype={r:function(t,n,e){return""},v:r,t:s,render:function(t,n,e){return this.ri([t],n||{},e)},ri:function(t,n,e){return this.r(t,n,e)},ep:function(t,n){var s=this.partials[t],r=n[s.name];if(s.instance&&s.base==r)return s.instance;if("string"==typeof r){if(!this.c)throw new Error("No compiler available.");r=this.c.compile(r,this.options)}if(!r)return null;if(this.partials[t].base=r,s.subs){n.stackText||(n.stackText={});for(key in s.subs)n.stackText[key]||(n.stackText[key]=void 0!==this.activeSub&&n.stackText[this.activeSub]?n.stackText[this.activeSub]:this.text);r=e(r,s.subs,s.partials,this.stackSubs,this.stackPartials,n.stackText)}return this.partials[t].instance=r,r},rp:function(t,n,e,s){var r=this.ep(t,e);return r?r.ri(n,e,s):""},rs:function(t,n,e){var s=t[t.length-1];if(!p(s))return void e(t,n,this);for(var r=0;r<s.length;r++)t.push(s[r]),e(t,n,this),t.pop()},s:function(t,n,e,s,r,i,a){var o;return p(t)&&0===t.length?!1:("function"==typeof t&&(t=this.ms(t,n,e,s,r,i,a)),o=!!t,!s&&o&&n&&n.push("object"==typeof t?t:n[n.length-1]),o)},d:function(t,e,s,r){var i,a=t.split("."),o=this.f(a[0],e,s,r),l=this.options.modelGet,u=null;if("."===t&&p(e[e.length-2]))o=e[e.length-1];else for(var c=1;c<a.length;c++)i=n(a[c],o,l),void 0!==i?(u=o,o=i):o="";return r&&!o?!1:(r||"function"!=typeof o||(e.push(u),o=this.mv(o,e,s),e.pop()),o)},f:function(t,e,s,r){for(var i=!1,a=null,o=!1,l=this.options.modelGet,u=e.length-1;u>=0;u--)if(a=e[u],i=n(t,a,l),void 0!==i){o=!0;break}return o?(r||"function"!=typeof i||(i=this.mv(i,e,s)),i):r?!1:""},ls:function(t,n,e,r,i){var a=this.options.delimiters;return this.options.delimiters=i,this.b(this.ct(s(t.call(n,r)),n,e)),this.options.delimiters=a,!1},ct:function(t,n,e){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(t,this.options).render(n,e)},b:function(t){this.buf+=t},fl:function(){var t=this.buf;return this.buf="",t},ms:function(t,n,e,s,r,i,a){var o,l=n[n.length-1],u=t.call(l);return"function"==typeof u?s?!0:(o=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(u,l,e,o.substring(r,i),a)):u},mv:function(t,n,e){var r=n[n.length-1],i=t.call(r);return"function"==typeof i?this.ct(s(i.call(r)),r,e):i},sub:function(t,n,e,s){var r=this.subs[t];r&&(this.activeSub=t,r(n,e,this,s),this.activeSub=!1)}};var i=/&/g,a=/</g,o=/>/g,l=/\'/g,u=/\"/g,c=/[&<>\"\']/,p=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}}("undefined"!=typeof exports?exports:Hogan),function(t){function n(t){"}"===t.n.substr(t.n.length-1)&&(t.n=t.n.substring(0,t.n.length-1))}function e(t){return t.trim?t.trim():t.replace(/^\s*|\s*$/g,"")}function s(t,n,e){if(n.charAt(e)!=t.charAt(0))return!1;for(var s=1,r=t.length;r>s;s++)if(n.charAt(e+s)!=t.charAt(s))return!1;return!0}function r(n,e,s,o){var l=[],u=null,c=null,p=null;for(c=s[s.length-1];n.length>0;){if(p=n.shift(),c&&"<"==c.tag&&!(p.tag in k))throw new Error("Illegal content in < super tag.");if(t.tags[p.tag]<=t.tags.$||i(p,o))s.push(p),p.nodes=r(n,p.tag,s,o);else{if("/"==p.tag){if(0===s.length)throw new Error("Closing tag without opener: /"+p.n);if(u=s.pop(),p.n!=u.n&&!a(p.n,u.n,o))throw new Error("Nesting error: "+u.n+" vs. "+p.n);return u.end=p.i,l}"\n"==p.tag&&(p.last=0==n.length||"\n"==n[0].tag)}l.push(p)}if(s.length>0)throw new Error("missing closing tag: "+s.pop().n);return l}function i(t,n){for(var e=0,s=n.length;s>e;e++)if(n[e].o==t.n)return t.tag="#",!0}function a(t,n,e){for(var s=0,r=e.length;r>s;s++)if(e[s].c==t&&e[s].o==n)return!0}function o(t){var n=[];for(var e in t)n.push('"'+u(e)+'": function(c,p,t,i) {'+t[e]+"}");return"{ "+n.join(",")+" }"}function l(t){var n=[];for(var e in t.partials)n.push('"'+u(e)+'":{name:"'+u(t.partials[e].name)+'", '+l(t.partials[e])+"}");return"partials: {"+n.join(",")+"}, subs: "+o(t.subs)}function u(t){return t.replace(m,"\\\\").replace(g,'\\"').replace(d,"\\n").replace(v,"\\r").replace(y,"\\u2028").replace(w,"\\u2029")}function c(t){return~t.indexOf(".")?"d":"f"}function p(t,n){var e="<"+(n.prefix||""),s=e+t.n+x++;return n.partials[s]={name:t.n,partials:{}},n.code+='t.b(t.rp("'+u(s)+'",c,p,"'+(t.indent||"")+'"));',s}function f(t,n){n.code+="t.b(t.t(t."+c(t.n)+'("'+u(t.n)+'",c,p,0)));'}function b(t){return"t.b("+t+");"}var h=/\S/,g=/\"/g,d=/\n/g,v=/\r/g,m=/\\/g,y=/\u2028/,w=/\u2029/;t.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},t.scan=function(r,i){function a(){m.length>0&&(y.push({tag:"_t",text:new String(m)}),m="")}function o(){for(var n=!0,e=x;e<y.length;e++)if(n=t.tags[y[e].tag]<t.tags._v||"_t"==y[e].tag&&null===y[e].text.match(h),!n)return!1;return n}function l(t,n){if(a(),t&&o())for(var e,s=x;s<y.length;s++)y[s].text&&((e=y[s+1])&&">"==e.tag&&(e.indent=y[s].text.toString()),y.splice(s,1));else n||y.push({tag:"\n"});w=!1,x=y.length}function u(t,n){var s="="+S,r=t.indexOf(s,n),i=e(t.substring(t.indexOf("=",n)+1,r)).split(" ");return T=i[0],S=i[i.length-1],r+s.length-1}var c=r.length,p=0,f=1,b=2,g=p,d=null,v=null,m="",y=[],w=!1,k=0,x=0,T="{{",S="}}";for(i&&(i=i.split(" "),T=i[0],S=i[1]),k=0;c>k;k++)g==p?s(T,r,k)?(--k,a(),g=f):"\n"==r.charAt(k)?l(w):m+=r.charAt(k):g==f?(k+=T.length-1,v=t.tags[r.charAt(k+1)],d=v?r.charAt(k+1):"_v","="==d?(k=u(r,k),g=p):(v&&k++,g=b),w=k):s(S,r,k)?(y.push({tag:d,n:e(m),otag:T,ctag:S,i:"/"==d?w-T.length:k+S.length}),m="",k+=S.length-1,g=p,"{"==d&&("}}"==S?k++:n(y[y.length-1]))):m+=r.charAt(k);return l(w,!0),y};var k={_t:!0,"\n":!0,$:!0,"/":!0};t.stringify=function(n,e,s){return"{code: function (c,p,i) { "+t.wrapMain(n.code)+" },"+l(n)+"}"};var x=0;t.generate=function(n,e,s){x=0;var r={code:"",subs:{},partials:{}};return t.walk(n,r),s.asString?this.stringify(r,e,s):this.makeTemplate(r,e,s)},t.wrapMain=function(t){return'var t=this;t.b(i=i||"");'+t+"return t.fl();"},t.template=t.Template,t.makeTemplate=function(t,n,e){var s=this.makePartials(t);return s.code=new Function("c","p","i",this.wrapMain(t.code)),new this.template(s,n,this,e)},t.makePartials=function(t){var n,e={subs:{},partials:t.partials,name:t.name};for(n in e.partials)e.partials[n]=this.makePartials(e.partials[n]);for(n in t.subs)e.subs[n]=new Function("c","p","t","i",t.subs[n]);return e},t.codegen={"#":function(n,e){e.code+="if(t.s(t."+c(n.n)+'("'+u(n.n)+'",c,p,1),c,p,0,'+n.i+","+n.end+',"'+n.otag+" "+n.ctag+'")){t.rs(c,p,function(c,p,t){',t.walk(n.nodes,e),e.code+="});c.pop();}"},"^":function(n,e){e.code+="if(!t.s(t."+c(n.n)+'("'+u(n.n)+'",c,p,1),c,p,1,0,0,"")){',t.walk(n.nodes,e),e.code+="};"},">":p,"<":function(n,e){var s={partials:{},code:"",subs:{},inPartial:!0};t.walk(n.nodes,s);var r=e.partials[p(n,e)];r.subs=s.subs,r.partials=s.partials},$:function(n,e){var s={subs:{},code:"",partials:e.partials,prefix:n.n};t.walk(n.nodes,s),e.subs[n.n]=s.code,e.inPartial||(e.code+='t.sub("'+u(n.n)+'",c,p,i);')},"\n":function(t,n){n.code+=b('"\\n"'+(t.last?"":" + i"))},_v:function(t,n){n.code+="t.b(t.v(t."+c(t.n)+'("'+u(t.n)+'",c,p,0)));'},_t:function(t,n){n.code+=b('"'+u(t.text)+'"')},"{":f,"&":f},t.walk=function(n,e){for(var s,r=0,i=n.length;i>r;r++)s=t.codegen[n[r].tag],s&&s(n[r],e);return e},t.parse=function(t,n,e){return e=e||{},r(t,"",[],e.sectionTags||[])},t.cache={},t.cacheKey=function(t,n){return[t,!!n.asString,!!n.disableLambda,n.delimiters,!!n.modelGet].join("||")},t.compile=function(n,e){e=e||{};var s=t.cacheKey(n,e),r=this.cache[s];if(r){var i=r.partials;for(var a in i)delete i[a].instance;return r}return r=this.generate(this.parse(this.scan(n,e.delimiters),n,e),n,e),this.cache[s]=r}}("undefined"!=typeof exports?exports:Hogan);var Mustache=function(t){function n(n,e,s,r){var i=this.f(n,e,s,0),a=e;return i&&(a=a.concat(i)),t.Template.prototype.rp.call(this,n,a,s,r)}var e=function(e,s,r){this.rp=n,t.Template.call(this,e,s,r)};e.prototype=t.Template.prototype;var s,r=function(){this.cache={},this.generate=function(t,n,r){return new e(new Function("c","p","i",t),n,s)}};return r.prototype=t,s=new r,{to_html:function(t,n,e,r){var i=s.compile(t),a=i.render(n,e);return r?void r(a):a}}}(Hogan);"document"in self&&("classList"in document.createElement("_")?!function(){"use strict";var t=document.createElement("_");if(t.classList.add("c1","c2"),!t.classList.contains("c2")){var n=function(t){var n=DOMTokenList.prototype[t];DOMTokenList.prototype[t]=function(t){var e,s=arguments.length;for(e=0;s>e;e++)t=arguments[e],n.call(this,t)}};n("add"),n("remove")}if(t.classList.toggle("c3",!1),t.classList.contains("c3")){var e=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,n){return 1 in arguments&&!this.contains(t)==!n?n:e.call(this,t)}}t=null}():!function(t){"use strict";if("Element"in t){var n="classList",e="prototype",s=t.Element[e],r=Object,i=String[e].trim||function(){return this.replace(/^\s+|\s+$/g,"")},a=Array[e].indexOf||function(t){for(var n=0,e=this.length;e>n;n++)if(n in this&&this[n]===t)return n;return-1},o=function(t,n){this.name=t,this.code=DOMException[t],this.message=n},l=function(t,n){if(""===n)throw new o("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(n))throw new o("INVALID_CHARACTER_ERR","String contains an invalid character");return a.call(t,n)},u=function(t){for(var n=i.call(t.getAttribute("class")||""),e=n?n.split(/\s+/):[],s=0,r=e.length;r>s;s++)this.push(e[s]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},c=u[e]=[],p=function(){return new u(this)};if(o[e]=Error[e],c.item=function(t){return this[t]||null},c.contains=function(t){return t+="",-1!==l(this,t)},c.add=function(){var t,n=arguments,e=0,s=n.length,r=!1;do t=n[e]+"",-1===l(this,t)&&(this.push(t),r=!0);while(++e<s);r&&this._updateClassName()},c.remove=function(){var t,n,e=arguments,s=0,r=e.length,i=!1;do for(t=e[s]+"",n=l(this,t);-1!==n;)this.splice(n,1),i=!0,n=l(this,t);while(++s<r);i&&this._updateClassName()},c.toggle=function(t,n){t+="";var e=this.contains(t),s=e?n!==!0&&"remove":n!==!1&&"add";return s&&this[s](t),n===!0||n===!1?n:!e},c.toString=function(){return this.join(" ")},r.defineProperty){var f={get:p,enumerable:!0,configurable:!0};try{r.defineProperty(s,n,f)}catch(b){-2146823252===b.number&&(f.enumerable=!1,r.defineProperty(s,n,f))}}else r[e].__defineGetter__&&s.__defineGetter__(n,p)}}(self));var templates={};templates.controls=new Hogan.Template({code:function(t,n,e){var s=this;return s.b(e=e||""),s.b('<div class="player-controls">'),s.b("\n"+e),s.b(' <div class="player-progress">'),s.b("\n"+e),s.b(' <label for="seek{id}" class="sr-only">Seek</label>'),s.b("\n"+e),s.b(' <input id="seek{id}" class="player-progress-seek" type="range" min="0" max="100" step="0.5" value="0" data-player="seek">'),s.b("\n"+e),s.b(' <progress class="player-progress-played" max="100" value="0">'),s.b("\n"+e),s.b(" <span>0</span>% played"),s.b("\n"+e),s.b(" </progress>"),s.b("\n"+e),s.b(' <progress class="player-progress-buffer" max="100" value="0">'),s.b("\n"+e),s.b(" <span>0</span>% buffered"),s.b("\n"+e),s.b(" </progress>"),s.b("\n"+e),s.b(" </div>"),s.b("\n"+e),s.b(' <span class="player-controls-left">'),s.b("\n"+e),s.b(' <button type="button" data-player="restart">'),s.b("\n"+e),s.b(' <svg><use xlink:href="#icon-restart"></use></svg>'),s.b("\n"+e),s.b(' <span class="sr-only">Restart</span>'),s.b("\n"+e),s.b(" </button>"),s.b("\n"+e),s.b(' <button type="button" data-player="rewind">'),s.b("\n"+e),s.b(' <svg><use xlink:href="#icon-rewind"></use></svg>'),s.b("\n"+e),s.b(' <span class="sr-only">Rewind {seektime} secs</span>'),s.b("\n"+e),s.b(" </button>"),s.b("\n"+e),s.b(' <button type="button" data-player="play">'),s.b("\n"+e),s.b(' <svg><use xlink:href="#icon-play"></use></svg>'),s.b("\n"+e),s.b(' <span class="sr-only">Play</span>'),s.b("\n"+e),s.b(" </button>"),s.b("\n"+e),s.b(' <button type="button" data-player="pause">'),s.b("\n"+e),s.b(' <svg><use xlink:href="#icon-pause"></use></svg>'),s.b("\n"+e),s.b(' <span class="sr-only">Pause</span>'),s.b("\n"+e),s.b(" </button>"),s.b("\n"+e),s.b(' <button type="button" data-player="fast-forward">'),s.b("\n"+e),s.b(' <svg><use xlink:href="#icon-fast-forward"></use></svg>'),s.b("\n"+e),s.b(' <span class="sr-only">Forward {seektime} secs</span>'),s.b("\n"+e),s.b(" </button>"),s.b("\n"+e),s.b(' <span class="player-time">'),s.b("\n"+e),s.b(' <span class="sr-only">Current time</span>'),s.b("\n"+e),s.b(' <span class="player-current-time">00:00</span>'),s.b("\n"+e),s.b(" </span>"),s.b("\n"+e),s.b(' <span class="player-time">'),s.b("\n"+e),s.b(' <span class="sr-only">Duration</span>'),s.b("\n"+e),s.b(' <span class="player-duration">00:00</span>'),s.b("\n"+e),s.b(" </span>"),s.b("\n"+e),s.b(" </span>"),s.b("\n"+e),s.b(' <span class="player-controls-right">'),s.b("\n"+e),s.b(' <button type="button" data-player="mute">'),s.b("\n"+e),s.b(' <svg class="icon-muted"><use xlink:href="#icon-muted"></use></svg>'),s.b("\n"+e),s.b(' <svg><use xlink:href="#icon-volume"></use></svg>'),s.b("\n"+e),s.b(' <span class="sr-only">Toggle Mute</span>'),s.b("\n"+e),s.b(" </button>"),s.b("\n"+e),s.b(' <label for="volume{id}" class="sr-only">Volume</label>'),s.b("\n"+e),s.b(' <input id="volume{id}" class="player-volume" type="range" min="0" max="10" step="0.5" value="0" data-player="volume">'),s.b("\n"+e),s.b(' <button type="button" data-player="captions">'),s.b("\n"+e),s.b(' <svg class="icon-captions-on"><use xlink:href="#icon-captions-on"></use></svg>'),s.b("\n"+e),s.b(' <svg><use xlink:href="#icon-captions-off"></use></svg>'),s.b("\n"+e),s.b(' <span class="sr-only">Toggle Captions</span>'),s.b("\n"+e),s.b(" </button>"),s.b("\n"+e),s.b(' <button type="button" data-player="fullscreen">'),s.b("\n"+e),s.b(' <svg class="icon-exit-fullscreen"><use xlink:href="#icon-exit-fullscreen"></use></svg>'),s.b("\n"+e),s.b(' <svg><use xlink:href="#icon-enter-fullscreen"></use></svg>'),s.b("\n"+e),s.b(' <span class="sr-only">Toggle Fullscreen</span>'),s.b("\n"+e),s.b(" </button>"),s.b("\n"+e),s.b(" </span>"),s.b("\n"+e),s.b("</div>"),s.fl()},partials:{},subs:{}}),plyr.setup({debug:!0,volume:9,title:"Video demo",html:templates.controls.render({}),tooltips:!0,captions:{defaultActive:!0},onSetup:function(){if("media"in this){var t=this,n=t.media.tagName.toLowerCase(),e=document.querySelector("[data-toggle='fullscreen']");console.log("✓ Setup done for <"+n+">"),"video"===n&&e&&e.addEventListener("click",t.toggleFullscreen,!1)}}}),function(){function t(t){"a"==t.target.nodeName.toLowerCase()&&(t.preventDefault?t.preventDefault():t.returnValue=!1);var n=t.target,e=n.href,s=n.getAttribute("data-window-width")||600,r=n.getAttribute("data-window-height")||600,i=n.getAttribute("data-window-name")||"popup";if(window["window-"+i]&&!window["window-"+i].closed)window["window-"+i].focus();else{var a=void 0!==window.screenLeft?window.screenLeft:screen.left,o=void 0!==window.screenTop?window.screenTop:screen.top,l=screen.width/2-s/2+a,u=screen.height/2-r/2+o;window["window-"+i]=window.open(e,i,"top="+u+",left="+l+",width="+s+",height="+r),window["window-"+i].focus()}}function n(t){t.preventDefault();for(var n=t.target,i=document.querySelector(n.getAttribute("href")),a=s.length-1;a>=0;a--)s[a].classList.remove(r);for(var o=e.length-1;o>=0;o--)e[o].classList.remove(r);i.classList.add(r),t.target.classList.add(r)}document.querySelector(".js-popup").addEventListener("click",t);for(var e=document.querySelectorAll(".nav-panel a"),s=document.querySelectorAll(".panels > .panel"),r="active",i=e.length-1;i>=0;i--)e[i].addEventListener("click",n)}(),document.domain.indexOf("plyr.io")>-1&&(!function(t,n,e,s,r,i,a){t.GoogleAnalyticsObject=r,t[r]=t[r]||function(){(t[r].q=t[r].q||[]).push(arguments)},t[r].l=1*new Date,i=n.createElement(e),a=n.getElementsByTagName(e)[0],i.async=1,i.src=s,a.parentNode.insertBefore(i,a)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),ga("create","UA-40881672-11","auto"),ga("send","pageview"));
\ No newline at end of file +"document"in self&&("classList"in document.createElement("_")?!function(){"use strict";var t=document.createElement("_");if(t.classList.add("c1","c2"),!t.classList.contains("c2")){var e=function(t){var e=DOMTokenList.prototype[t];DOMTokenList.prototype[t]=function(t){var n,i=arguments.length;for(n=0;i>n;n++)t=arguments[n],e.call(this,t)}};e("add"),e("remove")}if(t.classList.toggle("c3",!1),t.classList.contains("c3")){var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return 1 in arguments&&!this.contains(t)==!e?e:n.call(this,t)}}t=null}():!function(t){"use strict";if("Element"in t){var e="classList",n="prototype",i=t.Element[n],s=Object,r=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},o=Array[n].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},a=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},c=function(t,e){if(""===e)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return o.call(t,e)},l=function(t){for(var e=r.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],i=0,s=n.length;s>i;i++)this.push(n[i]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},u=l[n]=[],f=function(){return new l(this)};if(a[n]=Error[n],u.item=function(t){return this[t]||null},u.contains=function(t){return t+="",-1!==c(this,t)},u.add=function(){var t,e=arguments,n=0,i=e.length,s=!1;do t=e[n]+"",-1===c(this,t)&&(this.push(t),s=!0);while(++n<i);s&&this._updateClassName()},u.remove=function(){var t,e,n=arguments,i=0,s=n.length,r=!1;do for(t=n[i]+"",e=c(this,t);-1!==e;)this.splice(e,1),r=!0,e=c(this,t);while(++i<s);r&&this._updateClassName()},u.toggle=function(t,e){t+="";var n=this.contains(t),i=n?e!==!0&&"remove":e!==!1&&"add";return i&&this[i](t),e===!0||e===!1?e:!n},u.toString=function(){return this.join(" ")},s.defineProperty){var d={get:f,enumerable:!0,configurable:!0};try{s.defineProperty(i,e,d)}catch(g){-2146823252===g.number&&(d.enumerable=!1,s.defineProperty(i,e,d))}}else s[n].__defineGetter__&&i.__defineGetter__(e,f)}}(self)),plyr.setup({debug:!0,volume:9,title:"Video demo",tooltips:!0,captions:{defaultActive:!0},onSetup:function(){if("media"in this){var t=this,e=t.media.tagName.toLowerCase(),n=document.querySelector("[data-toggle='fullscreen']");console.log("✓ Setup done for <"+e+">"),"video"===e&&n&&n.addEventListener("click",t.toggleFullscreen,!1)}}}),shr.setup({count:{classname:"btn-count"}}),function(){function t(t){t.preventDefault();for(var s=t.target,r=document.querySelector(s.getAttribute("href")),o=n.length-1;o>=0;o--)n[o].classList.remove(i);for(var a=e.length-1;a>=0;a--)e[a].classList.remove(i);r.classList.add(i),t.target.classList.add(i)}for(var e=document.querySelectorAll(".nav-panel a"),n=document.querySelectorAll(".panels > .panel"),i="active",s=e.length-1;s>=0;s--)e[s].addEventListener("click",t)}(),document.domain.indexOf("plyr.io")>-1&&(!function(t,e,n,i,s,r,o){t.GoogleAnalyticsObject=s,t[s]=t[s]||function(){(t[s].q=t[s].q||[]).push(arguments)},t[s].l=1*new Date,r=e.createElement(n),o=e.getElementsByTagName(n)[0],r.async=1,r.src=i,o.parentNode.insertBefore(r,o)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),ga("create","UA-40881672-11","auto"),ga("send","pageview"));
\ No newline at end of file diff --git a/docs/dist/templates.js b/docs/dist/templates.js deleted file mode 100644 index 7b523c86..00000000 --- a/docs/dist/templates.js +++ /dev/null @@ -1,2 +0,0 @@ - var templates = {}; - templates['controls'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"player-controls\">");t.b("\n" + i);t.b(" <div class=\"player-progress\">");t.b("\n" + i);t.b(" <label for=\"seek{id}\" class=\"sr-only\">Seek</label>");t.b("\n" + i);t.b(" <input id=\"seek{id}\" class=\"player-progress-seek\" type=\"range\" min=\"0\" max=\"100\" step=\"0.5\" value=\"0\" data-player=\"seek\">");t.b("\n" + i);t.b(" <progress class=\"player-progress-played\" max=\"100\" value=\"0\">");t.b("\n" + i);t.b(" <span>0</span>% played");t.b("\n" + i);t.b(" </progress>");t.b("\n" + i);t.b(" <progress class=\"player-progress-buffer\" max=\"100\" value=\"0\">");t.b("\n" + i);t.b(" <span>0</span>% buffered");t.b("\n" + i);t.b(" </progress>");t.b("\n" + i);t.b(" </div>");t.b("\n" + i);t.b(" <span class=\"player-controls-left\">");t.b("\n" + i);t.b(" <button type=\"button\" data-player=\"restart\">");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-restart\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Restart</span>");t.b("\n" + i);t.b(" </button>");t.b("\n" + i);t.b(" <button type=\"button\" data-player=\"rewind\">");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-rewind\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Rewind {seektime} secs</span>");t.b("\n" + i);t.b(" </button>");t.b("\n" + i);t.b(" <button type=\"button\" data-player=\"play\">");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-play\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Play</span>");t.b("\n" + i);t.b(" </button>");t.b("\n" + i);t.b(" <button type=\"button\" data-player=\"pause\">");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-pause\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Pause</span>");t.b("\n" + i);t.b(" </button>");t.b("\n" + i);t.b(" <button type=\"button\" data-player=\"fast-forward\">");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-fast-forward\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Forward {seektime} secs</span>");t.b("\n" + i);t.b(" </button>");t.b("\n" + i);t.b(" <span class=\"player-time\">");t.b("\n" + i);t.b(" <span class=\"sr-only\">Current time</span>");t.b("\n" + i);t.b(" <span class=\"player-current-time\">00:00</span>");t.b("\n" + i);t.b(" </span>");t.b("\n" + i);t.b(" <span class=\"player-time\">");t.b("\n" + i);t.b(" <span class=\"sr-only\">Duration</span>");t.b("\n" + i);t.b(" <span class=\"player-duration\">00:00</span>");t.b("\n" + i);t.b(" </span>");t.b("\n" + i);t.b(" </span>");t.b("\n" + i);t.b(" <span class=\"player-controls-right\">");t.b("\n" + i);t.b(" <button type=\"button\" data-player=\"mute\">");t.b("\n" + i);t.b(" <svg class=\"icon-muted\"><use xlink:href=\"#icon-muted\"></use></svg>");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-volume\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Toggle Mute</span>");t.b("\n" + i);t.b(" </button>");t.b("\n" + i);t.b(" <label for=\"volume{id}\" class=\"sr-only\">Volume</label>");t.b("\n" + i);t.b(" <input id=\"volume{id}\" class=\"player-volume\" type=\"range\" min=\"0\" max=\"10\" step=\"0.5\" value=\"0\" data-player=\"volume\">");t.b("\n" + i);t.b(" <button type=\"button\" data-player=\"captions\">");t.b("\n" + i);t.b(" <svg class=\"icon-captions-on\"><use xlink:href=\"#icon-captions-on\"></use></svg>");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-captions-off\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Toggle Captions</span>");t.b("\n" + i);t.b(" </button>");t.b("\n" + i);t.b(" <button type=\"button\" data-player=\"fullscreen\">");t.b("\n" + i);t.b(" <svg class=\"icon-exit-fullscreen\"><use xlink:href=\"#icon-exit-fullscreen\"></use></svg>");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-enter-fullscreen\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Toggle Fullscreen</span>");t.b("\n" + i);t.b(" </button>");t.b("\n" + i);t.b(" </span>");t.b("\n" + i);t.b("</div>");return t.fl(); },partials: {}, subs: { }});
\ No newline at end of file diff --git a/docs/error.html b/docs/error.html index 2168e2dd..8f5086ef 100644 --- a/docs/error.html +++ b/docs/error.html @@ -6,7 +6,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Docs styles --> - <link rel="stylesheet" href="//cdn.plyr.io/1.3.6/docs.css"> + <link rel="stylesheet" href="//cdn.plyr.io/1.3.7/docs.css"> </head> <body> <main> diff --git a/docs/index.html b/docs/index.html index ba8f7254..88d3c44b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,10 +8,10 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Styles --> - <link rel="stylesheet" href="https://cdn.plyr.io/1.3.6/plyr.css"> + <link rel="stylesheet" href="https://cdn.plyr.io/1.3.7/plyr.css"> <!-- Docs styles --> - <link rel="stylesheet" href="https://cdn.plyr.io/1.3.6/docs.css"> + <link rel="stylesheet" href="https://cdn.plyr.io/1.3.7/docs.css"> </head> <body> <header> @@ -20,10 +20,14 @@ <nav> <ul> <li> - <a href="https://github.com/selz/plyr" target="_blank" class="btn btn-primary">Download on GitHub</a> + <a href="https://github.com/selz/plyr" target="_blank" class="btn btn-primary" data-shr-network="github"> + <svg class="icon"><use xlink:href="#shr-github"/></svg>Download on GitHub + </a> </li> <li> - <a href="https://twitter.com/intent/tweet?text=A+simple+HTML5+media+player+with+custom+controls+and+WebVTT+captions.&url=https%3A%2F%2Fplyr.io&via=Sam_Potts" target="_blank" class="btn js-popup" data-window-height="250" data-window-width="500">Tweet</a> + <a href="https://twitter.com/intent/tweet?text=A+simple+HTML5+media+player+with+custom+controls+and+WebVTT+captions.&url=http%3A%2F%2Fplyr.io&via=Sam_Potts" target="_blank" class="btn btn-twitter" data-shr-network="twitter"> + <svg class="icon"><use xlink:href="#shr-twitter"/></svg>Tweet + </a> </li> </ul> </nav> @@ -79,29 +83,48 @@ <!-- Load SVG defs --> <!-- You should bundle all SVG/Icons into one file using a build tool such as gulp and svg store --> <script> - (function(d, u){ - var a = new XMLHttpRequest(), - b = d.body; + (function() { + [ + "https://cdn.shr.one/0.1.9/sprite.svg", + "https://cdn.plyr.io/1.3.7/sprite.svg" + ] + .forEach(function(u) { + var x = new XMLHttpRequest(), + b = document.body; - // Check for CORS support - // If you're loading from same domain, you can remove the if statement - if("withCredentials" in a) { - a.open("GET", u, true); - a.send(); - a.onload = function(){ - var c = d.createElement("div"); + // Check for CORS support + // If you're loading from same domain, you can remove the if statement + // XHR for Chrome/Firefox/Opera/Safari + if ("withCredentials" in x) { + x.open("GET", u, true); + } + // XDomainRequest for older IE + else if (typeof XDomainRequest != "undefined") { + x = new XDomainRequest(); + x.open("GET", u); + } + else { + return; + } + + x.send(); + x.onload = function() { + var c = document.createElement("div"); c.setAttribute("hidden", ""); - c.innerHTML = a.responseText; + c.innerHTML = x.responseText; b.insertBefore(c, b.childNodes[0]); } - } - })(document, "https://cdn.plyr.io/1.3.6/sprite.svg"); + }); + })(); </script> <!-- Plyr core script --> - <script src="https://cdn.plyr.io/1.3.6/plyr.js"></script> + <script src="https://cdn.plyr.io/1.3.7/plyr.js"></script> + + <!-- Shr core script --> + <script src="https://cdn.shr.one/0.1.9/shr.js"></script> <!-- Docs script --> - <script src="https://cdn.plyr.io/1.3.6/docs.js"></script> + <script src="https://cdn.plyr.io/1.3.7/docs.js"></script> </body> </html> diff --git a/docs/index.master.html b/docs/index.master.html new file mode 100644 index 00000000..c6972ae6 --- /dev/null +++ b/docs/index.master.html @@ -0,0 +1,130 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="utf-8" /> + <title>Plyr - A simple HTML5 media player</title> + <meta name="description" content="A simple HTML5 media player with custom controls and WebVTT captions."> + <meta name="author" content="Sam Potts"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + + <!-- Styles --> + <link rel="stylesheet" href="../dist/plyr.css"> + + <!-- Docs styles --> + <link rel="stylesheet" href="dist/docs.css"> + </head> + <body> + <header> + <h1>Plyr</h1> + <p>A simple HTML5 media player with custom controls and WebVTT captions by <a href="https://twitter.com/sam_potts" target="_blank">@sam_potts</a> from <a href="https://twitter.com/selz" target="_blank">@selz</a></p> + <nav> + <ul> + <li> + <a href="https://github.com/selz/plyr" target="_blank" class="btn btn-primary" data-shr-network="github"> + <svg class="icon"><use xlink:href="#shr-github"/></svg>Download on GitHub + </a> + </li> + <li> + <a href="https://twitter.com/intent/tweet?text=A+simple+HTML5+media+player+with+custom+controls+and+WebVTT+captions.&url=http%3A%2F%2Fplyr.io&via=Sam_Potts" target="_blank" class="btn btn-twitter" data-shr-network="twitter"> + <svg class="icon"><use xlink:href="#shr-twitter"/></svg>Tweet + </a> + </li> + </ul> + </nav> + </header> + + <main role="main" id="main"> + <nav class="btn-bar nav-panel"> + <ul> + <li><a href="#video" class="btn active btn-small">Video</a></li> + <li><a href="#youtube" class="btn btn-small">YouTube</a></li> + <li><a href="#audio" class="btn btn-small">Audio</a></li> + </ul> + </nav> + <div class="panels"> + <section class="panel example-video active" id="video"> + <div class="player"> + <video poster="poster.jpg" controls crossorigin> + <!-- Video files --> + <source src="https://cdn.selz.com/plyr/1.0/movie.mp4" type="video/mp4"> + <source src="https://cdn.selz.com/plyr/1.0/movie.webm" type="video/webm"> + + <!-- Text track file --> + <track kind="captions" label="English" srclang="en" src="https://cdn.selz.com/plyr/1.0/example_captions_en.vtt" default> + + <!-- Fallback for browsers that don't support the <video> element --> + <a href="https://cdn.selz.com/plyr/1.0/movie.mp4">Download</a> + </video> + </div> + <small>Big Buck Bunny. More info can be found at <a href="https://peach.blender.org" target="_blank">peach.blender.org</a>.</small> + </section> + <section class="panel example-video" id="youtube"> + <div class="player"> + <div data-video-id="Au87oAJ2jeE" data-type="youtube"></div> + </div> + <small>Envato's "Made By" interview of <a href="https://www.youtube.com/watch?v=Au87oAJ2jeE" target="_blank">Dan Cederholm</a> from <a href="https://dribbble.com" target="_blank">Dribbble</a>.</small> + </section> + <section class="panel example-audio" id="audio"> + <div class="player"> + <audio controls> + <!-- Audio files --> + <source src="//cdn.selz.com/plyr/1.0/logistics-96-sample.mp3" type="audio/mp3"> + <source src="//cdn.selz.com/plyr/1.0/logistics-96-sample.ogg" type="audio/ogg"> + + <!-- Fallback for browsers that don't support the <audio> element --> + <a href="//cdn.selz.com/plyr/1.0/logistics-96-sample.mp3">Download</a> + </audio> + </div> + <small>"96" by Logistics, which can be purchased from <a href="https://www.hospitalrecords.com/shop/artist/logistics" target="_blank">Hospital Records</a>.</small> + </section> + </div> + </main> + + <!-- Load SVG defs --> + <!-- You should bundle all SVG/Icons into one file using a build tool such as gulp and svg store --> + <script> + (function() { + [ + "https://cdn.shr.one/0.1.9/sprite.svg", + "../dist/sprite.svg" + ] + .forEach(function(u) { + var x = new XMLHttpRequest(), + b = document.body; + + // Check for CORS support + // If you're loading from same domain, you can remove the if statement + // XHR for Chrome/Firefox/Opera/Safari + if ("withCredentials" in x) { + x.open("GET", u, true); + } + // XDomainRequest for older IE + else if (typeof XDomainRequest != "undefined") { + x = new XDomainRequest(); + x.open("GET", u); + } + else { + return; + } + + x.send(); + x.onload = function() { + var c = document.createElement("div"); + c.setAttribute("hidden", ""); + c.innerHTML = x.responseText; + b.insertBefore(c, b.childNodes[0]); + } + }); + })(); + </script> + + <!-- Plyr core script --> + <script src="../src/js/plyr.js"></script> + + <!-- Shr core script --> + <script src="https://cdn.shr.one/0.1.9/shr.js"></script> + + <!-- Docs script --> + <script src="dist/docs.js"></script> + </body> +</html> diff --git a/docs/src/js/docs.js b/docs/src/js/docs.js index 981ace40..518e4e0c 100644 --- a/docs/src/js/docs.js +++ b/docs/src/js/docs.js @@ -2,14 +2,13 @@ // Docs example // ========================================================================== -/*global plyr, templates */ +/*global plyr, shr*/ // Setup the player plyr.setup({ debug: true, volume: 9, title: "Video demo", - html: templates.controls.render({}), tooltips: true, captions: { defaultActive: true @@ -31,50 +30,15 @@ plyr.setup({ } }); -// General functions -(function() { - // Popup - function popup(event) { - // Prevent the link opening - if(event.target.nodeName.toLowerCase() == "a") { - if(event.preventDefault) { - event.preventDefault(); - } - else { - event.returnValue = false; - } - } - - var link = event.target, - url = link.href, - width = link.getAttribute("data-window-width") || 600, - height = link.getAttribute("data-window-height") || 600, - name = link.getAttribute("data-window-name") || "popup"; - - // If window exists, just focus it - if(window["window-"+name] && !window["window-"+name].closed) { - window["window-"+name].focus(); - } - else { - // Get position - var left = window.screenLeft !== undefined ? window.screenLeft : screen.left; - var top = window.screenTop !== undefined ? window.screenTop : screen.top; - - // Open in the centre of the screen - var x = (screen.width / 2) - (width / 2) + left, - y = (screen.height / 2) - (height / 2) + top; - - // Open that window - window["window-"+name] = window.open(url, name, "top=" + y +",left="+ x +",width=" + width + ",height=" + height); - - // Focus new window - window["window-"+name].focus(); - } +// Setup shr +shr.setup({ + count: { + classname: "btn-count" } +}); - // Trigger popups - document.querySelector(".js-popup").addEventListener("click", popup); - +// General functions +(function() { // Tabs var tabs = document.querySelectorAll(".nav-panel a"), panels = document.querySelectorAll(".panels > .panel"), diff --git a/docs/src/js/lib/hogan-3.0.2.mustache.js b/docs/src/js/lib/hogan-3.0.2.mustache.js deleted file mode 100644 index f1300c46..00000000 --- a/docs/src/js/lib/hogan-3.0.2.mustache.js +++ /dev/null @@ -1,802 +0,0 @@ -/*! - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// A wrapper for compatibility with Mustache.js, quirks and all - - - -var Hogan = {}; - -(function (Hogan) { - Hogan.Template = function (codeObj, text, compiler, options) { - codeObj = codeObj || {}; - this.r = codeObj.code || this.r; - this.c = compiler; - this.options = options || {}; - this.text = text || ''; - this.partials = codeObj.partials || {}; - this.subs = codeObj.subs || {}; - this.buf = ''; - } - - Hogan.Template.prototype = { - // render: replaced by generated code. - r: function (context, partials, indent) { return ''; }, - - // variable escaping - v: hoganEscape, - - // triple stache - t: coerceToString, - - render: function render(context, partials, indent) { - return this.ri([context], partials || {}, indent); - }, - - // render internal -- a hook for overrides that catches partials too - ri: function (context, partials, indent) { - return this.r(context, partials, indent); - }, - - // ensurePartial - ep: function(symbol, partials) { - var partial = this.partials[symbol]; - - // check to see that if we've instantiated this partial before - var template = partials[partial.name]; - if (partial.instance && partial.base == template) { - return partial.instance; - } - - if (typeof template == 'string') { - if (!this.c) { - throw new Error("No compiler available."); - } - template = this.c.compile(template, this.options); - } - - if (!template) { - return null; - } - - // We use this to check whether the partials dictionary has changed - this.partials[symbol].base = template; - - if (partial.subs) { - // Make sure we consider parent template now - if (!partials.stackText) partials.stackText = {}; - for (key in partial.subs) { - if (!partials.stackText[key]) { - partials.stackText[key] = (this.activeSub !== undefined && partials.stackText[this.activeSub]) ? partials.stackText[this.activeSub] : this.text; - } - } - template = createSpecializedPartial(template, partial.subs, partial.partials, - this.stackSubs, this.stackPartials, partials.stackText); - } - this.partials[symbol].instance = template; - - return template; - }, - - // tries to find a partial in the current scope and render it - rp: function(symbol, context, partials, indent) { - var partial = this.ep(symbol, partials); - if (!partial) { - return ''; - } - - return partial.ri(context, partials, indent); - }, - - // render a section - rs: function(context, partials, section) { - var tail = context[context.length - 1]; - - if (!isArray(tail)) { - section(context, partials, this); - return; - } - - for (var i = 0; i < tail.length; i++) { - context.push(tail[i]); - section(context, partials, this); - context.pop(); - } - }, - - // maybe start a section - s: function(val, ctx, partials, inverted, start, end, tags) { - var pass; - - if (isArray(val) && val.length === 0) { - return false; - } - - if (typeof val == 'function') { - val = this.ms(val, ctx, partials, inverted, start, end, tags); - } - - pass = !!val; - - if (!inverted && pass && ctx) { - ctx.push((typeof val == 'object') ? val : ctx[ctx.length - 1]); - } - - return pass; - }, - - // find values with dotted names - d: function(key, ctx, partials, returnFound) { - var found, - names = key.split('.'), - val = this.f(names[0], ctx, partials, returnFound), - doModelGet = this.options.modelGet, - cx = null; - - if (key === '.' && isArray(ctx[ctx.length - 2])) { - val = ctx[ctx.length - 1]; - } else { - for (var i = 1; i < names.length; i++) { - found = findInScope(names[i], val, doModelGet); - if (found !== undefined) { - cx = val; - val = found; - } else { - val = ''; - } - } - } - - if (returnFound && !val) { - return false; - } - - if (!returnFound && typeof val == 'function') { - ctx.push(cx); - val = this.mv(val, ctx, partials); - ctx.pop(); - } - - return val; - }, - - // find values with normal names - f: function(key, ctx, partials, returnFound) { - var val = false, - v = null, - found = false, - doModelGet = this.options.modelGet; - - for (var i = ctx.length - 1; i >= 0; i--) { - v = ctx[i]; - val = findInScope(key, v, doModelGet); - if (val !== undefined) { - found = true; - break; - } - } - - if (!found) { - return (returnFound) ? false : ""; - } - - if (!returnFound && typeof val == 'function') { - val = this.mv(val, ctx, partials); - } - - return val; - }, - - // higher order templates - ls: function(func, cx, partials, text, tags) { - var oldTags = this.options.delimiters; - - this.options.delimiters = tags; - this.b(this.ct(coerceToString(func.call(cx, text)), cx, partials)); - this.options.delimiters = oldTags; - - return false; - }, - - // compile text - ct: function(text, cx, partials) { - if (this.options.disableLambda) { - throw new Error('Lambda features disabled.'); - } - return this.c.compile(text, this.options).render(cx, partials); - }, - - // template result buffering - b: function(s) { this.buf += s; }, - - fl: function() { var r = this.buf; this.buf = ''; return r; }, - - // method replace section - ms: function(func, ctx, partials, inverted, start, end, tags) { - var textSource, - cx = ctx[ctx.length - 1], - result = func.call(cx); - - if (typeof result == 'function') { - if (inverted) { - return true; - } else { - textSource = (this.activeSub && this.subsText && this.subsText[this.activeSub]) ? this.subsText[this.activeSub] : this.text; - return this.ls(result, cx, partials, textSource.substring(start, end), tags); - } - } - - return result; - }, - - // method replace variable - mv: function(func, ctx, partials) { - var cx = ctx[ctx.length - 1]; - var result = func.call(cx); - - if (typeof result == 'function') { - return this.ct(coerceToString(result.call(cx)), cx, partials); - } - - return result; - }, - - sub: function(name, context, partials, indent) { - var f = this.subs[name]; - if (f) { - this.activeSub = name; - f(context, partials, this, indent); - this.activeSub = false; - } - } - - }; - - //Find a key in an object - function findInScope(key, scope, doModelGet) { - var val; - - if (scope && typeof scope == 'object') { - - if (scope[key] !== undefined) { - val = scope[key]; - - // try lookup with get for backbone or similar model data - } else if (doModelGet && scope.get && typeof scope.get == 'function') { - val = scope.get(key); - } - } - - return val; - } - - function createSpecializedPartial(instance, subs, partials, stackSubs, stackPartials, stackText) { - function PartialTemplate() {}; - PartialTemplate.prototype = instance; - function Substitutions() {}; - Substitutions.prototype = instance.subs; - var key; - var partial = new PartialTemplate(); - partial.subs = new Substitutions(); - partial.subsText = {}; //hehe. substext. - partial.buf = ''; - - stackSubs = stackSubs || {}; - partial.stackSubs = stackSubs; - partial.subsText = stackText; - for (key in subs) { - if (!stackSubs[key]) stackSubs[key] = subs[key]; - } - for (key in stackSubs) { - partial.subs[key] = stackSubs[key]; - } - - stackPartials = stackPartials || {}; - partial.stackPartials = stackPartials; - for (key in partials) { - if (!stackPartials[key]) stackPartials[key] = partials[key]; - } - for (key in stackPartials) { - partial.partials[key] = stackPartials[key]; - } - - return partial; - } - - var rAmp = /&/g, - rLt = /</g, - rGt = />/g, - rApos = /\'/g, - rQuot = /\"/g, - hChars = /[&<>\"\']/; - - function coerceToString(val) { - return String((val === null || val === undefined) ? '' : val); - } - - function hoganEscape(str) { - str = coerceToString(str); - return hChars.test(str) ? - str - .replace(rAmp, '&') - .replace(rLt, '<') - .replace(rGt, '>') - .replace(rApos, ''') - .replace(rQuot, '"') : - str; - } - - var isArray = Array.isArray || function(a) { - return Object.prototype.toString.call(a) === '[object Array]'; - }; - -})(typeof exports !== 'undefined' ? exports : Hogan); - - - -(function (Hogan) { - // Setup regex assignments - // remove whitespace according to Mustache spec - var rIsWhitespace = /\S/, - rQuot = /\"/g, - rNewline = /\n/g, - rCr = /\r/g, - rSlash = /\\/g, - rLineSep = /\u2028/, - rParagraphSep = /\u2029/; - - Hogan.tags = { - '#': 1, '^': 2, '<': 3, '$': 4, - '/': 5, '!': 6, '>': 7, '=': 8, '_v': 9, - '{': 10, '&': 11, '_t': 12 - }; - - Hogan.scan = function scan(text, delimiters) { - var len = text.length, - IN_TEXT = 0, - IN_TAG_TYPE = 1, - IN_TAG = 2, - state = IN_TEXT, - tagType = null, - tag = null, - buf = '', - tokens = [], - seenTag = false, - i = 0, - lineStart = 0, - otag = '{{', - ctag = '}}'; - - function addBuf() { - if (buf.length > 0) { - tokens.push({tag: '_t', text: new String(buf)}); - buf = ''; - } - } - - function lineIsWhitespace() { - var isAllWhitespace = true; - for (var j = lineStart; j < tokens.length; j++) { - isAllWhitespace = - (Hogan.tags[tokens[j].tag] < Hogan.tags['_v']) || - (tokens[j].tag == '_t' && tokens[j].text.match(rIsWhitespace) === null); - if (!isAllWhitespace) { - return false; - } - } - - return isAllWhitespace; - } - - function filterLine(haveSeenTag, noNewLine) { - addBuf(); - - if (haveSeenTag && lineIsWhitespace()) { - for (var j = lineStart, next; j < tokens.length; j++) { - if (tokens[j].text) { - if ((next = tokens[j+1]) && next.tag == '>') { - // set indent to token value - next.indent = tokens[j].text.toString() - } - tokens.splice(j, 1); - } - } - } else if (!noNewLine) { - tokens.push({tag:'\n'}); - } - - seenTag = false; - lineStart = tokens.length; - } - - function changeDelimiters(text, index) { - var close = '=' + ctag, - closeIndex = text.indexOf(close, index), - delimiters = trim( - text.substring(text.indexOf('=', index) + 1, closeIndex) - ).split(' '); - - otag = delimiters[0]; - ctag = delimiters[delimiters.length - 1]; - - return closeIndex + close.length - 1; - } - - if (delimiters) { - delimiters = delimiters.split(' '); - otag = delimiters[0]; - ctag = delimiters[1]; - } - - for (i = 0; i < len; i++) { - if (state == IN_TEXT) { - if (tagChange(otag, text, i)) { - --i; - addBuf(); - state = IN_TAG_TYPE; - } else { - if (text.charAt(i) == '\n') { - filterLine(seenTag); - } else { - buf += text.charAt(i); - } - } - } else if (state == IN_TAG_TYPE) { - i += otag.length - 1; - tag = Hogan.tags[text.charAt(i + 1)]; - tagType = tag ? text.charAt(i + 1) : '_v'; - if (tagType == '=') { - i = changeDelimiters(text, i); - state = IN_TEXT; - } else { - if (tag) { - i++; - } - state = IN_TAG; - } - seenTag = i; - } else { - if (tagChange(ctag, text, i)) { - tokens.push({tag: tagType, n: trim(buf), otag: otag, ctag: ctag, - i: (tagType == '/') ? seenTag - otag.length : i + ctag.length}); - buf = ''; - i += ctag.length - 1; - state = IN_TEXT; - if (tagType == '{') { - if (ctag == '}}') { - i++; - } else { - cleanTripleStache(tokens[tokens.length - 1]); - } - } - } else { - buf += text.charAt(i); - } - } - } - - filterLine(seenTag, true); - - return tokens; - } - - function cleanTripleStache(token) { - if (token.n.substr(token.n.length - 1) === '}') { - token.n = token.n.substring(0, token.n.length - 1); - } - } - - function trim(s) { - if (s.trim) { - return s.trim(); - } - - return s.replace(/^\s*|\s*$/g, ''); - } - - function tagChange(tag, text, index) { - if (text.charAt(index) != tag.charAt(0)) { - return false; - } - - for (var i = 1, l = tag.length; i < l; i++) { - if (text.charAt(index + i) != tag.charAt(i)) { - return false; - } - } - - return true; - } - - // the tags allowed inside super templates - var allowedInSuper = {'_t': true, '\n': true, '$': true, '/': true}; - - function buildTree(tokens, kind, stack, customTags) { - var instructions = [], - opener = null, - tail = null, - token = null; - - tail = stack[stack.length - 1]; - - while (tokens.length > 0) { - token = tokens.shift(); - - if (tail && tail.tag == '<' && !(token.tag in allowedInSuper)) { - throw new Error('Illegal content in < super tag.'); - } - - if (Hogan.tags[token.tag] <= Hogan.tags['$'] || isOpener(token, customTags)) { - stack.push(token); - token.nodes = buildTree(tokens, token.tag, stack, customTags); - } else if (token.tag == '/') { - if (stack.length === 0) { - throw new Error('Closing tag without opener: /' + token.n); - } - opener = stack.pop(); - if (token.n != opener.n && !isCloser(token.n, opener.n, customTags)) { - throw new Error('Nesting error: ' + opener.n + ' vs. ' + token.n); - } - opener.end = token.i; - return instructions; - } else if (token.tag == '\n') { - token.last = (tokens.length == 0) || (tokens[0].tag == '\n'); - } - - instructions.push(token); - } - - if (stack.length > 0) { - throw new Error('missing closing tag: ' + stack.pop().n); - } - - return instructions; - } - - function isOpener(token, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].o == token.n) { - token.tag = '#'; - return true; - } - } - } - - function isCloser(close, open, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].c == close && tags[i].o == open) { - return true; - } - } - } - - function stringifySubstitutions(obj) { - var items = []; - for (var key in obj) { - items.push('"' + esc(key) + '": function(c,p,t,i) {' + obj[key] + '}'); - } - return "{ " + items.join(",") + " }"; - } - - function stringifyPartials(codeObj) { - var partials = []; - for (var key in codeObj.partials) { - partials.push('"' + esc(key) + '":{name:"' + esc(codeObj.partials[key].name) + '", ' + stringifyPartials(codeObj.partials[key]) + "}"); - } - return "partials: {" + partials.join(",") + "}, subs: " + stringifySubstitutions(codeObj.subs); - } - - Hogan.stringify = function(codeObj, text, options) { - return "{code: function (c,p,i) { " + Hogan.wrapMain(codeObj.code) + " }," + stringifyPartials(codeObj) + "}"; - } - - var serialNo = 0; - Hogan.generate = function(tree, text, options) { - serialNo = 0; - var context = { code: '', subs: {}, partials: {} }; - Hogan.walk(tree, context); - - if (options.asString) { - return this.stringify(context, text, options); - } - - return this.makeTemplate(context, text, options); - } - - Hogan.wrapMain = function(code) { - return 'var t=this;t.b(i=i||"");' + code + 'return t.fl();'; - } - - Hogan.template = Hogan.Template; - - Hogan.makeTemplate = function(codeObj, text, options) { - var template = this.makePartials(codeObj); - template.code = new Function('c', 'p', 'i', this.wrapMain(codeObj.code)); - return new this.template(template, text, this, options); - } - - Hogan.makePartials = function(codeObj) { - var key, template = {subs: {}, partials: codeObj.partials, name: codeObj.name}; - for (key in template.partials) { - template.partials[key] = this.makePartials(template.partials[key]); - } - for (key in codeObj.subs) { - template.subs[key] = new Function('c', 'p', 't', 'i', codeObj.subs[key]); - } - return template; - } - - function esc(s) { - return s.replace(rSlash, '\\\\') - .replace(rQuot, '\\\"') - .replace(rNewline, '\\n') - .replace(rCr, '\\r') - .replace(rLineSep, '\\u2028') - .replace(rParagraphSep, '\\u2029'); - } - - function chooseMethod(s) { - return (~s.indexOf('.')) ? 'd' : 'f'; - } - - function createPartial(node, context) { - var prefix = "<" + (context.prefix || ""); - var sym = prefix + node.n + serialNo++; - context.partials[sym] = {name: node.n, partials: {}}; - context.code += 't.b(t.rp("' + esc(sym) + '",c,p,"' + (node.indent || '') + '"));'; - return sym; - } - - Hogan.codegen = { - '#': function(node, context) { - context.code += 'if(t.s(t.' + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,1),' + - 'c,p,0,' + node.i + ',' + node.end + ',"' + node.otag + " " + node.ctag + '")){' + - 't.rs(c,p,' + 'function(c,p,t){'; - Hogan.walk(node.nodes, context); - context.code += '});c.pop();}'; - }, - - '^': function(node, context) { - context.code += 'if(!t.s(t.' + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,1),c,p,1,0,0,"")){'; - Hogan.walk(node.nodes, context); - context.code += '};'; - }, - - '>': createPartial, - '<': function(node, context) { - var ctx = {partials: {}, code: '', subs: {}, inPartial: true}; - Hogan.walk(node.nodes, ctx); - var template = context.partials[createPartial(node, context)]; - template.subs = ctx.subs; - template.partials = ctx.partials; - }, - - '$': function(node, context) { - var ctx = {subs: {}, code: '', partials: context.partials, prefix: node.n}; - Hogan.walk(node.nodes, ctx); - context.subs[node.n] = ctx.code; - if (!context.inPartial) { - context.code += 't.sub("' + esc(node.n) + '",c,p,i);'; - } - }, - - '\n': function(node, context) { - context.code += write('"\\n"' + (node.last ? '' : ' + i')); - }, - - '_v': function(node, context) { - context.code += 't.b(t.v(t.' + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,0)));'; - }, - - '_t': function(node, context) { - context.code += write('"' + esc(node.text) + '"'); - }, - - '{': tripleStache, - - '&': tripleStache - } - - function tripleStache(node, context) { - context.code += 't.b(t.t(t.' + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,0)));'; - } - - function write(s) { - return 't.b(' + s + ');'; - } - - Hogan.walk = function(nodelist, context) { - var func; - for (var i = 0, l = nodelist.length; i < l; i++) { - func = Hogan.codegen[nodelist[i].tag]; - func && func(nodelist[i], context); - } - return context; - } - - Hogan.parse = function(tokens, text, options) { - options = options || {}; - return buildTree(tokens, '', [], options.sectionTags || []); - } - - Hogan.cache = {}; - - Hogan.cacheKey = function(text, options) { - return [text, !!options.asString, !!options.disableLambda, options.delimiters, !!options.modelGet].join('||'); - } - - Hogan.compile = function(text, options) { - options = options || {}; - var key = Hogan.cacheKey(text, options); - var template = this.cache[key]; - - if (template) { - var partials = template.partials; - for (var name in partials) { - delete partials[name].instance; - } - return template; - } - - template = this.generate(this.parse(this.scan(text, options.delimiters), text, options), text, options); - return this.cache[key] = template; - } -})(typeof exports !== 'undefined' ? exports : Hogan); - - -var Mustache = (function (Hogan) { - - // Mustache.js has non-spec partial context behavior - function mustachePartial(name, context, partials, indent) { - var partialScope = this.f(name, context, partials, 0); - var cx = context; - if (partialScope) { - cx = cx.concat(partialScope); - } - - return Hogan.Template.prototype.rp.call(this, name, cx, partials, indent); - } - - var HoganTemplateWrapper = function(renderFunc, text, compiler){ - this.rp = mustachePartial; - Hogan.Template.call(this, renderFunc, text, compiler); - }; - HoganTemplateWrapper.prototype = Hogan.Template.prototype; - - // Add a wrapper for Hogan's generate method. Mustache and Hogan keep - // separate caches, and Mustache returns wrapped templates. - var wrapper; - var HoganWrapper = function(){ - this.cache = {}; - this.generate = function(code, text, options) { - return new HoganTemplateWrapper(new Function('c', 'p', 'i', code), text, wrapper); - } - }; - HoganWrapper.prototype = Hogan; - wrapper = new HoganWrapper(); - - return { - to_html: function(text, data, partials, sendFun) { - var template = wrapper.compile(text); - var result = template.render(data, partials); - if (!sendFun) { - return result; - } - - sendFun(result); - } - } - -})(Hogan); diff --git a/docs/src/less/components/buttons.less b/docs/src/less/components/buttons.less index 68c1f5d3..1401cd01 100644 --- a/docs/src/less/components/buttons.less +++ b/docs/src/less/components/buttons.less @@ -67,6 +67,10 @@ nav { box-shadow: inset 0 1px 1px rgba(0,0,0, .2); position: relative; z-index: 1; + + .icon { + color: inherit; + } } @media (min-width: 560px) { @@ -74,7 +78,7 @@ nav { } } -// Shared +// Shared .btn, .btn-count { display: inline-block; @@ -84,7 +88,7 @@ nav { user-select: none; } -// Buttons +// Buttons .btn { padding: (@padding-base / 2) @padding-base; background: @body-background; @@ -92,14 +96,23 @@ nav { box-shadow: inset 0 1px 0 #fff, 0 1px 1px rgba(0,0,0, .05); text-shadow: 0 1px 1px #fff; color: @gray; + transition: background .3s ease, border .3s ease, color .3s ease; &:hover, &:focus { - background-color: #fff; - border-color: darken(@gray-light, 5%); - color: @link-color; + border-color: darken(@gray-light, 8%); + color: @gray; outline: 0; } + &-youtube .icon { + color: @color-youtube; + } + &-vimeo .icon { + color: @color-vimeo; + } + &-twitter .icon { + color: @color-twitter; + } } .btn-primary { background-image: linear-gradient(@link-color, darken(@link-color, 3%)); @@ -108,7 +121,7 @@ nav { box-shadow: 0 1px 1px rgba(0,0,0, .15); text-shadow: 0 1px 1px rgba(0,0,0, .1); color: #fff; - + &:hover, &:focus { color: #fff; @@ -123,8 +136,8 @@ nav { // Count bubble .btn-count { position: relative; - margin-left: 6px; - padding: ((@padding-base / 2) - 1px); + margin-left: (@padding-base / 2); + padding: (@padding-base / 2) (@padding-base * .75); background: #fff; border: 1px solid @gray-light; @@ -143,4 +156,4 @@ nav { border-width: 1px 0 0 1px; transform: rotate(-45deg) translate(-50%, -50%); } -}
\ No newline at end of file +} diff --git a/docs/src/less/components/icons.less b/docs/src/less/components/icons.less new file mode 100644 index 00000000..7bcc792e --- /dev/null +++ b/docs/src/less/components/icons.less @@ -0,0 +1,22 @@ +// ========================================================================== +// Icons +// ========================================================================== + +// Base size icon styles +.icon { + fill: currentColor; + width: @icon-size; + height: @icon-size; + vertical-align: -3px; +} + +// Within elements +a svg, +button svg, +label svg { + pointer-events: none; +} +a .icon, +.btn .icon { + margin-right: (@padding-base / 2); +} diff --git a/docs/src/less/components/type.less b/docs/src/less/components/type.less index 97652342..8fc200e2 100644 --- a/docs/src/less/components/type.less +++ b/docs/src/less/components/type.less @@ -26,17 +26,24 @@ small { padding: 0 (@padding-base / 2); .font-size(14); } +ul +li { + list-style: none; + margin: 0; + padding: 0; +} // Links a { text-decoration: none; color: @link-color; - border-bottom: 1px solid currentColor; - transition: background .3s ease, color .3s ease; + border-bottom: 1px dotted currentColor; + transition: background .3s ease, color .3s ease, border .3s ease; &:hover, &:focus { color: @gray-dark; + border-bottom-color: rgba(0,0,0,0); } &:focus { .tab-focus(); @@ -44,4 +51,11 @@ a { &.logo { border: 0; } -}
\ No newline at end of file +} + +.color-vimeo { + color: @color-vimeo; +} +.color-youtube { + color: @color-youtube; +} diff --git a/docs/src/less/docs.less b/docs/src/less/docs.less index cea3a2af..965dcba1 100644 --- a/docs/src/less/docs.less +++ b/docs/src/less/docs.less @@ -14,21 +14,14 @@ // Animation @import "lib/animation.less"; -// Base layout -@import "components/base.less"; - // Type @import "lib/fontface.less"; @import "components/type.less"; -// Buttons +// Components +@import "components/base.less"; +@import "components/icons.less"; @import "components/buttons.less"; - -// Panels @import "components/panels.less"; - -// Error @import "components/error.less"; - -// Examples -@import "components/examples.less";
\ No newline at end of file +@import "components/examples.less"; diff --git a/docs/src/less/variables.less b/docs/src/less/variables.less index 4ea34d84..097aa1f2 100644 --- a/docs/src/less/variables.less +++ b/docs/src/less/variables.less @@ -10,6 +10,11 @@ @gray-lighter: #dbe3e8; @off-white: #f2f5f7; +// Brands +@color-twitter: #4BAAF4; +@color-youtube: #cc181e; +@color-vimeo: #19b7ed; + // Base @body-background: @off-white; @@ -18,6 +23,9 @@ @padding-base: 20px; @arrow-size: 8px; +// Icons +@icon-size: 18px; + // Breakpoints @screen-sm: 480px; @screen-md: 768px; @@ -27,4 +35,4 @@ // Examples @example-width-audio: 520px; -@example-width-video: 1200px;
\ No newline at end of file +@example-width-video: 1200px; diff --git a/docs/src/templates/controls.html b/docs/src/templates/controls.html deleted file mode 100644 index fb82cf0d..00000000 --- a/docs/src/templates/controls.html +++ /dev/null @@ -1,61 +0,0 @@ -<div class="player-controls"> - <div class="player-progress"> - <label for="seek{id}" class="sr-only">Seek</label> - <input id="seek{id}" class="player-progress-seek" type="range" min="0" max="100" step="0.5" value="0" data-player="seek"> - <progress class="player-progress-played" max="100" value="0"> - <span>0</span>% played - </progress> - <progress class="player-progress-buffer" max="100" value="0"> - <span>0</span>% buffered - </progress> - </div> - <span class="player-controls-left"> - <button type="button" data-player="restart"> - <svg><use xlink:href="#icon-restart"></use></svg> - <span class="sr-only">Restart</span> - </button> - <button type="button" data-player="rewind"> - <svg><use xlink:href="#icon-rewind"></use></svg> - <span class="sr-only">Rewind {seektime} secs</span> - </button> - <button type="button" data-player="play"> - <svg><use xlink:href="#icon-play"></use></svg> - <span class="sr-only">Play</span> - </button> - <button type="button" data-player="pause"> - <svg><use xlink:href="#icon-pause"></use></svg> - <span class="sr-only">Pause</span> - </button> - <button type="button" data-player="fast-forward"> - <svg><use xlink:href="#icon-fast-forward"></use></svg> - <span class="sr-only">Forward {seektime} secs</span> - </button> - <span class="player-time"> - <span class="sr-only">Current time</span> - <span class="player-current-time">00:00</span> - </span> - <span class="player-time"> - <span class="sr-only">Duration</span> - <span class="player-duration">00:00</span> - </span> - </span> - <span class="player-controls-right"> - <button type="button" data-player="mute"> - <svg class="icon-muted"><use xlink:href="#icon-muted"></use></svg> - <svg><use xlink:href="#icon-volume"></use></svg> - <span class="sr-only">Toggle Mute</span> - </button> - <label for="volume{id}" class="sr-only">Volume</label> - <input id="volume{id}" class="player-volume" type="range" min="0" max="10" step="0.5" value="0" data-player="volume"> - <button type="button" data-player="captions"> - <svg class="icon-captions-on"><use xlink:href="#icon-captions-on"></use></svg> - <svg><use xlink:href="#icon-captions-off"></use></svg> - <span class="sr-only">Toggle Captions</span> - </button> - <button type="button" data-player="fullscreen"> - <svg class="icon-exit-fullscreen"><use xlink:href="#icon-exit-fullscreen"></use></svg> - <svg><use xlink:href="#icon-enter-fullscreen"></use></svg> - <span class="sr-only">Toggle Fullscreen</span> - </button> - </span> -</div>
\ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 5b354740..865f2a56 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -17,7 +17,6 @@ var fs = require("fs"), prefix = require("gulp-autoprefixer"), svgstore = require("gulp-svgstore"), svgmin = require("gulp-svgmin"), - hogan = require("gulp-hogan-compile"), rename = require("gulp-rename"), s3 = require("gulp-s3"), gzip = require("gulp-gzip"), @@ -42,8 +41,7 @@ paths = { // Source paths src: { less: path.join(root, "docs/src/less/**/*"), - js: path.join(root, "docs/src/js/**/*"), - templates: path.join(root, "docs/src/templates/*.html") + js: path.join(root, "docs/src/js/**/*") }, // Output paths output: path.join(root, "docs/dist/"), @@ -54,7 +52,7 @@ paths = { }, // Task arrays -tasks = { +tasks = { less: [], sass: [], js: [] @@ -93,7 +91,7 @@ var build = { }, less: function(files, bundle) { for (var key in files) { - (function (key) { + (function (key) { var name = "less-" + key; tasks.less.push(name); @@ -112,7 +110,7 @@ var build = { }, sass: function(files, bundle) { for (var key in files) { - (function (key) { + (function (key) { var name = "sass-" + key; tasks.sass.push(name); @@ -142,20 +140,6 @@ var build = { .pipe(svgstore()) .pipe(gulp.dest(paths.plyr.output)); }); - }, - templates: function() { - // Build templates - gulp.task("templates", function () { - return gulp - .src(paths.docs.src.templates) - .pipe(hogan("templates.js", { - wrapper: false, - templateName: function (file) { - return path.basename(file.relative.replace(/\\/g, "-"), path.extname(file.relative)); - } - })) - .pipe(gulp.dest(paths.docs.output)); - }); } }; @@ -166,13 +150,12 @@ build.sass(bundles.plyr.sass, "plyr"); build.sprite(); // Docs files -build.templates(); build.less(bundles.docs.less, "docs"); build.js(bundles.docs.js, "docs"); -// Build all JS (inc. templates) +// Build all JS gulp.task("js", function(){ - run("templates", tasks.js); + run(tasks.js); }); // Build SASS (for testing, default is LESS) @@ -190,12 +173,11 @@ gulp.task("watch", function () { // Docs gulp.watch(paths.docs.src.js, tasks.js); gulp.watch(paths.docs.src.less, tasks.less); - gulp.watch(paths.docs.src.templates, ["js"]); }); // Default gulp task gulp.task("default", function(){ - run("templates", tasks.js, tasks.less, "sprite", "watch"); + run(tasks.js, tasks.less, "sprite", "watch"); }); // Publish a version to CDN and docs @@ -231,7 +213,7 @@ if("cdn" in aws) { gulp.task("cdn", function () { console.log("Uploading " + version + " to " + aws.cdn.bucket); - // Upload to CDN + // Upload to CDN gulp.src(paths.upload) .pipe(size({ showFiles: true, @@ -279,7 +261,7 @@ gulp.task("open", function () { })); }); -// Do everything +// Do everything gulp.task("publish", function () { - run("templates", tasks.js, tasks.less, "sprite", "cdn", "docs"); -});
\ No newline at end of file + run(tasks.js, tasks.less, "sprite", "cdn", "docs"); +}); diff --git a/package.json b/package.json index 65ca3643..db78a333 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plyr", - "version": "1.3.6", + "version": "1.3.7", "description": "A simple HTML5 media player using custom controls", "homepage": "http://plyr.io", "main": "gulpfile.js", @@ -10,7 +10,6 @@ "gulp-autoprefixer": "^3.1.0", "gulp-concat": "^2.3.3", "gulp-gzip": "^1.0.0", - "gulp-hogan-compile": "^0.4.1", "gulp-less": "^3.0.5", "gulp-minify-css": "^1.2.1", "gulp-open": "^1.0.0", @@ -40,7 +40,7 @@ If you have any cool ideas or features, please let me know by [creating an issue Check `docs/index.html` and `docs/dist/docs.js` for an example setup. -**Heads up:** the example `index.html` file needs to be served from a webserver (such as Apache, Nginx, IIS or similar) unless you change the file sources to include http or https. e.g. change `//cdn.plyr.io/1.3.6/plyr.js` to `https://cdn.plyr.io/1.3.6/plyr.js` +**Heads up:** the example `index.html` file needs to be served from a webserver (such as Apache, Nginx, IIS or similar) unless you change the file sources to include http or https. e.g. change `//cdn.plyr.io/1.3.7/plyr.js` to `https://cdn.plyr.io/1.3.7/plyr.js` ### Bower If bower is your thang, you can grab Plyr using: @@ -60,11 +60,11 @@ More info is on [npm](https://www.npmjs.com/package/ember-cli-plyr) and [GitHub] If you want to use our CDN, you can use the following: ```html -<link rel="stylesheet" href="https://cdn.plyr.io/1.3.6/plyr.css"> -<script src="https://cdn.plyr.io/1.3.6/plyr.js"></script> +<link rel="stylesheet" href="https://cdn.plyr.io/1.3.7/plyr.css"> +<script src="https://cdn.plyr.io/1.3.7/plyr.js"></script> ``` -You can also access the `sprite.svg` file at `https://cdn.plyr.io/1.3.6/sprite.svg`. +You can also access the `sprite.svg` file at `https://cdn.plyr.io/1.3.7/sprite.svg`. ### CSS If you want to use the default css, add the `plyr.css` file from `/dist` into your head, or even better use `plyr.less` or `plyr.sass` file included in `/src` in your build to save a request. |