(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-API-inner-audio-inner-audio"],{"5b80":function(n,i,t){"use strict";t.r(i);var e=t("bd2e"),a=t("e5ed");for(var o in a)"default"!==o&&function(n){t.d(i,n,(function(){return a[n]}))}(o);t("78c6");var u,s=t("f0c5"),r=Object(s["a"])(a["default"],e["b"],e["c"],!1,null,"08966f64",null,!1,e["a"],u);i["default"]=r.exports},"78c6":function(n,i,t){"use strict";var e=t("d5ee"),a=t.n(e);a.a},"825f":function(n,i,t){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var e="https://img-cdn-qiniu.dcloud.net.cn/uniapp/audio/music.mp3",a={data:function(){return{title:"innerAudioContext",isPlaying:!1,isPlayEnd:!1,currentTime:0,duration:100}},computed:{position:function(){return this.isPlayEnd?0:this.currentTime},playImage:function(){return this.isPlaying?"/static/pause.png":"/static/play.png"}},onLoad:function(){this._isChanging=!1,this._audioContext=null,this.createAudio()},onUnload:function(){null!=this._audioContext&&this.isPlaying&&this.stop()},methods:{createAudio:function(){var n=this,i=this._audioContext=uni.createInnerAudioContext();return i.autoplay=!1,i.src=e,i.onPlay((function(){console.log("开始播放")})),i.onTimeUpdate((function(t){!0!==n._isChanging&&(n.currentTime=i.currentTime||0,n.duration=i.duration||0)})),i.onEnded((function(){n.currentTime=0,n.isPlaying=!1,n.isPlayEnd=!0})),i.onError((function(i){n.isPlaying=!1,console.log(i.errMsg),console.log(i.errCode)})),i},onchanging:function(){this._isChanging=!0},onchange:function(n){console.log(n.detail.value),console.log(typeof n.detail.value),this._audioContext.seek(n.detail.value),this._isChanging=!1},play:function(){this.isPlaying?this.pause():(this.isPlaying=!0,this._audioContext.play(),this.isPlayEnd=!1)},pause:function(){this._audioContext.pause(),this.isPlaying=!1},stop:function(){this._audioContext.stop(),this.isPlaying=!1}}};i.default=a},"8f62":function(n,i,t){var e=t("24fb");i=e(!1),i.push([n.i,".play-time-area[data-v-08966f64]{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;margin-top:20px}.duration[data-v-08966f64]{margin-left:auto}.play-button-area[data-v-08966f64]{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;margin-top:50px}.icon-play[data-v-08966f64]{width:60px;height:60px}",""]),n.exports=i},bd2e:function(n,i,t){"use strict";var e,a=function(){var n=this,i=n.$createElement,t=n._self._c||i;return t("v-uni-view",{staticClass:"uni-padding-wrap"},[t("page-head",{attrs:{title:"audio"}}),t("v-uni-view",{staticClass:"uni-common-mt"},[t("v-uni-slider",{attrs:{value:n.position,min:0,max:n.duration},on:{changing:function(i){arguments[0]=i=n.$handleEvent(i),n.onchanging.apply(void 0,arguments)},change:function(i){arguments[0]=i=n.$handleEvent(i),n.onchange.apply(void 0,arguments)}}})],1),t("v-uni-view",{staticClass:"play-button-area"},[t("v-uni-image",{staticClass:"icon-play",attrs:{src:n.playImage},on:{click:function(i){arguments[0]=i=n.$handleEvent(i),n.play.apply(void 0,arguments)}}})],1)],1)},o=[];t.d(i,"b",(function(){return a})),t.d(i,"c",(function(){return o})),t.d(i,"a",(function(){return e}))},d5ee:function(n,i,t){var e=t("8f62");"string"===typeof e&&(e=[[n.i,e,""]]),e.locals&&(n.exports=e.locals);var a=t("4f06").default;a("426d51c0",e,!0,{sourceMap:!1,shadowMode:!1})},e5ed:function(n,i,t){"use strict";t.r(i);var e=t("825f"),a=t.n(e);for(var o in e)"default"!==o&&function(n){t.d(i,n,(function(){return e[n]}))}(o);i["default"]=a.a}}]);