views:

316

answers:

1

Hello,

I would like to have one controller to sync and control multiple video objects(start/stop simultaneously). Is this possible?

A: 

I think I understand your question. If I do, the answer is yes.

You can have one class as act as the controller for several videos (FLVPlaybacks, JW Player, FlowPlayer)...

Essentially you would use your 1 controller to proxy any calls you would make so a single video to all of your videos. So you would have something like the following:

function play():void {
    for (var i:Number = 0; i < videos.length; i++) {
        videos[i].play();
    }
}

or even

function play():void {
    var playVideo:Function = function() { this.play() };
    map(playVideo, vides);
}
sberry2A
I just started working in as3 again after a while away and that map method is fantastic. Thanks!I just had trouble implementing it. This finally worked: public function playAll():void { var playVideo:Function = function(item:NetStream, index:int, vctr:Vector.<NetStream>):void { item.resume() }; myStreams.map(playVideo); }
neil