-->

Tuesday, June 22, 2010

Random play background music on your blog with mp3 files


Random play background music on your blog with mp3 files
Now I will show you the best way and also the easiest way.


Prepare your space to keep your mp3 file. I strongly recommend "FileDen" Because it is free and has simple interface.



After you get the account at FileDen
Just follow these Pictures.






























You can upload as much as you want to display on your blog However you should make sure that if you put too many mp3 files, it makes a bit slower the webpage when it opened.















Copy URL of each mp3 then paste the each mp3 URL to the orange textarea on the bottom.








HTML code



<script>

<!--

//By Website Abstraction (http://www.wsabstract.com) More JavaScripts here!

var sound1="http://xxxxxxx1.mp3" //<-- URL of MP3 files
var sound2="http://xxxxxxx2.mp3"
var sound3="http://xxxxxxx3.mp3"



var x=Math.round(Math.random()*3) // <-- The number of files that linked
if (x==0) x=sound1

else if (x==1) x=sound2

else if (x==2) x=sound3
// <-- You can add as much as you uploaded if (navigator.appName=="Microsoft Internet Explorer") document.write('<bgsoundsrc='+'"'+x+'"'+'loop="3">') //<-- the number of repeating
else

document.write('<embed src='+'"'+x+'"'+'type="audio/mpeg" border="0" width="130" height="16"
autostart="true" loop="true" volume="5">') //<--- properties
//-->

</script>
//<--- EXPLANATION



loop is repeating the song. you can choose "false or infinite"
autoplay is the system that automatically plays when your blog is opened.


It's NOT working without Quicktime player.



Just Cope and paste to your Blog.

  1. Click "Design" at your Blogger menu
  2. Click the "add Gadget"
  3. Click the HTML/Java Script
  4. Paste your HTML Code like this bottom picture.










    Easy stuff, isn't it?

10 comments:

  1. its not working, what can i do, ders no html code in add gadget

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. hey you guys!! if this is not working, try scmplayer.net

    IT WORKS !

    ReplyDelete
  4. I use kiwi6.com to upload my MP3 files. Works wonders! :D

    ReplyDelete
  5. For more details on this topic visit
    http://blogging-activities.blogspot.com/search/label/Add mp3 player to blog

    ReplyDelete