{"name":"Tiny Audio Player Widget","key":"pwtinyaudioplayer","version":"1.0.4","instructions":"This is a small HTML5 audio player that plays and stops (or pauses) on the click of a single button. Place audio player or media link between the widget tags","showatto":"1","showplayers":"1","requirecss":"","requirejs":"/filter/poodll/amd/src/mediaparser.js","shim":"","defaults":"stoporpause=stop|pause","amd":"1","body":"<button type='button' id='@@AUTOID@@'><audio class=\"eltonaudio nomediaplugin\"></audio><i class=\"fa fa-volume-up\" aria-hidden=\"true\"></i></button>\n<div id='@@AUTOID@@_hiddenplayer' class=\"hide nomediaplugin poodllplayerwidgetnoshow\">","bodyend":"</div>","script":"var aplayer = $('#' + @@AUTOID@@).children().first();\nvar fa = $('#' + @@AUTOID@@ + ' .fa');\nvar parser = requiredjs_pwtinyaudioplayer;\nvar details = parser.parse(@@AUTOID@@ + '_hiddenplayer', 'audio');\naplayer.attr('src',details.mediaurl);\n\naplayer[0].addEventListener('ended', function(){\n    $(fa).removeClass('fa-stop');\n    $(fa).addClass('fa-volume-up');\n    aplayer[0].pause();\n});\n\n$('#' + @@AUTOID@@).click(function(){\n  if(!aplayer[0].paused && !aplayer[0].ended){\n     aplayer[0].pause();\n     if(@@stoporpause@@=='stop'){aplayer[0].load();}\n     $(fa).removeClass('fa-stop');\n     $(fa).addClass('fa-volume-up');\n   }else{\n     aplayer[0].play();\n     $(fa).removeClass('fa-volume-up');\n     $(fa).addClass('fa-stop');\n   }\n});\n","style":"","dataset":"","datasetvars":"","alternate":"<audio id=\"@@AUTOID@@\" controls=\"controls\" class=\"nomediaplugin\">\n  <source src=\"@@VIDEOURL@@\" type=\"audio/mpeg\">\n</audio>","alternateend":""}