Change the color of the Tumblr player using Javascript

I have to load tumblr audio player into my theme via JavaScript due to this problem . Download is as follows:

$(window).load(function() {
    setTimeout(function() {                        
        $('.audio-player').each(function(){
            var audioID = $(this).parents(".audio").attr("id");
            var $audioPost = $(this);
            var color = "000000"; //new color
            $.ajax({
                url: '/api/read/json?id=' + audioID,
                dataType: 'jsonp',
                timeout: 50000,
                success: function(data){
                    if ($audioPost.html().indexOf("is required to") != -1) {
                        $audioPost.find('#audio_player_'+audioID).replaceWith('<div style=\"background-color:white;">' + data.posts[0]['audio-player'].replace("color=FFFFFF", "color=" + color) +'</div>'); //replace color here
                    }
                }
            });
        });
    }, 2000);
});

Despite using the {AudioPlayerBlack} tag, the audio player inserted in the code is white, so I want to change it. I added two lines (commented on the code) and its kind of work: the player turns black, but all the controls are invisible. Instead of the expected

regular black player

I get it

JavaScript loaded black player

Here you can check out a live example: http://tmbeta.tumblr.com/ (by the way, testing mobile phones, so you need to resize the window to make it less than 480 pixels wide). This is a tumblr api for audio messaging just in case.

0
2

Tumblr , URL- , , - swf (Flash). , audio_player_black.swf () audio_player.swf.

$audioPost.find('#audio_player_'+audioID).replaceWith('<div style=\"background-color:white;">' + data.posts[0]['audio-player'].replace("audio_player.swf", "audio_player_black.swf") +'</div>');

. color, :).

+1

, , - tumblr, , .

( , , , , , , ?)

$('iframe.tumblr_audio_player').each(function(){
    var audio = $(this).attr('src')
    $(this).attr('src', audio + '&color=e84d37'); // replace w/ hex of whatever color
});
0