Thursday, December 6, 2007

Simple script to play music on a HTML document

You can use this EMBED script to play a music in HTML document.

Take a look at the example below. Hope this will help you work it out.


<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="play music">
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<title>Play music
<SCRIPT language=JavaScript type=text/javascript>
function StartPlay (){

function StopPlay(){
// -->

<body >

<EMBED SRC="your_song.wav" name="track" autostart="false" hidden="true" loop="true"> </EMBED>
<input type="button" onclick="StopPlay()" value="Stop">
<input type="button" onclick="StartPlay()" value="Play">


Note: To make it work, you still need any version of Windows Media Player to be installed in your computer, else a plug-in error will occurred.



Get paid for your opinions! Click on the banner above to join Planet Pulse. Its totally free to sign up, and you can earn UNLIMITED. Find out more by visiting PLANET PULSE.
July Code Blog Copyright © 2010 Blogger Template Designed by Bie Blogger Template