Results 1 to 3 of 3

Thread: Embedded audio after picts load ??

Hybrid View

  1. #1
    Join Date
    Oct 2006

    Embedded audio after picts load ??

    I use this code for a slideshow.

    <embed src="GTss/GTCSong.mp3" autostart="true" loop="false" width="280" height="45" hidden>

    How can I get this to start only after all the slideshow picts load?



  2. #2
    Join Date
    Mar 2011
    It can be done. The synchronization is probably never going to be perfect, but you can come close. You'll need some JavaScript to detect whether the images have all loaded (test each of the image's 'completed' property for true/false). That means you'll need to know how your slideshow script tracks the list of images it uses and create Image objects for each one with the same 'src' to pre-load them all. Your script might also need to load the MP3 file into an internal object so you can be sure it's fully loaded, too. Then you can use a DOM method to add the HTML code to your document to play the MP3 and start the slideshow's timer so they start at roughly the same time.

    The exact code is going to depend on how the slideshow script works. You might not need to pre-load all of the images to get the effect you're after. If the slideshow runs slowly enough, pre-loading the first three or four images might give the browser enough of a head start that everything runs smoothly.

    I don't work with media players very much, but I think you should look into some more cross-browser compatible code than a simple <embed> tag. Good luck!
    Rick Trethewey
    Rainbo Design

  3. #3
    Join Date
    Oct 2006

    Thanks for reply,

    I might be able to figure out what you are saying, but in the meantime,
    the Script his here



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles