text: (function(e){function t(t){for(var o,s,a=t[0],c=t[1],d=t[2],l=0,p=[];l<a.length;l++)s=a[l],i[s]&&p.push(i[s][0]),i[s]=0;for(o in c)Object.prototype.hasOwnProperty.call(c,o)&&(e[o]=c[o]);u&&u(t);while(p.length)p.shift()();return n.push.apply(n,d||[]),r()}function r(){for(var e,t=0;t<n.length;t++){for(var r=n[t],o=!0,a=1;a<r.length;a++){var c=r[a];0!==i[c]&&(o=!1)}o&&(n.splice(t--,1),e=s(s.s=r[0]))}return e}var o={},i={app:0},n=[];function s(t){if(o[t])return o[t].exports;var r=o[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,s),r.l=!0,r.exports}s.m=e,s.c=o,s.d=function(e,t,r){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},s.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(s.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)s.d(r,o,function(t){return e[t]}.bind(null,o));return r},s.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="/vue-record/";var a=window["webpackJsonp"]=window["webpackJsonp"]||[],c=a.push.bind(a);a.push=t,a=a.slice();for(var d=0;d<a.length;d++)t(a[d]);var u=c;n.push([0,"chunk-vendors"]),r()})({0:function(e,t,r){e.exports=r("56d7")},"0023":function(e,t,r){},"0971":function(e,t,r){"use strict";var o=r("0023"),i=r.n(o);i.a},"1d96":function(e,t,r){},"56d7":function(e,t,r){"use strict";r.r(t);r("cadf"),r("551c"),r("097d");var o=r("2b0e"),i=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{attrs:{id:"app"}},[e._m(0),r("main",{staticClass:"container has-text-centered"},[r("section",{attrs:{id:"example-audio"}},[r("div",{staticClass:"columns"},[r("div",{staticClass:"column"},[r("div",{staticClass:"has-text-right"},[r("h3",{staticClass:"title is-3"},[e._v("Recording audio files")]),r("p",{staticClass:"subtitle"},[e._v("Simply "),r("strong",[e._v(e._s(e.recordMode))]),e._v(" the button to record an audio clip")])]),r("div",{staticClass:"record-settings"},[r("vue-record-audio",{attrs:{mode:e.recordMode},on:{stream:e.onStream,result:e.onResult}}),r("div",{staticClass:"field"},[r("label",{staticClass:"label"},[e._v("Mode")]),r("div",{staticClass:"select"},[r("select",{directives:[{name:"model",rawName:"v-model",value:e.recordMode,expression:"recordMode"}],on:{change:function(t){var r=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){var t="_value"in e?e._value:e.value;return t});e.recordMode=t.target.multiple?r:r[0]}}},[r("option",{attrs:{value:"press"}},[e._v("Press")]),r("option",{attrs:{value:"hold"}},[e._v("Hold")])])])])],1)]),r("div",{staticClass:"column"},[r("div",{staticClass:"recorded-audio"},e._l(e.recordings,function(t,o){return r("div",{key:o,staticClass:"recorded-item"},[r("div",{staticClass:"audio-container"},[r("audio",{attrs:{src:t.src,controls:""}})]),r("div",[r("button",{staticClass:"button is-dark",on:{click:function(t){e.removeRecord(o)}}},[e._v("delete")])])])}))])])])]),e._m(1)])},n=[function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("header",{staticClass:"header"},[o("div",{staticClass:"navbar-brand"},[o("img",{attrs:{alt:"Vue logo",src:r("cf05")}})]),o("div",{staticClass:"navbar-brand-name"},[o("h1",{staticClass:"title"},[e._v("Vue Record")]),o("h2",{staticClass:"subtitle"},[e._v("\n        components for MediaRecorder API\n      ")])])])},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("footer",{staticClass:"footer"},[r("div",{staticClass:"content has-text-centered"},[r("p",[e._v("\n        The source code is licensed "),r("a",{attrs:{href:"https://github.com/musoftware/vue-record/blob/master/LICENSE"}},[e._v("MIT")]),e._v(".\n        Made with ♥ by "),r("a",{attrs:{href:"https://github.com/musoftware"}},[e._v("Codekraft Studio")]),e._v(".\n      ")])])])}],s={name:"app",data:function(){return{recordMode:"press",recordings:[]}},methods:{removeRecord:function(e){this.recordings.splice(e,1)},onStream:function(e){console.log("Got a stream object:",e)},onVideoStream:function(e){console.log("Got a video stream object:",e),this.$refs.Video.srcObject=e,this.$refs.Video.play()},onVideoResult:function(e){this.$refs.Video.srcObject=null,this.$refs.Video.src=window.URL.createObjectURL(e)},onResult:function(e){this.recordings.push({src:window.URL.createObjectURL(e)})}}},a=s,c=(r("5c0b"),r("2877")),d=Object(c["a"])(a,i,n,!1,null,null,null);d.options.__file="App.vue";var u=d.exports,l=function(){var e=this,t=e.$createElement,r=e._self._c||t;return e.isSupported?r("div",{staticClass:"vue-audio-recorder",class:{active:e.isRecording},on:{mousedown:e.startRecording,mouseleave:e.stopRecording,mouseup:e.stopRecording,touchstart:e.startRecording,touchend:e.stopRecording,touchcancel:e.stopRecording}},[r("span")]):e._e()},p=[],v=(r("6762"),r("2fdb"),r("ac6a"),r("96cf"),r("1da1")),f={data:function(){return{isSupported:!1,hasPermission:!1,isRecording:!1,isPaused:!1,chunks:[]}},methods:{start:function(){var e=Object(v["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(!this.isRecording){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,this.getStream();case 5:this.$_stream=e.sent,this.prepareRecorder(),this.$_mediaRecorder.start(),e.next=13;break;case 10:e.prev=10,e.t0=e["catch"](2),console.error(e.t0);case 13:case"end":return e.stop()}},e,this,[[2,10]])}));return function(){return e.apply(this,arguments)}}(),stop:function(){this.isRecording&&(this.$_mediaRecorder.stop(),this.$_stream.getTracks().forEach(function(e){return e.stop()}))},pause:function(){this.isRecording&&this.$_mediaRecorder.pause()},resume:function(){this.isPaused&&this.$_mediaRecorder.resume()},getStream:function(){var e=Object(v["a"])(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,navigator.mediaDevices.getUserMedia(this.constraints);case 2:return t=e.sent,this.$_stream=t,this.$emit("stream",t),e.abrupt("return",t);case 6:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),prepareRecorder:function(){var e=this;this.$_stream&&(this.$_mediaRecorder=new MediaRecorder(this.$_stream,{mimeType:this.mimeType}),this.$_mediaRecorder.ignoreMutedMedia=!0,this.$_mediaRecorder.addEventListener("start",function(){e.isRecording=!0,e.isPaused=!1}),this.$_mediaRecorder.addEventListener("resume",function(){e.isRecording=!0,e.isPaused=!1}),this.$_mediaRecorder.addEventListener("pause",function(){e.isPaused=!0}),this.$_mediaRecorder.addEventListener("dataavailable",function(t){t.data&&t.data.size>0&&e.chunks.push(t.data)},!0),this.$_mediaRecorder.addEventListener("stop",function(){var t=new Blob(e.chunks);t.size>0&&e.$emit("result",t),e.chunks=[],e.isPaused=!1,e.isRecording=!1},!0))}},mounted:function(){navigator.mediaDevices||navigator.mediaDevices.getUserMedia?this.isSupported=!0:console.warn("Media Devices are not supported from your browser.")}},m={mixins:[f],props:{mode:{type:String,default:"hold",validator:function(e){return["hold","press"].includes(e)}}},methods:{stopRecording:function(){if("press"!==this.mode)return this.stop()},startRecording:function(){return this.isRecording&&"press"===this.mode?this.stop():this.start()}}},h=["audio/aac","audio/ogg","audio/wav","audio/webm"],g={name:"VueRecordAudio",mixins:[m],props:{mimeType:{type:String,default:"audio/webm",validator:function(e){return h.includes(e)}}},data:function(){return{constraints:{audio:!0,video:!1}}}},_=g,b=(r("cead"),Object(c["a"])(_,l,p,!1,null,null,null));b.options.__file="VueRecordAudio.vue";var R=b.exports,w=function(){var e=this,t=e.$createElement,r=e._self._c||t;return e.isSupported?r("div",{staticClass:"vue-video-recorder",class:{active:e.isRecording,paused:e.isPaused}},[r("div",{staticClass:"recorder-icon",on:{mousedown:e.startRecording,mouseleave:e.stopRecording,mouseup:e.stopRecording,touchstart:e.startRecording,touchend:e.stopRecording,touchcancel:e.stopRecording}},[r("span",[e._v("►")])]),e.hasControls?r("div",{staticClass:"recorder-controls"},[r("button",{on:{click:e.pause}},[e._v("PAUSE")]),r("button",{on:{click:e.resume}},[e._v("RESUME")]),r("button",{on:{click:e.stop}},[e._v("STOP")])]):e._e()]):e._e()},y=[],C=["video/x-msvideo","video/ogg","video/mpeg","video/webm"],$={name:"VueRecordVideo",mixins:[m],props:{mimeType:{type:String,default:"video/webm",validator:function(e){return C.includes(e)}},audio:{type:Boolean,default:!0},controls:{type:Boolean,default:!1}},computed:{constraints:function(){return{video:!0,audio:this.audio}},hasControls:function(){return this.controls&&"press"===this.mode&&this.isRecording}}},x=$,S=(r("0971"),Object(c["a"])(x,w,y,!1,null,null,null));S.options.__file="VueRecordVideo.vue";var k=S.exports;function M(e){e.component("vue-record-audio",R),e.component("vue-record-video",k)}o["a"].config.productionTip=!1,o["a"].use(M),new o["a"]({render:function(e){return e(u)}}).$mount("#app")},"5c0b":function(e,t,r){"use strict";var o=r("5e27"),i=r.n(o);i.a},"5e27":function(e,t,r){},cead:function(e,t,r){"use strict";var o=r("1d96"),i=r.n(o);i.a},cf05:function(e,t,r){e.exports=r.p+"img/logo.82b9c7a5.png"}});
  //# sourceMappingURL=app.186877c3.js.map