1 line
6.0 KiB
JavaScript
1 line
6.0 KiB
JavaScript
"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 o,i=arguments.length;for(o=0;o<i;o++)t=arguments[o],e.call(this,t)}};e("add"),e("remove")}if(t.classList.toggle("c3",!1),t.classList.contains("c3")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return 1 in arguments&&!this.contains(t)==!e?e:o.call(this,t)}}t=null}():function(t){"use strict";if("Element"in t){var e=t.Element.prototype,o=Object,i=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},n=Array.prototype.indexOf||function(t){for(var e=0,o=this.length;e<o;e++)if(e in this&&this[e]===t)return e;return-1},r=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},s=function(t,e){if(""===e)throw new r("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new r("INVALID_CHARACTER_ERR","String contains an invalid character");return n.call(t,e)},a=function(t){for(var e=i.call(t.getAttribute("class")||""),o=e?e.split(/\s+/):[],n=0,r=o.length;n<r;n++)this.push(o[n]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},c=a.prototype=[],l=function(){return new a(this)};if(r.prototype=Error.prototype,c.item=function(t){return this[t]||null},c.contains=function(t){return t+="",-1!==s(this,t)},c.add=function(){var t,e=arguments,o=0,i=e.length,n=!1;do{t=e[o]+"",-1===s(this,t)&&(this.push(t),n=!0)}while(++o<i);n&&this._updateClassName()},c.remove=function(){var t,e,o=arguments,i=0,n=o.length,r=!1;do{for(t=o[i]+"",e=s(this,t);-1!==e;)this.splice(e,1),r=!0,e=s(this,t)}while(++i<n);r&&this._updateClassName()},c.toggle=function(t,e){t+="";var o=this.contains(t),i=o?!0!==e&&"remove":!1!==e&&"add";return i&&this[i](t),!0===e||!1===e?e:!o},c.toString=function(){return this.join(" ")},o.defineProperty){var u={get:l,enumerable:!0,configurable:!0};try{o.defineProperty(e,"classList",u)}catch(t){-2146823252===t.number&&(u.enumerable=!1,o.defineProperty(e,"classList",u))}}else o.prototype.__defineGetter__&&e.__defineGetter__("classList",l)}}(self)),document.addEventListener("focusout",function(t){t.target.classList.remove("tab-focus")}),document.addEventListener("keydown",function(t){9===t.keyCode&&window.setTimeout(function(){document.activeElement.classList.add("tab-focus")},0)}),window.loadSprite=function(t,e){function o(t,e){t.innerHTML=e,i.insertBefore(t,i.childNodes[0])}if("string"==typeof t){var i=document.body,n="string"==typeof e,r=function(){if(!n)return!1;try{return localStorage.setItem("___test","___test"),localStorage.removeItem("___test"),!0}catch(t){return!1}}();if(!n||0===document.querySelectorAll("#"+e).length){var s=document.createElement("div");if(s.setAttribute("hidden",""),n&&s.setAttribute("id",e),r){var a=localStorage.getItem("cache-"+e);if(null!==a){var c=JSON.parse(a);o(s,c.content)}}var l=new XMLHttpRequest;if(!("withCredentials"in l))return;l.open("GET",t,!0),l.onload=function(){r&&localStorage.setItem("cache-"+e,JSON.stringify({content:l.responseText})),o(s,l.responseText)},l.send()}}},function(){function t(t,e,o){t&&t.classList[o?"add":"remove"](e)}function e(e,s){if(e in n&&(s||e!==r)&&(r.length||e!==n.video)){switch(e){case n.video:o.source({type:"video",title:"View From A Blue Moon",sources:[{src:"https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.mp4",type:"video/mp4"}],poster:"https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg",tracks:[{kind:"captions",label:"English",srclang:"en",src:"https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.en.vtt",default:!0},{kind:"captions",label:"French",srclang:"fr",src:"https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.fr.vtt"}]});break;case n.audio:o.source({type:"audio",title:"Kishi Bashi – “It All Began With A Burst”",sources:[{src:"https://cdn.plyr.io/static/demo/Kishi_Bashi_-_It_All_Began_With_a_Burst.mp3",type:"audio/mp3"},{src:"https://cdn.plyr.io/static/demo/Kishi_Bashi_-_It_All_Began_With_a_Burst.ogg",type:"audio/ogg"}]});break;case n.youtube:o.source({type:"video",title:"View From A Blue Moon",sources:[{src:"https://www.youtube.com/watch?v=bTqVqk7FSmY",type:"youtube"}]});break;case n.vimeo:o.source({type:"video",title:"View From A Blue Moon",sources:[{src:"https://vimeo.com/76979871",type:"vimeo"}]})}r=e;for(var a=i.length-1;a>=0;a--)t(i[a].parentElement,"active",!1);t(document.querySelector('[data-source="'+e+'"]'),"active",!0),[].forEach.call(document.querySelectorAll(".plyr__cite"),function(t){t.setAttribute("hidden","")}),document.querySelector(".plyr__cite--"+e).removeAttribute("hidden")}}window.shr&&window.shr.setup({count:{classname:"button__count"}});var o=new Plyr("#player",{debug:!0,title:"View From A Blue Moon",iconUrl:"../dist/plyr.svg",tooltips:{controls:!0},captions:{defaultActive:!0},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","fullscreen","pip","airplay"]});window.player=o,window.loadSprite("dist/demo.svg","demo-sprite");var i=document.querySelectorAll("[data-source]"),n={video:"video",audio:"audio",youtube:"youtube",vimeo:"vimeo"},r=window.location.hash.replace("#",""),s=window.history&&window.history.pushState;if([].forEach.call(i,function(t){t.addEventListener("click",function(){var t=this.getAttribute("data-source");e(t),s&&history.pushState({type:t},"","#"+t)})}),window.addEventListener("popstate",function(t){t.state&&"type"in t.state&&e(t.state.type)}),s){var a=!r.length;a&&(r=n.video),r in n&&history.replaceState({type:r},"",a?"":"#"+r),r!==n.video&&e(r,!0)}}(),"plyr.io"===window.location.host&&(!function(t,e,o,i,n,r,s){t.GoogleAnalyticsObject=n,t[n]=t[n]||function(){(t[n].q=t[n].q||[]).push(arguments)},t[n].l=1*new Date,r=e.createElement(o),s=e.getElementsByTagName(o)[0],r.async=1,r.src="//www.google-analytics.com/analytics.js",s.parentNode.insertBefore(r,s)}(window,document,"script",0,"ga"),window.ga("create","UA-40881672-11","auto"),window.ga("send","pageview")); |