Forum Moderators: open
You **could.** Say you have a list of "source files," alternating between them, you would do a document.write() in a div that could be either <img src> or <object>. The real problem becomes how to set the timeout/switch intervals: it's going to depend on how long it takes to load, and how long the video is, variables you have little control over. On a slow connection it could switch before anything displays. Add to that, you can only swap out .wmv, ,mov, or other embedded video types, most of which have to load completely (or substantially) before playing.
Since you mentioned Flash, I'll also presume you have it. This is the way to go. With Flash you could
- Load an external XML file for your "playlist." The XML would determine the source, type (image or video) and other attributes (caption?)
- Once loaded, you can use methods in Flash to determine when to set the slide intervals. For a picture, you could set the interval for the next slide as soon as the image data loads. For video, you would set the interval when the movie ends.
- A SuperBigExtraDoublePlusGood is that you can stream external .flv - so as soon as the buffer is filled with enough data to play, it plays, and keeps streaming in the background. Other players are supposed to do this, but I haven't seen any of them do it very well.
- Last you have reduced your dependency from Javascript PLUS Flash plug in to just Flash plug in. If you use the SWFObject library, the alternate content displays FIRST and is only replaced by the Flash if the plug in is present and functional, the best of both worlds.
'Dats how I'da doot. :-)