import{r as t,c as s,h as i}from"./p-78e3ebb9.js";const e="audio{max-width:100%;outline:none}";const o=class{constructor(i){t(this,i);this.onError=s(this,"error",7);this.onPlay=s(this,"play",7);this.onPause=s(this,"pause",7);this.onTimeUpdate=s(this,"timeupdate",7);this.onEnded=s(this,"ended",7);this.src=undefined;this.controls=true;this.autoplay=false;this.loop=false;this.muted=false;this.nativeProps={}}bindevent(){this.audio.addEventListener("timeupdate",(t=>{this.onTimeUpdate.emit({duration:t.srcElement.duration,currentTime:t.srcElement.duration})}));this.audio.addEventListener("ended",(()=>{this.onEnded.emit()}));this.audio.addEventListener("play",(()=>{this.onPlay.emit()}));this.audio.addEventListener("pause",(t=>{this.onPause.emit(t)}));this.audio.addEventListener("error",(t=>{var s;this.onError.emit({errMsg:(s=t.srcElement.error)===null||s===void 0?void 0:s.code})}))}componentDidLoad(){this.bindevent()}render(){const{src:t,controls:s,autoplay:e,loop:o,muted:h,nativeProps:r}=this;return i("audio",Object.assign({src:t,controls:s,autoplay:e,loop:o,muted:h,ref:t=>{this.audio=t}},r))}};o.style=e;export{o as taro_audio_core};
//# sourceMappingURL=p-91f8cd40.entry.js.map