Skip to content

Instantly share code, notes, and snippets.

@steffentchr
Created September 21, 2015 10:25
Show Gist options
  • Save steffentchr/dcc2d64ec65ea3082918 to your computer and use it in GitHub Desktop.
Save steffentchr/dcc2d64ec65ea3082918 to your computer and use it in GitHub Desktop.
Player: Add a class to <body> for the current channel
Player.bind('player:video:loaded', function(e,video){
var body = $('body');
$.each(body.attr('class').split(' '), function(i,className){
if(/^album-\d+$/.test(className)) body.removeClass(className);
});
$.each(video.album_id.split(' '), function(i,id){
body.addClass('album-'+id);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment