Categories
Related Products
Follow @expbuilder
Subscribe to to get latest news
|
| Visit ExpBuilder group |
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:
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:
- 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
- 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
- voldecrease: default is: .voldecrease = the class name of decrease sound link
- playbutton: default is :.play = the class name of play button
- stopbutton: default is: .stop = the class name of stop button
- pause: default is: .pause= the class name of pause button
- volume: default is: 100 = the volume level when start up
- playingbytes: default is: .positiontime = the class of position Duration
- songbytes: default is: .durationtime = the class of the total song duration
- swf = the path to jsmp3 player path
- 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


