Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

Midi in Firefox using embed?



2:36 am on Jul 11, 2006 (gmt 0)

10+ Year Member

Is the embed tag the best option for playing embedded midi files within a page, assuming the user has quicktime installed? I've been having a lot of trouble getting this to work. A basic embed tag seems to work (just <embed src="music.mid">), although some friends are still saying the midi doesn't play. If I fill out the embed tag with some other attributes, I think just things like loop etc, it seems to stop working. I can't test it on my PC at the moment as quicktime is screwing around.

I have the javascript set up to correctly use different code for browsers like IE. I'm not using player controls for this, it needs to be embedded. If there're other attributes I can add to the embed tag, or if there is a different tag I can be using, that should work on Firefox, I'd appreciate some sample code and if it still doesn't work on my friends' machines, then I'll just have to assume they haven't got their plugins installed properly or something?



10:07 am on Jul 12, 2006 (gmt 0)

10+ Year Member

I'm using the following piece of script:

var musicsrc="midi.mid"
if (navigator.appName=="Microsoft Internet Explorer")
document.write('<bgsound src='+'"'+musicsrc+'"'+' loop="1">')
document.write('<embed src=\"'+musicsrc+'\" hidden="true" border="0" width="0" height="2" autostart="true" loop="false">')


Featured Threads

Hot Threads This Week

Hot Threads This Month