1 line
5.8 KiB
JavaScript
1 line
5.8 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 i,o=arguments.length;for(i=0;i<o;i++)t=arguments[i],e.call(this,t)}};e("add"),e("remove")}if(t.classList.toggle("c3",!1),t.classList.contains("c3")){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return 1 in arguments&&!this.contains(t)==!e?e:i.call(this,t)}}t=null}():!function(t){"use strict";if("Element"in t){var e="classList",i="prototype",o=t.Element[i],n=Object,r=String[i].trim||function(){return this.replace(/^\s+|\s+$/g,"")},s=Array[i].indexOf||function(t){for(var e=0,i=this.length;e<i;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 s.call(t,e)},l=function(t){for(var e=r.call(t.getAttribute("class")||""),i=e?e.split(/\s+/):[],o=0,n=i.length;o<n;o++)this.push(i[o]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},u=l[i]=[],d=function(){return new l(this)};if(a[i]=Error[i],u.item=function(t){return this[t]||null},u.contains=function(t){return t+="",c(this,t)!==-1},u.add=function(){var t,e=arguments,i=0,o=e.length,n=!1;do t=e[i]+"",c(this,t)===-1&&(this.push(t),n=!0);while(++i<o);n&&this._updateClassName()},u.remove=function(){var t,e,i=arguments,o=0,n=i.length,r=!1;do for(t=i[o]+"",e=c(this,t);e!==-1;)this.splice(e,1),r=!0,e=c(this,t);while(++o<n);r&&this._updateClassName()},u.toggle=function(t,e){t+="";var i=this.contains(t),o=i?e!==!0&&"remove":e!==!1&&"add";return o&&this[o](t),e===!0||e===!1?e:!i},u.toString=function(){return this.join(" ")},n.defineProperty){var p={get:d,enumerable:!0,configurable:!0};try{n.defineProperty(o,e,p)}catch(h){h.number===-2146823252&&(p.enumerable=!1,n.defineProperty(o,e,p))}}else n[i].__defineGetter__&&o.__defineGetter__(e,d)}}(self)),function(){window.loadSprite=function(t,e){function i(t,e){t.innerHTML=e,o.insertBefore(t,o.childNodes[0])}if("string"==typeof t){var o=document.body,n="cache-",r="string"==typeof e,s=!1,a=function(){if(!r)return!1;var t="___test";try{return localStorage.setItem(t,t),localStorage.removeItem(t),!0}catch(e){return!1}}();if(!r||0===document.querySelectorAll("#"+e).length){var c=document.createElement("div");if(c.setAttribute("hidden",""),r&&c.setAttribute("id",e),a){var l=localStorage.getItem(n+e);if(s=null!==l){var u=JSON.parse(l);i(c,u.content)}}var d=new XMLHttpRequest;if(!("withCredentials"in d))return;d.open("GET",t,!0),d.onload=function(){a&&localStorage.setItem(n+e,JSON.stringify({content:d.responseText})),i(c,d.responseText)},d.send()}}}}(),function(){function t(t,e,i){if(t)if(t.classList)t.classList[i?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(/\s+/g," ").replace(" "+e+" ","");t.className=o+(i?" "+e:"")}}function e(e,s){if(e in n&&(s||e!==r)&&(r.length||e!==n.video)){switch(e){case n.video:i.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:i.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:i.source({type:"video",title:"View From A Blue Moon",sources:[{src:"https://www.youtube.com/watch?v=bTqVqk7FSmY",type:"youtube"}]});break;case n.vimeo:i.source({type:"video",title:"View From A Blue Moon",sources:[{src:"https://vimeo.com/76979871",type:"vimeo"}]})}r=e;for(var a=o.length-1;a>=0;a--)t(o[a].parentElement,"active",!1);t(document.querySelector('[data-source="'+e+'"]').parentElement,"active",!0),[].forEach.call(document.querySelectorAll(".plyr__cite"),function(t){t.setAttribute("hidden","")}),document.querySelector(".plyr__cite--"+e).removeAttribute("hidden")}}var i=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=i,window.loadSprite("dist/demo.svg","demo-sprite");var o=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(o,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,i,o,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(i),s=e.getElementsByTagName(i)[0],r.async=1,r.src=o,s.parentNode.insertBefore(r,s)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),window.ga("create","UA-40881672-11","auto"),window.ga("send","pageview")); |