FORUMS: list search recent posts

Playing Consecutive FLV's

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
mansour bethoney
Playing Consecutive FLV's
on Feb 25, 2009 at 5:14:19 pm

Help needed.
I have 5 separate flv's that I need to play one after the other.
It's basically 1 movie, but it has 5 chapters. I need the option of playing straight through, or jumping to a specific chapter.

Each flv is around 14Megs so I'd rather not create one giant file.

Does anyone know of any tutorials, or anything that can help me accomplish this? I've searched everywhere I can think of and have not found a workable solution.





Return to posts index

demetri tashie
Re: Playing Consecutive FLV's ( AS3 response)
on Feb 25, 2009 at 5:46:10 pm

are you talking AS3 ??? i am no expert, so i am sure there are other, and possibly better ways to do this.

i have done this successfully 2 ways, one using a video complete action, combined with IF (conditional) statements, or more straight forward using CUE POINTS . if you add a Cue Point on the end of each video, you then just tell it what you want to do when it reaches that Cue Point ( play next video, for instance)

let us know if you need further help, or if this helps you with how to approach this now.



Return to posts index

mansour bethoney
Re: Playing Consecutive FLV's ( AS3 response)
on Feb 25, 2009 at 6:11:57 pm

CS3 yes.

I guess I am dense.
I have no idea how to practically pull that off.
I have managed to add in cue points, but I don't know how to access them using Action Script..

I haven't used Flash since ActionScript 1.0 so anything that can't be done with the "script assist" is rocket science to me.






Return to posts index


demetri tashie
Re: Playing Consecutive FLV's ( AS3 response)
on Feb 25, 2009 at 10:30:36 pm

great that you added the Cue Points ! ( also make sure your AS is AS3 for this)

i suggest you review this response i wrote to someone else and use it as a quick tutorial for Cue Points:

http://forums.creativecow.net/readpost/190/863732

your code would just need to look more like this:

import fl.video.FLVPlayback;
import fl.video.VideoEvent;
import fl.video.MetadataEvent;


flvPlayer.source="http://www.yourDomain.com/yourVideo1.flv";
flvPlayer.autoPlay=true;


flvPlayer.addEventListener(MetadataEvent.CUE_POINT, changeVideo );

function changeVideo(pEvent:MetadataEvent) {
//var cueName = e.info.name;
if(pEvent.info.name == "end"){
flvPlayer.ssource="http://www.yourDomain/yourVideo2.flv";
}
}


just keep adding on for the other 3 videos you have.

or another way is not through Cue Points but by using a VideoEvent.COMPLETE method. here is the code for 3 videos. add on as you see fit.

note 1: i have the last video as it COMPLETEs triggering to go back to video one. remove that step if you want it to stop after the last video.

note 2: here i am using an instacne of the FLVPlayback Component onthe stage and given an Instance Name of "fullMOV" . you can of course, add the instance via AS




import fl.video.*;
fullMOV.source = "http://www.myDomain.com/video1.flv";
fullMOV.autoPlay=true;
fullMOV.addEventListener(VideoEvent.COMPLETE, complete_listener);

function complete_listener(eventObject:VideoEvent):void {
if (fullMOV.source == "http://www.myDomain.com/video1.flv") {
fullMOV.play("http://www.myDomain.com/video2.flv");
}
else if (fullMOV.source == "http://www.myDomain.com/video2.flv") {
fullMOV.play("http://www.myDomain.com/video3.flvflv");
}
else if (fullMOV.source == "http://www.myDomain.com/video3.flvv") {
fullMOV.play("http://www.myDomain.com/video1.flv");
}
}


really not too complicated at all.

now of course the videos will not play 100% seamlessly,as they have to load each one. what i have suggested to clients who use one of these methods is that the preparation of your videos is very important. using fade in and fade outs from black , while a good cinematic effect, just makes the transition from one video to the other appear to take longer. start your 2nd, 3rd,4th,and 5th video right away.

hope that helps. i am sure there are other ways, maybe better ways, to accomplish this. i will leave that for others to chime in. i know that for me these are tried and true methods, that make the most logical sense, with the least amount of (coding) work.

here is a down and dirty example of what this would accomplish. it is just a raw SWF NOT wrapped in a HTML document. i left a progress bar there so you can zip right to the end and not sit through the clips :

http://www.demetri-media.com/Sven/continuousVideo.swf

let us know how it works out for you..



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]