MIDI Studio logo
 

EMBED .MID EXAMPLE
(With Relational Links)
 
 


  Above is the result of our script.
(Right-click for access to play/pause, stop, volume, etc.)

Thanks to Les Gorven and MIDI Studio Consortium
for this arrangement of "America the Beautiful"


Notice that in "playMedia" the MIDI file name is preceded by a relational link "../midi/Les/".  Also the first Script line now indicates a relational link for "wmpCodeGen.js".  The normal location for the Code Generator is in the root of your website on line. Thus, you can refer to it from within a folder by simply adding "../" so that it can be found. If you page is also in the root location, then delete this link reference.
<script language="JavaScript" src="../wmpCodeGen.js"></script>
<script language="JavaScript" type="text/javascript"> 
playMedia("../midi/Les/America-R1.mid",1,16,16) 
</script>
 
Note to Internet Explorer users. When you use a relational link to a file that is above or below the folder you are working in (as illustrated), if you preview your page off-line it will not play.  The media player console will appear but there will be no sound. If you right-click on the player you will find an item "Error Details.."  Click on this and you will receive the message: "The URL would change the root". This will not happen once the page has been uploaded to your server.

 
Please click the 'Back' button below to view the list of other examples and instructions.




©2006 MidiStudio.com. All Rights Reserved.
Last Update: January 8, 2006
This site is owned, designed and produced by Les Gorven
dba Business Technologies & MIDI-Studio Publishing