Forum Moderators: open

Message Too Old, No Replies

DHTML "videoshow"

         

frikus

8:30 pm on Mar 21, 2008 (gmt 0)

10+ Year Member



Is it possible to create a DHTML "videoshow", something like a slideshow, but with flash animations, videos AND/OR images?
I know how to make a slideshow, will this technique (changing src attribute in realtime) work with small videos too?

DrDoc

3:47 am on Mar 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I really have no idea whether it would work or not.

Perhaps a silly question, but ... have you tried it?

rocknbil

6:24 pm on Mar 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Since this in Javascript, I'll presume that's your approach - you don't want to do it this way.

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. :-)

frikus

11:03 pm on Mar 23, 2008 (gmt 0)

10+ Year Member



Thanks for your detailed response. My problem is that I have very little experience with Flash. Anyways, I'm gonna try both.