{"name":"Elton Audio Player","key":"eltonplayer","instructions":"This is a small HTML5 audio player that plays and stops (or pauses) on the click of a single button.","showatto":"0","showplayers":"1","requirecss":"//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css","requirejs":"","shim":"","defaults":"pause=fa-stop,play=fa-volume-up,stoporpause=stop|pause","amd":"1","body":"<button id='@@AUTOID@@'><audio class=\"eltonaudio\" src=\"@@VIDEOURL@@\"></audio><i class=\"fa fa-volume-up\" aria-hidden=\"true\"></i></button>","bodyend":"","script":"var aplayer = $('#' + @@AUTOID@@).children().first();\nvar fa = $('#' + @@AUTOID@@ + ' .fa');\n\naplayer[0].addEventListener('ended', function(){\n    $(fa).removeClass(@@pause@@);\n    $(fa).addClass(@@play@@);\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(@@pause@@);\n     $(fa).addClass(@@play@@);\n   }else{\n     aplayer[0].play();\n     $(fa).removeClass(@@play@@);\n     $(fa).addClass(@@pause@@);\n   }\n});\n","style":"","dataset":"","datasetvars":"","alternate":"<audio id=\"@@AUTOID@@\" controls=\"controls\">\n  <source src=\"@@VIDEOURL@@\" type=\"audio/mpeg\">\n</audio>","alternateend":""}