Object tag for music file in XHTML

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cookieMonster2
    New Member
    • Feb 2009
    • 1

    Object tag for music file in XHTML

    I want to add background music to my xhtml page. I'm using the object tag as seen below and it works fine, except that I want to add more than one song to the list.

    Can someone tell me how to add more than one song to the a href?

    <object type="audio/wma" data="music/fantasy files">
    <param name="src" value="media player.wma" />
    <param name="autoplay" value="true" />
    <param name="autoStart " value="true" />
    <a href="The_Wolf. wma">
    <img src="images/music_icon.jpg" alt="Background Music" height="40" width="40" /></a><br /><br />

    </object>

    P.S. I would use Flash but I have no idea how to get it to work with flash. Tried many options via googling it but I think I just don't have the programming expertise to get it to work..
  • Dwagar
    New Member
    • Feb 2009
    • 6

    #2
    Only way I know this may be possible is using javascript and setup some timers if you know how long each song is, but in this case it is a lot easier using a flash player.

    If you need to give the object an ID like ID="VIDEO" and the javascript code will look like so for playing another song.

    <script>
    setTimeout('doc ument.getElemen tById(\'VIDEO\' ).URL=\'filenam e\',18000);
    </script>

    The 18 will be 3 minutes if the first default song is 3 minutes long. Flash will be more reliable, I never tried this way but may work.

    Comment

    Working...