PDA

View Full Version : NetStream Question



RyuuJin
April 2nd, 2008, 04:09 PM
So I have a video that is using NetStream and all that jazz to play the flv. Is there a way I can restrict the video from play until say, 20% of it is loaded?

Here is my code so far.




var video:Video = new Video(600, 300);
addChild(video);

video.x = 10;
video.y = 10;

VideoMask.cacheAsBitmap = true;
video.mask = VideoMask;

var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS, onStatusEvent);

function onStatusEvent(stat:Object):void
{
trace("MOVIE LOADED");
}

var meta:Object = new Object();
meta.onMetaData = function(meta:Object)
{

}

ns.client = meta;

video.attachNetStream(ns);

ns.play("assets/content/video/FormativeDemoReel.flv");

wvxvw
April 2nd, 2008, 04:16 PM
myNetStream.bufferTime = someValue.
But, untill you recieve metadata, you won't know what is the duration of the stream, so, probably, you'll need to redefine the bufferTime property after recieving it.

RyuuJin
April 2nd, 2008, 05:39 PM
Thanks a lot for your help :)