Skip to content

Instantly share code, notes, and snippets.

@djvs
Created September 17, 2013 15:42
Show Gist options
  • Save djvs/6596155 to your computer and use it in GitHub Desktop.
Save djvs/6596155 to your computer and use it in GitHub Desktop.
<div jplayer audobj="showobj"></div>
app.directive('jplayer',function() {
return {
restrict:'A',
templateUrl:"/partial/jplayer",
scope: {
audobj: '='
},
transclude: true,
link: function(scope, element, attrs){
console.log(attrs.audobj);
console.log(
$("#jquery_jplayer_1").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
mp3: attrs.audobj.url
});
},
swfPath: "/js/jplayer/Jplayer.swf",
supplied: "mp3",
wmode: "window",
smoothPlayBar: true,
keyEnabled: true
})
);
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment