FORUMS: list search recent posts

simultaneous playback issue

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Carlos Perez
simultaneous playback issue
on Apr 13, 2009 at 12:04:31 am

Here is my problem:
I have 2 (or more) instances of the same SWF file, and each one runs on a browser window or tab.
A message is sent to all the instances to play the same video. The FLV files are hosted on a web server (so no FMS is involved here).
The first instance to play the movie calls the infoStatus() function (called when the video state changes) almost immediately after the play() method is executed, but the problem is that, unlike the just mentioned behavior, the other instances take a long while between the execution of the play() method and calling the infoStatus() function, causing the video to start playing several seconds (even minutes!!) after calling the play() method.

Does any one know what's happening here and how it can be solved?

Here is part of the actual code:


private var connection_nc:NetConnection;
private var strmVideo:NetStream;

private var VideoNumber = 1; //changes depending on the video selected
private var vdVideo:Video; //already part of the movie clip
private var videoStatus = null;
private var VIDEO_BUFFER_TIME = 2.0;
private var STATUS_INIT = 1;

//IN THE CONSTRUCTOR
connection_nc = new NetConnection();
connection_nc.connect(null);
strmVideo = new NetStream(connection_nc);
this.strmVideo.onStatus = mx.utils.Delegate.create(this, infoStatus);
//

private function initVideo(){ //called after video is selected
this.video.attachVideo(this.strmVideo);
this.strmVideo.setBufferTime(VIDEO_BUFFER_TIME);
this.strmVideo.play("/videos/"+ this.videoNumber + ".flv");
this.currTime = (new Date()).getTime();

this.strmVideo.pause(true);

this.videoStatus = STATUS_INIT;
}

private function infoStatus(info){
trace("Time ellapsed since play() was called: " + ((new Date()).getTime() - this.currTime));
this.currTime = null;

switch (info.code){
case "NetStream.Buffer.Full":{
if (this.videoStatus == STATUS_INIT){
this.strmVideo.pause(false);
}
break;
}

//... some more code is here
}
}


Return to posts index

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