Mengkontrol Sound Lewat Javascript (Play, Mute, unMute)


<script langauge="javascript">

var alertMessage="mulai !!!"

function userAlert(){
	alert(alertMessage);
	document.getElementById('FileName').Play();
}
function mute(){
	alert("mute");
	document.getElementById("FileName").SetVolume(0);
}

function unmute(){
	alert("unmute");
	document.getElementById("FileName").SetVolume(200);
}

</script>
  <a href="javascript:userAlert();">Click Here </a>

  <embed src="namafile.mp3" width="0" height="0" autostart="true" type="audio/midi" Volume=100 loop="false"  id="FileName" name="FileName"   ></embed>

</p>
<p>&nbsp;</p>
<p><a href="javascript:mute();">Stop</a></p>
<p><a href="javascript:unmute();">Play</a></p>
<p>&nbsp;</p>

Advertisements

3 comments

  1. Hi there, I found your website by way of Google at the same time as looking for a comparable subject, your web site came up, it seems great.
    I have bookmarked it in my google bookmarks.
    Hello there, simply changed into aware of your blog via
    Google, and located that it’s really informative. I am going to be careful for brussels.
    I will be grateful for those who continue this in future.
    Lots of other folks might be benefited from your writing.
    Cheers!

  2. Hello just wanted to give you a brief heads up and let you
    know a few of the images aren’t loading correctly. I’m not sure why but I think its a linking issue.
    I’ve tried it in two different browsers and both show the same results.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s