EddieKidiw

WHAK_com

May 19th, 2017
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.85 KB | None | 0 0
  1. http://codepen.io/samples/pen/OVeEgj.html
  2. Decode:
  3. <script>!function(e,t,r,i){var n,o,a,s,d,c,l,u,f,m,g,h,p,v,b,w,y,C,S,k,x,E;n=function(){var i={URL:e.URL||e.webkitURL||e.mozURL||e.msURL,getUserMedia:function(){var e=r.getUserMedia||r.webkitGetUserMedia||r.mozGetUserMedia||r.msGetUserMedia;return e?e.bind(r):e}(),Blob:e.Blob||e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||e.MSBlobBuilder,btoa:function(){var t=e.btoa||function(e){for(var t,r,i,n,o,a,s,d="",c=0,l=e.length,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";l>c;)t=e.charCodeAt(c++),r=e.charCodeAt(c++),i=e.charCodeAt(c++),n=t>>2,o=(3&t)<<4|r>>4,a=(15&r)<<2|i>>6,s=63&i,isNaN(r)?a=s=64:isNaN(i)&&(s=64),d=d+u.charAt(n)+u.charAt(o)+u.charAt(a)+u.charAt(s);return d};return t?t.bind(e):function(){}}(),isObject:function(e){return e&&"[object Object]"===Object.prototype.toString.call(e)},isEmptyObject:function(e){return i.isObject(e)&&!Object.keys(e).length},isArray:function(e){return e&&Array.isArray(e)},isFunction:function(e){return e&&"function"==typeof e},isElement:function(e){return e&&1===e.nodeType},isString:function(e){return"string"==typeof e||"[object String]"===Object.prototype.toString.call(e)},isSupported:{canvas:function(){var e=t.createElement("canvas");return e&&e.getContext&&e.getContext("2d")},webworkers:function(){return e.Worker},blob:function(){return i.Blob},Uint8Array:function(){return e.Uint8Array},Uint32Array:function(){return e.Uint32Array},videoCodecs:function(){var e=t.createElement("video"),r={mp4:!1,h264:!1,ogv:!1,ogg:!1,webm:!1};try{e&&e.canPlayType&&(r.mp4=""!==e.canPlayType('video/mp4; codecs="mp4v.20.8"'),r.h264=""!==(e.canPlayType('video/mp4; codecs="avc1.42E01E"')||e.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')),r.ogv=""!==e.canPlayType('video/ogg; codecs="theora"'),r.ogg=""!==e.canPlayType('video/ogg; codecs="theora"'),r.webm=-1!==e.canPlayType('video/webm; codecs="vp8, vorbis"'))}catch(i){}return r}()},noop:function(){},each:function(e,t){var r,n;if(i.isArray(e))for(r=-1,n=e.length;++ri&&n>=o;)s.style.fontSize=--n+"px";return t.body.removeChild(s),n+"px"},webWorkerError:!1};return i}(),o=function(e){var t={validate:function(r){r=e.isObject(r)?r:{};var i={};return e.each(t.validators,function(e,t){var n=t.errorCode;return r[n]||t.condition?void 0:(i=t,i.error=!0,!1)}),delete i.condition,i},isValid:function(e){var r=t.validate(e),i=r.error!==!0?!0:!1;return i},validators:[{condition:e.isFunction(e.getUserMedia),errorCode:"getUserMedia",errorMsg:""},{condition:e.isSupported.canvas(),errorCode:"canvas",errorMsg:""},{condition:e.isSupported.webworkers(),errorCode:"webworkers",errorMsg:""},{condition:e.isFunction(e.URL),errorCode:"window.URL",errorMsg:""},{condition:e.isSupported.blob(),errorCode:"window.Blob",errorMsg:""},{condition:e.isSupported.Uint8Array(),errorCode:"window.Uint8Array",errorMsg:""},{condition:e.isSupported.Uint32Array(),errorCode:"window.Uint32Array",errorMsg:""}],messages:{videoCodecs:{errorCode:"videocodec",errorMsg:""}}};return t}(n),a={sampleInterval:10,numWorkers:2,gifWidth:200,gifHeight:200,interval:.1,numFrames:10,keepCameraOn:!1,images:[],video:null,webcamVideoElement:null,cameraStream:null,text:"",fontWeight:"normal",fontSize:"16px",minFontSize:"10px",resizeFont:!1,fontFamily:"sans-serif",fontColor:"#ffffff",textAlign:"center",textBaseline:"bottom",textXCoordinate:null,textYCoordinate:null,progressCallback:function(){},completeCallback:function(){},saveRenderingContexts:!1,savedRenderingContexts:[],crossOrigin:"Anonymous"},s=function(){return o.isValid()},d=function(){return o.isValid()},c=function(){var e={getUserMedia:!0};return o.isValid(e)},l=function(e){var t=!1;if(n.isArray(e)&&e.length){if(n.each(e,function(e,r){n.isSupported.videoCodecs[r]&&(t=!0)}),!t)return!1}else if(n.isString(e)&&e.length&&!n.isSupported.videoCodecs[e])return!1;return o.isValid({getUserMedia:!0})},u=function(){function e(){function e(e,t,r){var i,n;for(u=e,f=t,m=r,g=Array(h),i=0;h>i;i++)g[i]=Array(4),n=g[i],n[0]=n[1]=n[2]=0|(i<r;r++)t[g[r][3]]=r;for(i=0,n=0;h>n;n++)o=t[n],e[i++]=g[o][0],e[i++]=g[o][1],e[i++]=g[o][2];return e}function r(){var e,t,r,i,n,o,a,s;for(a=0,s=0,e=0;h>e;e++){for(n=g[e],r=e,i=n[1],t=e+1;h>t;t++)o=g[t],o[1]>1,t=a+1;i>t;t++)P[t]=e;a=i,s=e}}for(P[a]=s+C>>1,t=a+1;256>t;t++)P[t]=C}function i(){var e,t,r,i,n,o,a,g,h,C,x,E,F,W;for(y>f&&(m=1),l=30+(m-1)/3,E=u,F=0,W=f,x=f/(3*m),C=0|x/k,g=j,o=R,a=o>>M,1>=a&&(a=0),e=0;a>e;e++)N[e]=g*((a*a-e*e)*L/(a*a));for(h=y>f?3:0!==f%p?3*p:0!==f%v?3*v:0!==f%b?3*b:3*w,e=0;x>e;)if(r=(255&E[F+0])<=W&&(F-=f),e++,0===C&&(C=1),0===e%C)for(g-=g/l,o-=o/V,a=o>>M,1>=a&&(a=0),t=0;a>t;t++)N[t]=g*((a*a-t*t)*L/(a*a))}function n(e,t,r){var i,n,o,a,s,d,c;for(s=1e3,c=-1,i=P[t],n=i-1;h>i||n>=0;)h>i&&(d=g[i],o=d[1]-t,s>o?(i++,0>o&&(o=-o),a=d[0]-e,0>a&&(a=-a),o+=a,s>o&&(a=d[2]-r,0>a&&(a=-a),o+=a,s>o&&(s=o,c=d[3]))):i=h),n>=0&&(d=g[n],o=t-d[1],s>o?(n--,0>o&&(o=-o),a=d[0]-e,0>a&&(a=-a),o+=a,s>o&&(a=d[2]-r,0>a&&(a=-a),o+=a,s>o&&(s=o,c=d[3]))):n=-1);return c}function o(){return i(),a(),r(),t()}function a(){var e;for(e=0;h>e;e++)g[e][0]>>=S,g[e][1]>>=S,g[e][2]>>=S,g[e][3]=e}function s(e,t,r,i,n){var o,a,s,d,c,l,u;for(s=t-e,-1>s&&(s=-1),d=t+e,d>h&&(d=h),o=t+1,a=t-1,l=1;d>o||a>s;){if(c=N[l++],d>o){u=g[o++];try{u[0]-=0|c*(u[0]-r)/B,u[1]-=0|c*(u[1]-i)/B,u[2]-=0|c*(u[2]-n)/B}catch(f){}}if(a>s){u=g[a--];try{u[0]-=0|c*(u[0]-r)/B,u[1]-=0|c*(u[1]-i)/B,u[2]-=0|c*(u[2]-n)/B}catch(f){}}}}function d(e,t,r,i,n){var o=g[t],a=e/j;o[0]-=0|a*(o[0]-r),o[1]-=0|a*(o[1]-i),o[2]-=0|a*(o[2]-n)}function c(e,t,r){var i,n,o,a,s,d,c,l,u,f;for(l=~(1<<31),u=l,d=-1,c=d,i=0;h>i;i++)f=g[i],n=f[0]-e,0>n&&(n=-n),o=f[1]-t,0>o&&(o=-o),n+=o,o=f[2]-r,0>o&&(o=-o),n+=o,l>n&&(l=n,d=i),a=n-(G[i]>>x-S),u>a&&(u=a,c=i),s=D[i]>>W,D[i]-=s,G[i]+=s<>W,A=E<>3,M=6,I=1<i;)o.push(e[i++]),o.push(e[i++]),o.push(e[i++]),i++;return o},componentizedPaletteToArray:function(e){var t,r,i,n,o=[];for(t=0;to;o++)a=c[h++],s=c[h++],d=c[h++],g[o]=l.map(a,s,d);return{pixels:g,palette:f}},run:function(e){var t=e.width,r=e.height,i=e.data,n=(e.palette,e.sampleInterval);return this.processFrameWithQuantizer(i,t,r,n)}};return r};return t}(u),m=function(e,t,r,n){function o(e){var t=e.length;if(2>t||t>256||t&t-1)throw"";return t}function a(e,t,r,n){function o(r){for(;m>=r;)e[t++]=255&g,g>>=8,m-=8,t===s+256&&(e[s]=255,s=t++)}function a(e){g|=e<v;++v)if(w=n[v]&c,y=h<<8|w,C=p[y],C===i){for(g|=h<=8;)e[t++]=255&g,g>>=8,m-=8,t===s+256&&(e[s]=255,s=t++);4096===u?(a(d),u=l+1,f=r+1,p={}):(u>=1<=t||0>=r||t>65535||r>65535)throw"";if(e[s++]=71,e[s++]=73,e[s++]=70,e[s++]=56,e[s++]=57,e[s++]=97,l=0,u=0,e[s++]=255&t,e[s++]=255&t>>8,e[s++]=255&r,e[s++]=255&r>>8,e[s++]=(null!==c?128:0)|l,e[s++]=u,e[s++]=0,null!==d){if(0>d||d>65535)throw"";e[s++]=33,e[s++]=255,e[s++]=11,e[s++]=78,e[s++]=69,e[s++]=84,e[s++]=83,e[s++]=67,e[s++]=65,e[s++]=80,e[s++]=69,e[s++]=50,e[s++]=46,e[s++]=48,e[s++]=3,e[s++]=1,e[s++]=255&d,e[s++]=255&d>>8,e[s++]=0}f=!1,this.addFrame=function(t,r,n,d,l,u){var m,g,h,p,v,b,w,y,C,S,k;if(f===!0&&(--s,f=!1),u=u===i?{}:u,0>t||0>r||t>65535||r>65535)throw"";if(0>=n||0>=d||n>65535||d>65535)throw"";if(l.length>=1;)++p;if(h=1<b||b>3)throw"";if(w=!1,y=0,u.transparent!==i&&null!==u.transparent&&(w=!0,y=u.transparent,0>y||y>=h))throw"";if((0!==b||w||0!==v)&&(e[s++]=33,e[s++]=249,e[s++]=4,e[s++]=b<<2|(w===!0?1:0),e[s++]=255&v,e[s++]=255&v>>8,e[s++]=y,e[s++]=0),e[s++]=44,e[s++]=255&t,e[s++]=255&t>>8,e[s++]=255&r,e[s++]=255&r>>8,e[s++]=255&n,e[s++]=255&n>>8,e[s++]=255&d,e[s++]=255&d>>8,e[s++]=m===!0?128|p-1:0,m===!0)for(C=0,S=g.length;S>C;++C)k=g[C],e[s++]=255&k>>16,e[s++]=255&k>>8,e[s++]=255&k;s=a(e,s,2>p?2:p,l)},this.end=function(){return f===!1&&(e[s++]=59,f=!0),s}},g=function(e,r,i,n){var o=function(t){this.canvas=null,this.ctx=null,this.repeat=0,this.frames=[],this.numRenderedFrames=0,this.onRenderCompleteCallback=e.noop,this.onRenderProgressCallback=e.noop,this.workers=[],this.availableWorkers=[],this.generatingGIF=!1,this.options=t,this.initializeWebWorkers(t)};return o.prototype={workerMethods:r(),initializeWebWorkers:function(n){var o,a,s,d,c=""+i+"("+(""+r)+"());",l=-1,u="";for(d=n.numWorkers;++lt;t++)e[t]=String.fromCharCode(t);return e}(),bufferToString:function(e){for(var t=e.length,r="",i=-1;++i=0&&this.processFrame(e)},generateGIF:function(t,r){var i,o,a=[],s={loop:this.repeat},d=this.options,c=d.interval,l=d.images,u=!!l.length,f=d.gifHeight,m=d.gifWidth,g=new n(a,m,f,s),h=this.onRenderProgressCallback,p=u?100*c:0;this.generatingGIF=!0,e.each(t,function(e,r){var i=r.palette;h(.75+1*.25*r.position/t.length),g.addFrame(0,0,m,f,r.pixels,{palette:i,delay:p})}),g.end(),h(1),this.frames=[],this.generatingGIF=!1,e.isFunction(r)&&(i=this.bufferToString(a),o="data:image/gif;base64,"+e.btoa(i),r(o))},setRepeat:function(e){this.repeat=e},addFrame:function(t,r){r=e.isObject(r)?r:{};var i,n=this,o=n.ctx,a=n.options,s=a.gifWidth,d=a.gifHeight,c=(r.gifHeight,r.gifWidth,r.text),l=r.fontWeight,u=e.getFontSize(r),f=r.fontFamily,m=r.fontColor,g=r.textAlign,h=r.textBaseline,p=r.textXCoordinate?r.textXCoordinate:"left"===g?1:"right"===g?s:s/2,v=r.textYCoordinate?r.textYCoordinate:"top"===h?1:"center"===h?d/2:d,b=l+" "+u+" "+f;try{o.drawImage(t,0,0,s,d),c&&(o.font=b,o.fillStyle=m,o.textAlign=g,o.textBaseline=h,o.fillText(c,p,v)),i=o.getImageData(0,0,s,d),n.addFrameImageData(i)}catch(w){return""+w}},addFrameImageData:function(e){var t=this.frames,r=e.data;this.frames.push({data:r,width:e.width,height:e.height,palette:null,dithering:null,done:!1,beingProcessed:!1,position:t.length})},onRenderProgress:function(e){this.onRenderProgressCallback=e},isRendering:function(){return this.generatingGIF},getBase64GIF:function(e){var t=this,r=function(r){t.destroyWorkers(),setTimeout(function(){e(r)},0)};t.startRendering(r)},destroyWorkers:function(){if(!this.workerError){var t=this.workers;e.each(t,function(t,r){var i=r.worker,n=r.objectUrl;i.terminate(),e.URL.revokeObjectURL(n)})}}},o}(n,f,u,m),h=function(e,t){e.getBase64GIF(function(e){t({error:!1,errorCode:"",errorMsg:"",image:e})})},p=function(e){function r(){n.each(p,function(e,t){t&&s.addFrame(t,u)}),h(s,l)}var a,s,d=e.images,c=e.imagesLength,l=e.callback,u=e.options,f={getUserMedia:!0,"window.URL":!0},m=o.validate(f),p=[],v=0;return m.error?l(m):(s=new g(u),n.each(d,function(e,o){n.isElement(o)?(u.crossOrigin&&(o.crossOrigin=u.crossOrigin),p[e]=o,v+=1,v===c&&r()):n.isString(o)&&(a=t.createElement("img"),u.crossOrigin&&(a.crossOrigin=u.crossOrigin),a.onerror=function(){p.length>e&&(p[e]=i)}(function(t){t.onload=function(){p[e]=t,v+=1,v===c&&r(),n.removeElement(t)}}(a)),a.src=o,n.setCSSAttr(a,{position:"fixed",opacity:"0"}),t.body.appendChild(a))}),void 0)},v={getGIF:function(e,r){r=n.isFunction(r)?r:function(){};var o,a=t.createElement("canvas"),s=e.images,d=!!s.length,c=e.videoElement,l=e.keepCameraOn,u=e.webcamVideoElement,f=e.cameraStream,m=+e.gifWidth,h=+e.gifHeight,p=e.videoWidth,v=e.videoHeight,b=(+e.sampleInterval,+e.numWorkers,e.crop),w=+e.interval,y=d?0:1e3*w,C=e.progressCallback,S=e.savedRenderingContexts,k=e.saveRenderingContexts,x=[],E=S.length?S.length:e.numFrames,F=E,W=new g(e),O=e.text,A=e.fontWeight,U=n.getFontSize(e),M=e.fontFamily,I=e.fontColor,R=e.textAlign,V=e.textBaseline,T=e.textXCoordinate?e.textXCoordinate:"left"===R?1:"right"===R?m:m/2,j=e.textYCoordinate?e.textYCoordinate:"top"===V?1:"center"===V?h/2:h,H=A+" "+U+" "+M,L=b?Math.floor(b.scaledWidth/2):0,z=b?p-b.scaledWidth:0,B=b?Math.floor(b.scaledHeight/2):0,P=b?v-b.scaledHeight:0,G=function D(){function e(){try{z>p&&(z=p),P>v&&(P=v),0>L&&(L=0),0>B&&(B=0),o.drawImage(c,L,B,z,P,0,0,m,h),t()}catch(r){if("NS_ERROR_NOT_AVAILABLE"!==r.name)throw '';setTimeout(e,100)}}function t(){k&&x.push(o.getImageData(0,0,m,h)),O&&(o.font=H,o.fillStyle=I,o.textAlign=R,o.textBaseline=V,o.fillText(O,T,j)),W.addFrameImageData(o.getImageData(0,0,m,h)),F=i,C((E-F)/E),i>0&&setTimeout(D,y),F||W.getBase64GIF(function(e){r({error:!1,errorCode:"",errorMsg:"",image:e,cameraStream:f,videoElement:c,webcamVideoElement:u,savedRenderingContexts:x,keepCameraOn:l})})}var i=F-1;S.length?(o.putImageData(S[E-F],0,0),t()):e()};E=E!==i?E:10,w=w!==i?w:.1,a.width=m,a.height=h,o=a.getContext("2d"),function N(){return S||0!==c.currentTime?(G(),void 0):(setTimeout(N,100),void 0)}()},getCropDimensions:function(e){var t=e.videoWidth,r=e.videoHeight,i=e.gifWidth,n=e.gifHeight,o={width:0,height:0,scaledWidth:0,scaledHeight:0};return t>r?(o.width=Math.round(t*(n/r))-i,o.scaledWidth=Math.round(o.width*(r/n))):(o.height=Math.round(r*(i/t))-n,o.scaledHeight=Math.round(o.height*(t/i))),o}},b={loadedData:!1,defaultVideoDimensions:{width:640,height:480},findVideoSize:function F(e){F.attempts=F.attempts||0;var t=this,r=e.videoElement,i=e.cameraStream,n=e.completedCallback;r&&(r.videoWidth>0&&r.videoHeight>0?(r.removeEventListener("loadeddata",t.findVideoSize),n({videoElement:r,cameraStream:i,videoWidth:r.videoWidth,videoHeight:r.videoHeight})):F.attempts<10?(F.attempts+=1,setTimeout(function(){t.findVideoSize(e)},200)):n({videoElement:r,cameraStream:i,videoWidth:t.defaultVideoDimensions.width,videoHeight:t.defaultVideoDimensions.height}))},onStreamingTimeout:function(e){n.isFunction(e)&&e({error:!0,errorCode:"getUserMedia",errorMsg:"",image:null,cameraStream:{}})},stream:function(e){var t=this,r=n.isArray(e.existingVideo)?e.existingVideo[0]:e.existingVideo,i=e.videoElement,o=e.cameraStream,a=e.streamedCallback,s=e.completedCallback;n.isFunction(a)&&a(),r?n.isString(r)&&(i.src=r,i.innerHTML=''):i.mozSrcObject?i.mozSrcObject=o:n.URL&&(i.src=n.URL.createObjectURL(o)),i.play(),setTimeout(function d(){d.count=d.count||0,t.loadedData===!0?(t.findVideoSize({videoElement:i,cameraStream:o,completedCallback:s}),t.loadedData=!1):(d.count+=1,d.count>10?t.findVideoSize({videoElement:i,cameraStream:o,completedCallback:s}):d())},100)},startStreaming:function(e){var r=this,i=n.isFunction(e.error)?e.error:n.noop,o=n.isFunction(e.streamed)?e.streamed:n.noop,a=n.isFunction(e.completed)?e.completed:n.noop,s=e.existingVideo,d=e.webcamVideoElement,c=n.isElement(s)?s:d?d:t.createElement("video"),l=e.lastCameraStream,u=e.crossOrigin,f=e.options;u&&(c.crossOrigin=f.crossOrigin),c.autoplay=!0,c.loop=!0,c.muted=!0,c.addEventListener("loadeddata",function(){r.loadedData=!0}),s?r.stream({videoElement:c,existingVideo:s,completedCallback:a}):l?r.stream({videoElement:c,cameraStream:l,streamedCallback:o,completedCallback:a}):n.getUserMedia({video:!0},function(e){r.stream({videoElement:c,cameraStream:e,streamedCallback:o,completedCallback:a})},i)},startVideoStreaming:function(e,t){t=t||{};var r,n=this,o=t.timeout!==i?t.timeout:0,a=t.callback,s=t.webcamVideoElement;o>0&&(r=setTimeout(function(){n.onStreamingTimeout(a)},1e4)),this.startStreaming({error:function(){a({error:!0,errorCode:"getUserMedia",errorMsg:"",image:null,cameraStream:{}})},streamed:function(){clearTimeout(r)},completed:function(t){var r=t.cameraStream,i=t.videoElement,n=t.videoWidth,o=t.videoHeight;e({cameraStream:r,videoElement:i,videoWidth:n,videoHeight:o})},lastCameraStream:t.lastCameraStream,webcamVideoElement:s,crossOrigin:t.crossOrigin,options:t})},stopVideoStreaming:function(e){e=n.isObject(e)?e:{};var t=e.cameraStream,r=e.videoElement,i=e.keepCameraOn,o=e.webcamVideoElement;!i&&t&&n.isFunction(t.stop)&&t.stop(),n.isElement(r)&&!o&&(r.pause(),n.isFunction(n.URL.revokeObjectURL)&&!n.webWorkerError&&r.src&&n.URL.revokeObjectURL(r.src),n.removeElement(r))}},w=function(e){e=n.isObject(e)?e:{};var t=(n.isObject(e.options)?e.options:{},e.cameraStream),r=e.videoElement,i=e.webcamVideoElement,o=e.keepCameraOn;b.stopVideoStreaming({cameraStream:t,videoElement:r,keepCameraOn:o,webcamVideoElement:i})},y=function(e,r){var i=e.options||{},o=i.images,a=i.video,s=(+i.numFrames,e.cameraStream),d=e.videoElement,c=e.videoWidth,l=e.videoHeight,u=+i.gifWidth,f=+i.gifHeight,m=v.getCropDimensions({videoWidth:c,videoHeight:l,gifHeight:f,gifWidth:u}),g=r;i.crop=m,i.videoElement=d,i.videoWidth=c,i.videoHeight=l,i.cameraStream=s,n.isElement(d)&&(d.width=u+m.width,d.height=f+m.height,i.webcamVideoElement||(n.setCSSAttr(d,{position:"fixed",opacity:"0"}),t.body.appendChild(d)),d.play(),v.getGIF(i,function(e){o&&o.length||a&&a.length||w(e),g(e)}))},C=function(e){var t,r,i=e.existingVideo,a=e.callback,s=e.options,d={getUserMedia:!0,"window.URL":!0},c=o.validate(d);if(c.error)return a(c);if(n.isElement(i)&&i.src){if(r=i.src,t=n.getExtension(r),!n.isSupported.videoCodecs[t])return a(o.messages.videoCodecs)}else n.isArray(i)&&n.each(i,function(e,r){return t=r.substr(r.lastIndexOf(".")+1,r.length),n.isSupported.videoCodecs[t]?(i=r,!1):void 0});b.startStreaming({completed:function(e){e.options=s||{},y(e,a)},existingVideo:i,crossOrigin:s.crossOrigin,options:s})},S=function(e){var t=e.lastCameraStream,r=e.callback,i=e.webcamVideoElement,n=e.options;return d()?n.savedRenderingContexts.length?(v.getWebcamGIF(n,function(e){r(e)}),void 0):(b.startVideoStreaming(function(e){e.options=n||{},y(e,r)},{lastCameraStream:t,callback:r,webcamVideoElement:i,crossOrigin:n.crossOrigin}),void 0):r(o.validate())},k=function(e,t){if(t=n.isFunction(e)?e:t,e=n.isObject(e)?e:{},n.isFunction(t)){var r=n.mergeOptions(a,e)||{},i=e.cameraStream,o=r.images,s=o?o.length:0,d=r.video,c=r.webcamVideoElement;r=n.mergeOptions(r,{gifWidth:Math.floor(r.gifWidth),gifHeight:Math.floor(r.gifHeight)}),s?p({images:o,imagesLength:s,callback:t,options:r}):d?C({existingVideo:d,callback:t,options:r}):S({lastCameraStream:i,callback:t,webcamVideoElement:c,options:r})}},x=function(e,t){if(t=n.isFunction(e)?e:t,e=n.isObject(e)?e:{},n.isFunction(t)){var r=n.mergeOptions(a,e),i=n.mergeOptions(r,{interval:.1,numFrames:1,gifWidth:Math.floor(r.gifWidth),gifHeight:Math.floor(r.gifHeight)});k(i,t)}},E=function(e,t,r,i,n,o,a,s,d,c){var l={utils:e,error:t,defaultOptions:r,createGIF:s,takeSnapShot:d,stopVideoStreaming:c,isSupported:i,isWebCamGIFSupported:n,isExistingVideoGIFSupported:a,isExistingImagesGIFSupported:o,VERSION:"0.2.1"};return l}(n,o,a,s,d,c,l,k,x,w),function(t){"function"==typeof define&&define.amd?define([],function(){return t}):"undefined"!=typeof exports?module.exports=t:e.gifshot=t}(E)}("undefined"!=typeof window?window:{},"undefined"!=typeof document?document:{createElement:function(){}},"undefined"!=typeof window?window.navigator:{}); </script>
Add Comment
Please, Sign In to add comment