Created
May 23, 2011 08:06
-
-
Save mataspetrikas/986383 to your computer and use it in GitHub Desktop.
show additional titile in the custom player
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}); | |
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) {
sorry to keep bothering you. I added the script just below the sc-player js
script in my html doc, and tried both with and without the .scPlayer
namespace, but it doesn't seem to work, here's a link:
http://www.ryan-hughes.net/rhm-songs.html
thanks again for your time and for sharing this awesome answer to the
soundcloud on an iphone problem!
On Mon, May 23, 2011 at 10:07 AM, mataspetrikas < ***@***.***>wrote:
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) {
##
Reply to this email directly or view it on GitHub:
https://gist.github.com/986383
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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