Difficulty with making Stratus 2 Beta work with website HTML code

2.2k Views Asked by At

I was asked to add Stratus 2 Beta to our website so we can stream music. I went to the stratus website and they make it seem really simple to add the code they have to the website HTML but I can't get it to work.

This is what I have for it (including the jQuery file):

<script type="text/javascript" src="jquery.js"></script>    
<script type="text/javascript" src="http://stratus.sc/stratus.js"></script>
<script type="text/javascript">
   $(document).ready(function(){
     $.stratus({
       links: 'http://soundcloud.com/wearelisten/listen_2'
     });
   });
</script>

I have this between the </head> and <body> script.

5

There are 5 best solutions below

1
On

make sure you have jQuery installed

The <script type="text/javascript" src="jquery.js"> points to the jquery.js file that is the main library for jQuery. That's what's giving you issues.

Download Jquery production from their site, unzip it and upload to your website (I put mine in a jquery folder) and change the src="jquery.js" to src="jquery/jquery.js" (assuming jquery is your folder)

OR

reference the Google hosted one, change the tag to method 1 as is described in "Using Google to host your jQuery (or other) JavaScript libraries":

0
On

what browser are you using? if it is internet explorer its not working. check -> stratus.sc and IE

0
On

Took a little jazzing it seems there were two issues to getting this to work with the examples on the project's site.

As MDizzleDogg said... .browser is deprecated. What you can do is either A) Use an old version of jQuery. or B) Use the migrate plugin found here.

The next problem is in the customize example. It says:

<script type="text/javascript">
$(document).ready(function(){
 $stratus({
  auto_play: true,
  download: false,
  links: 'http://soundcloud.com/qotsa',
  random: true
 });
});
</script> 

The issue is that javascript thinks $stratus is a variable and it is never defined. To fix it, simply change $stratus to $.stratus

I hope that makes sense.

0
On

Always put scripts at the bottom of the page just before the closing body tag.

Looks like you are missing a jQuery string selector. Update your code to the sample below.

<script type="text/javascript" src="jquery.js"></script>    
<script type="text/javascript" src="http://stratus.sc/stratus.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $('body').stratus({
            links: 'http://soundcloud.com/wearelisten/listen_2'
        });
    });
</script>
0
On

I recently had the same problem and it was solved using an older jQuery library - stratus uses $.browser which was removed in jQuery 1.9. I used version 1.7.2:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

and my player finally worked! You can see the test page demo here: www.tworoxdesign.com/EliotCurtis

Hope this helps anyone having this problem!

Matt