//= require social_stream/callback SocialStream.Audio = (function(SS, $, undefined){ var callback = new SS.Callback(); var initJplayer = function(){ $(".jp-audio .jp-jplayer").each(function() { $(this).jPlayer({ ready: function () { $(this).jPlayer("setMedia", { webma: $(this).closest(".audio").find(".audio-webma").attr("href"), // Defines the webm url }); }, preload: "none", supplied: "webma", swfPath: "<%= asset_path "" %>", cssSelectorAncestor: "#" + $(this).closest(".audio-full").attr("id") }) }); $(".format-links").hide(); } callback.register('show', initJplayer); return callback.extend({ }); })(SocialStream, jQuery);