Play a midi file (.mid) on your browser (HTML).

Please support our HTML and CSS advertiser: Programming Forums
Jan 4th, 2005
Views: 9,040
Thread Rating: 1 votes, 4.0000 average.
AddThis Social Bookmark Button
Lots of good instrumental music out on the web in the form of midi files. You can incorporate background music as part of your web page. Here is the short code.
html Syntax
  1. <HTML>
  2.  
  3. <!-- Experiments with midi sound vegaseat -->
  4. <!-- embed src, hidden, autostart, loop -->
  5.  
  6. <HEAD>
  7.  
  8. <TITLE>Embedded MIDI</TITLE>
  9.  
  10. </HEAD>
  11.  
  12. <body bgcolor="#FFFF00" text="#FF66CC">
  13.  
  14. <center>
  15. <h2>This starts the midi file automatically!</h2>
  16. </center>
  17.  
  18. <!-- the given midi file comes with Win XP, you may need to change this -->
  19. <!-- to something you have!!!!!!!!!! -->
  20. <!-- hide play buttons, autostart and loop once -->
  21. <EMBED SRC="C:\Windows\Media\Onestop.mid" hidden=true autostart=true loop=1>
  22.  
  23. </body>
  24. </HTML>

Only community members can submit or comment on code snippets. You must register or log in to contribute.

Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 3:17 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC