Sony Arouje

a programmer's log

Posts Tagged ‘soundcloud

Enable Stratus player in Tumblr

with 4 comments

I wanted to install stratus player for my site lumigraphs.com. I tried all the options mentioned in the stratus site but the stratus player is not showing in my tumblr site. I even tried with different versions of jquery and moving the script to Header section from Body, but nothing really worked.

Here is what I did to get it working, it’s very simple.

In stratus site the script to add to the body was like below.

<script type="text/javascript">

$(document).ready(function(){

$stratus({

auto_play: true,

download: false,

links: 'http://soundcloud.com/qotsa',

random: true

});

});

</script>

 

To get it working we need change it as follows and put it inside the body. Below I am giving the whole script including the jquery reference I used.

 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
<script type="text/javascript" src="http://stratus.sc/stratus.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    $('body').stratus({
      auto_play: true,
      download: false,
      align: 'bottom',
      links: 'https://soundcloud.com/sony-arouje/sets/fortumblr',
      random: true
    });
});
</script>
 

The only change I did was appended $(‘body’) just before calling stratus (marked in bold above).

Edit

When I put the stratus plugin in the body, tumblr is not loading all my photos, only few is showing. So I moved the above script to head, the only change is, instead of $(‘body’).stratus(… to $(‘head’).stratus…

Written by Sony Arouje

March 7, 2014 at 6:57 pm

%d bloggers like this: