-
Notifications
You must be signed in to change notification settings - Fork 0
/
gwdaudio_min.js
3 lines (3 loc) · 1.65 KB
/
gwdaudio_min.js
1
2
3
-function(){"use strict";var d=function(a){return"gwd-page"==a.tagName.toLowerCase()||"gwd-page"==a.getAttribute("is")},f=function(a){if(d(a))return a;for(;a&&9!=a.nodeType;)if((a=a.parentElement)&&d(a))return a;return null};document.registerElement&&document.registerElement("gwd-audio",{prototype:Object.create(HTMLAudioElement.prototype,{createdCallback:{value:function(){this.a=!1;this.hasAttribute("gwd-controls")&&this.setAttribute("controls","")},enumerable:!0},attachedCallback:{value:function(){if("function"==typeof this.gwdLoad&&"function"==typeof this.gwdIsLoaded&&!this.gwdIsLoaded()){var a=f(this),b=a&&"function"==typeof a.gwdIsLoaded;(!a||b&&a.gwdIsLoaded())&&this.gwdLoad()}this.autoplay&&this.paused&&this.play()},
enumerable:!0},attributeChangedCallback:{value:function(a){"sources"==a&&this.setSources_();"gwd-controls"==a&&(this.hasAttribute("gwd-controls")?this.setAttribute("controls",""):this.removeAttribute("controls"))},enumerable:!0},gwdLoad:{value:function(){this.setSources_();this.a=!0;var a;a=document.createEvent("Event");a.initEvent("ready",!0,!0);this.dispatchEvent(a)},enumerable:!0},gwdIsLoaded:{value:function(){return this.a},enumerable:!0},mute:{value:function(){this.muted=!this.muted},enumerable:!0},
replay:{value:function(){this.seek(0);this.play()},enumerable:!0},seek:{value:function(a){this.currentTime=a},enumerable:!0},setSources_:{value:function(){for(var a=this.getAttribute("sources"),a=a?a.split(","):[],b;b=this.firstChild;)this.removeChild(b);for(b=0;b<a.length;++b){var e=document.createElement("source"),g=e,c;c=a[b];c=c.trim();c=window.Enabler?Enabler.getUrl(c):c;g.src=c;this.appendChild(e)}},enumerable:!1}}),"extends":"audio"});}()