homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

Streaming a sequence of video files

5+ Year Member

Msg#: 3608929 posted 5:26 am on Mar 24, 2008 (gmt 0)

I'm trying to stream a sequence of small FLV files using PHP and MING library. The SWF file is generated by PHP dynamically on the server, so the video playlist can be updated. I'm new to ActionScript and don't know how to make video2.flv play after video1.flv plays to the end in the following example. When I run the resulting SWF file video2 starts to play right away. Is there any way to fix it?

$movie = new SWFMovie(7);

$strAction = "
netConn = new NetConnection();
vStream = new NetStream(netConn);

$stream = new SWFVideoStream();
$item = $movie->add($stream);
$movie->add(new SWFAction($strAction));



WebmasterWorld Senior Member rocknbil us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 3608929 posted 3:29 pm on Mar 25, 2008 (gmt 0)

It's doing that because as you execute the code, it's immediately replacing vStream with video 2 in your code. It doesn't "know" the first video has ended. You need to put the entire chunk of code in a function, then have an onEnterFrame that listens for the completion of the first video before adding the second one. Sorry to be so vague but I haven't used this particular approach so have never coded it out. :-)

If this is your actual code, you also have an error here
vStream.play('http://localhost/video2.flv');"; <----

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved