{"name":"QR Scanner","key":"qrscanner","version":"1.0.2","instructions":"QR Scanner\n","showatto":"1","showplayers":"0","requirecss":"","requirejs":"/filter/poodll/amd/src/poodll_qrscanner.js","shim":"","defaults":"width=320,height=240","amd":"1","body":"<div style=\"width: @@width@@px\"><button type=\"button\" id=\"@@AUTOID@@_button\" style=\"margin: auto;\"><i class=\"fa fa-qrcode\"></i></button>\n</div>\n<video id=\"@@AUTOID@@\" width=\"@@width@@px\" height=\"@@height@@px\" class=\"hide\" playsinline></video>\n<div id=\"@@AUTOID@@_playercontainer\" class=\"hide\">\n</div>","bodyend":"","script":"var qrs= requiredjs_qrscanner;\nvar thecam=$('#' + @@AUTOID@@);\nvar thebutton=$('#' + @@AUTOID@@ + '_button');\nvar theplayercontainer=$('#' + @@AUTOID@@ + '_playercontainer');\n\nvar templateaudio='<audio width=\"' + @@width@@ + 'px\" height=\"60px\" src=\"SOURCEURL\" controls></audio>';\n\nvar templateyoutube='<iframe width=\"' + @@width@@ + 'px\" height=\"' + @@height@@ + 'px\" src=\"SOURCEURL\"></iframe>';\n\nvar templatevideo='<video width=\"' + @@width@@ + 'px\" height=\"' + @@height@@ + 'px\" src=\"SOURCEURL\" controls></video>';\n\nvar templatetext='<div>SOURCEURL</div>';\n\nthebutton.click(function(){\n\n  qrs.startWebCam('' + @@AUTOID@@);\n  qrs.setCallback(function(data){\n\nvar usetemplate= templatetext\nif(data.indexOf('.mp3') == data.length-1){\n  usetemplate=templataudio;\n}else if(data.indexOf('.mp4') == data.length-1){\n  usetemplate=templatevideo;\n}else if(data.indexOf('https://www.youtube.com/embed') == 0){\n  usetemplate=templateyoutube;\n}\n\nvar src = usetemplate.replace('SOURCEURL',data);\ntheplayercontainer.html(src);\ntheplayercontainer.show();\nthecam.hide();\n\n});\n\n  qrs.startScan('' + @@AUTOID@@);\n  theplayercontainer.hide();\n  theplayercontainer.html('');\n  thecam.show();\n});\n\n ","style":"","dataset":"","datasetvars":"","alternate":"","alternateend":""}