(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/diy-components/diy-audio"],{"06ff":function(t,i,a){"use strict";a.d(i,"b",(function(){return e})),a.d(i,"c",(function(){return o})),a.d(i,"a",(function(){}));var e=function(){var t=this.$createElement,i=(this._self._c,"style-2"!=this.value.type?this.$util.img(this.value.imageUrl):null);this.$mp.data=Object.assign({},{$root:{g0:i}})},o=[]},6982:function(t,i,a){"use strict";var e=a("eade"),o=a.n(e);o.a},abc0:function(t,i,a){"use strict";a.r(i);var e=a("b482"),o=a.n(e);for(var u in e)["default"].indexOf(u)<0&&function(t){a.d(i,t,(function(){return e[t]}))}(u);i["default"]=o.a},b482:function(t,i,a){"use strict";(function(t){Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var a={name:"diy-audio",props:{value:{type:Object}},data:function(){return{audiosObj:[],audios:{},audioContext:null,audiotime:"00:01",audiowidth:0,status:0}},created:function(){this.audios[this.value.id]={audiotime:"00:01",audiowidth:0}},watch:{componentRefresh:function(t){}},computed:{videoWarpCss:function(){var t="";return"round"==this.value.componentAngle&&(t+="border-top-left-radius:"+2*this.value.topAroundRadius+"rpx;",t+="border-top-right-radius:"+2*this.value.topAroundRadius+"rpx;",t+="border-bottom-left-radius:"+2*this.value.bottomAroundRadius+"rpx;",t+="border-bottom-right-radius:"+2*this.value.bottomAroundRadius+"rpx;"),t}},methods:{play:function(){var i=this.value.id,a=this.audiosObj[i]||!1;this.$util.img(this.value.audioUrl);if(!a){a=t.createInnerAudioContext("audio_"+i);var e=this.audiosObj;e[i]=a,this.audiosObj=e;var o=t.getStorageSync("audio_list")?t.getStorageSync("audio_list"):[];0==o.includes(i)&&(o.push(i),t.setStorageSync("audio_list",o))}console.log(t.getStorageSync("audio_list"));var u=this;a.onPlay((function(){var t=setInterval((function(){var e=a.currentTime/a.duration*100+"%",o=Math.floor(Math.ceil(a.currentTime)/60),s=(Math.ceil(a.currentTime)%60/100).toFixed(2).slice(-2),n=Math.ceil(a.currentTime);o<10&&(o="0"+o);var d=o+":"+s,r=u.audios;r[i].audiowidth=e,r[i].Time=t,r[i].audiotime=d,r[i].seconds=n,u.audios=r}),1e3)}));var s=u.$util.img(u.value.audioUrl),n=u.audios[u.value.id].seconds||0,d=u.audios;d[i]||(d[i]={}),a.paused&&0==n?(a.src=s,a.play(),a.loop=!0,d[i].status=!0,u.status=!0,u.pauseOther(i)):a.paused&&n>0?(a.play(),a.seek(n),d[i].status=!0,u.status=!0,u.pauseOther(i)):(a.pause(),d[i].status=!1,u.status=!1),u.audios=d,console.log(u.audios)},pauseOther:function(t){this.audiosObj[this.value.id],this.value.id;var i=document.getElementsByTagName("audio");function a(){var t=this;[].forEach.call(i,(function(i){i!==t&&i.pause()}))}[].forEach.call(i,(function(t){t.addEventListener("play",a.bind(t))}))},play_bak:function(){var i=this,a=this.value.id;this.audioContext=t.createInnerAudioContext("audio_"+this.value.id),this.audioContext.src=this.$util.img(this.value.audioUrl);var e=this;if(1==this.status)return this.audioContext.pause(),this.status=0,!1;this.audioContext.play(),this.status=1,this.audioContext.onCanplay((function(t){var i=setInterval((function(){var t=parseFloat(e.audioContext.currentTime)/parseFloat(e.audioContext.duration)*100+"%",o=Math.floor(Math.ceil(e.audioContext.currentTime)/60),u=(Math.ceil(e.audioContext.currentTime)%60/100).toFixed(2).slice(-2),s=Math.ceil(e.audioContext.currentTime);o<10&&(o="0"+o);var n=o+":"+u,d=e.audios;d[a].audiowidth=t,d[a].Time=i,d[a].audiotime=n,d[a].seconds=s,e.audios=d,console.log(e.audios[e.value.id].audiotime),e.audiotime=e.audios[e.value.id].audiotime,e.audiowidth=e.audios[e.value.id].audiowidth,console.log(t),e.lyg=t}),1e3)})),this.audioContext.onEnded((function(){console.log("播放结束"),i.status=0}))}}};i.default=a}).call(this,a("df3c")["default"])},eade:function(t,i,a){},f585:function(t,i,a){"use strict";a.r(i);var e=a("06ff"),o=a("abc0");for(var u in o)["default"].indexOf(u)<0&&function(t){a.d(i,t,(function(){return o[t]}))}(u);a("6982");var s=a("828b"),n=Object(s["a"])(o["default"],e["b"],e["c"],!1,null,"2b17e9e0",null,!1,e["a"],void 0);i["default"]=n.exports}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    'components/diy-components/diy-audio-create-component',
    {
        'components/diy-components/diy-audio-create-component':(function(module, exports, __webpack_require__){
            __webpack_require__('df3c')['createComponent'](__webpack_require__("f585"))
        })
    },
    [['components/diy-components/diy-audio-create-component']]
]);
