Skip to content

Instantly share code, notes, and snippets.

@mataspetrikas
Created May 23, 2011 08:06
Show Gist options
  • Save mataspetrikas/986383 to your computer and use it in GitHub Desktop.
Save mataspetrikas/986383 to your computer and use it in GitHub Desktop.
show additional titile in the custom player
append this to your script:
// update additional title
$(document).bind('onPlayerTrackSwitch.scPlayer', function(event, track) {
var $player = $(event.target);
$('.sc-inline-title', $player).remove();
$('<p class="sc-inline-title">' + track.title +'</p>').appendTo($('.sc-scrubber', $player));
});
or hack the sc-player directly (will be overwritten with the next update)
// put this script inside of the updateTrackInfo
// update additional title
$('.sc-scrubber', $player).each(function(index) {
$('.sc-inline-title', this).remove();
$('<p class="sc-inline-title">' + track.title +'</p>').appendTo(this);
});
@rdh3t
Copy link

rdh3t commented May 23, 2011

thanks so much for the reply! Sorry I'm a rookie here--I tried to add the first "update additional title" code to my html doc that I sent you a link to--tried both at the script at the top, and when that didn't work, I tried at the bottom. Neither worked. I also tried adding the same script into the sc-player.js script, and couldn't get it to work.

Could you please let me know where to put the first "update additional title" code, or if I need to tweak it or anything else?

Thanks again!

Ryan

@mataspetrikas
Copy link
Author

hi, you can add the first script right after the sc-player.js script.
also you might want to try out binding it like this, without .scPlayer namespace:
$(document).bind('onPlayerTrackSwitch', function(event, track) {

@rdh3t
Copy link

rdh3t commented May 24, 2011 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment