PDA

View Full Version : netstream not working in firefox


Sekter
01-23-2008, 10:48 AM
function netStatusConnection(event:NetStatusEvent):void
{
switch (event.info.code)
{
case "NetConnection.Connect.Success":
connectStream();
break;
}
}

function onMetaData(data:Object):void
{
text_txt.appendText("metaData IS : " + data.duration);
bufTime = data.duration;
ns.bufferTime = bufTime;
text_txt.appendText("the data is now: " + bufTime + "\n");
}

function connectStream():void
{
ns = new NetStream(connection);
ns.bufferTime = 2;
ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
ns.play(videoURL);
vd_video.attachNetStream(ns);
}


function netStatusHandler(event:NetStatusEvent):void
{
text_txt.appendText("bytes loaded: " + ns.bytesLoaded + "\n");
text_txt.appendText("bytes Total: " + ns.bytesTotal+"\n");
if (event.info.code == "NetStream.Play.Start")
{
text_txt.appendText("event is: "+event.info.code+"\n");
text_txt.appendText("esdfgsdfg: "+ ns.bufferTime+"\n");
}

text_txt.appendText("event is: "+event.info.code + "\n");
}

-------------
bytes loaded: 1130
bytes Total: 1055824
event is: NetStream.Play.Start
esdfgsdfg: 2
event is: NetStream.Play.Start
metaData IS : 29.997the data is now: 29.997
bytes loaded: 18170
bytes Total: 1055824
event is: NetStream.Buffer.Flush
-----------
The following code seems to work fine in IE but when i use it in firefox it never listens to my events, instead the movie just plays,stops,plays,stops, it doesnt seem to be listening to my bufferTime sets. Why is it doing this if it works fine in IE????