JSMP3 player - play mp3 with javascript v1.2 fixed



You can now play MP3 with javascript only like this:

$("Selected Element").jsmp3('music.mp3', {options});

 DEMO:

Play Song Pause Song | Stop Song
Volume: (+) | (-)
Duration: /



Source code:

<div id="theplayer">
<a href="#play" class="play">Play Song</a>
<a href="#Pause" class="pause">Pause Song</a>
| <a href="#stop" class="stop">Stop Song</a>
<br />
Volume: <span class="volume"> </span> <a href="#" class="volincrease">(+)</a> | <a href="#" class="voldecrease">(-)</a>
<br />
Duration: <span class="positiontime"> </span> / <span class="durationtime"> </span>
</div>
<script type="text/javascript">
$("#theplayer").jsmp3('/testpages/jsmp3player/A_Hoot.mp3', {'swf': '/jsmp3player.swf'});
</script>

 

Options:

  1. volumeClass: default is:  .volume= if you want to show the current volume add element (span or div) and add class name to it like the above
  2. volincrease: default is: .volincrease  = the class name of the link that you want to increase the volume add the class name in this option like above
  3. voldecrease: default is: .voldecrease = the class name of decrease sound link
  4. playbutton: default is :.play = the class name of play button
  5. stopbutton: default is: .stop = the class name of stop button
  6. pause: default is: .pause= the class name of pause button
  7. volume: default is: 100 = the volume level when start up
  8. playingbytes: default is: .positiontime  = the class of  position Duration
  9. songbytes: default is: .durationtime = the class of the total song duration
  10. swf = the path to jsmp3 player path
  11. autoplay: default is: true = make song auto play

 

How to use:

- Add the jquery library to the head tag you can down load latest from jquery.com

<script type="text/javascript"src="jquery-1.6.2.min.js"></script>

 

- Add JSMP3 player libraryinside head tag too to be like this:

<head>
<script type="text/javascript"src="jquery-1.6.2.min.js"></script>
<script type="text/javascript"src="jsmp3player.expbuilder.js">
</script>
</head>

 

then add your  custom JSMP3 player inside body tag like the following:

 

<body>

<!-- the body of jsmp3 -->
<div id="theplayer">
<a href="#play" class="play">Play Song</a>
<a href="#Pause" class="pause">Pause Song</a>
| <a href="#stop" class="stop">Stop Song</a>
<br />
Volume: <span class="volume"> </span> <a href="#" class="volincrease">(+)</a> | <a href="#" class="voldecrease">(-)</a>
<br />
Duration: <span class="positiontime"> </span> / <span class="durationtime"> </span>
</div>

<!-- load jsmp3 -->
<script type="text/javascript">
$("#theplayer").jsmp3('demo.mp3', {'swf': 'jsmp3player.swf', 'autoplay':true});
</script>
</body>

 

 

Have fun with JSMP3 , the download include a demo , good luck

 

 

 

 

 Download 


Related Products