import{r as registerInstance,c as createEvent,h}from"./index-c948674f.js";var indexCss="audio{max-width:100%;outline:none}";var Audio=function(){function t(t){registerInstance(this,t);this.onError=createEvent(this,"error",7);this.onPlay=createEvent(this,"play",7);this.onPause=createEvent(this,"pause",7);this.onTimeUpdate=createEvent(this,"timeupdate",7);this.onEnded=createEvent(this,"ended",7);this.src=undefined;this.controls=true;this.autoplay=false;this.loop=false;this.muted=false;this.nativeProps={}}t.prototype.bindevent=function(){var t=this;this.audio.addEventListener("timeupdate",(function(e){t.onTimeUpdate.emit({duration:e.srcElement.duration,currentTime:e.srcElement.duration})}));this.audio.addEventListener("ended",(function(){t.onEnded.emit()}));this.audio.addEventListener("play",(function(){t.onPlay.emit()}));this.audio.addEventListener("pause",(function(e){t.onPause.emit(e)}));this.audio.addEventListener("error",(function(e){var n;t.onError.emit({errMsg:(n=e.srcElement.error)===null||n===void 0?void 0:n.code})}))};t.prototype.componentDidLoad=function(){this.bindevent()};t.prototype.render=function(){var t=this;var e=this,n=e.src,i=e.controls,o=e.autoplay,r=e.loop,s=e.muted,a=e.nativeProps;return h("audio",Object.assign({src:n,controls:i,autoplay:o,loop:r,muted:s,ref:function(e){t.audio=e}},a))};return t}();Audio.style=indexCss;export{Audio as taro_audio_core};
//# sourceMappingURL=taro-audio-core.entry.js.map