FORUMS: list search recent posts

[AS3] Creating interactive streaming flash video player

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Will Lyons
[AS3] Creating interactive streaming flash video player
on Nov 19, 2009 at 9:35:44 pm

Let me preface this with I'm totally new to flash, all my learning comes from Lynda.com and CreativeCOW tutorials. I'm trying to create a streaming flash player for our website that will play a video, pause, and present the user with some button's to select the next scene, after which the video will continue playing until the next pause... and so on. Each video will be about 5 minutes long. I think I have a solution figured out, here's my code:
(BTW, this is for a whitewater kayaking video, hence all the 'rapids' which are essentially like scenes in a movie)

//Rapid One
stop();
import fl.video.FLVPlayback;
import fl.video.VideoEvent;
import fl.video.MetadataEvent;
import fl.video.*;

var lineOne:mcLeft = new mcLeft();
var lineTwo:mcRight = new mcRight();
var rapidOne:Array = ["one.flv","two.flv","three.flv"];


lineOne.x = 300;
lineOne.y = 200;

lineTwo.x = 650;
lineTwo.y = 200;

flvPlayer.source = rapidOne[0];
flvPlayer.autoPlay = true;

flvPlayer.addEventListener(MetadataEvent.CUE_POINT, changeVideo);
flvPlayer.addEventListener(VideoEvent.COMPLETE, complete_listener);
lineTwo.addEventListener(MouseEvent.CLICK, onClickTwo);
lineOne.addEventListener(MouseEvent.CLICK, onClickOne);



function complete_listener(eventObject:VideoEvent):void
{
if (flvPlayer.source == rapidOne[1])
{
gotoAndPlay(3);
}
else if (flvPlayer.source == rapidOne[2])
{
gotoAndPlay(3);
}
}

function changeVideo(pEvent:MetadataEvent):void
{

if (pEvent.info.name == "end")
{
flvPlayer.pause();
flvPlayer.alpha = .7;
addChild(lineOne);
addChild(lineTwo);
}

}

function onClickOne(event:MouseEvent):void
{
flvPlayer.source = rapidOne[1];
flvPlayer.alpha = 1;
removeChild(lineOne);
removeChild(lineTwo);

}

function onClickTwo(event:MouseEvent):void
{
flvPlayer.source = rapidOne[2];
flvPlayer.alpha = 1;
removeChild(lineTwo);
removeChild(lineOne);
}

stop();

After this, the player goes to the next frame on the TL, which just has a stop and gotoAndPlay(); command, which sends it to frame 3 which has the same code as above, but for the next rapid on the river. Here's my questions:
1) Is this a very efficient/pracitcal way of doing this?
2) Is there a way to just have one block of code, and once the first rapid or scene is complete, instead of jumping 2 frames down the timeline, it can just create a new array for the next set of 3 videos?
3) We plan on having lots of rivers with lots of different rapids. Would streaming be necessary or would progressive download be good enough. We don't have our own web server and need to find someone who would host these videos which has FVSS. I like the idea of streaming mostly for a better viewing experience as well as the increased analytics offered. I just don't know much about flash media server. Up until now we've just hosted our videos on vimeo.com and are pretty new to all of this.
I really appreciate anyone who's still reading and even more appreciate any responses. I hope this is clear enough, but if my description is fuzzy I'll try and break it down better.

Cheers,

Will Lyons
Penstock Productions
Asheville, NC
http://www.lvmvideo.com


Return to posts index

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