Hi,

 

I want to display a buffering message whenever a progressively downloaded
flv is buffering. According to the docs, this should be possible.

 

When the NetStream.Buffer.Empty event is fired, the swf displays some kind
of buffering message to the user.

 

When the NetStream.Buffer.Full event is fired, the swf removes the buffering
message.

 

But in practice this never quite works, when testing both locally and from a
server. Here's some sample code in a class for handling NetStream events:

 

private function netStatusHandler(event:NetStatusEvent):void

{

    switch (event.info.code)

    {

        case "NetStream.Play.Start":

            trace("NetStream.Play.Start, currentTime is:", stream.time);

            break;

        case "NetStream.Buffer.Empty":

            trace("NetStream.Buffer.Empty, currentTime is:", stream.time);

            break;

        case "NetStream.Buffer.Full":

            trace("NetStream.Buffer.Full, currentTime is:", stream.time);

            break;

    }

}

 

And here's what appears in the output window when the video is loaded:

 

NetStream.Play.Start, currentTime is: 0

NetStream.Buffer.Empty, currentTime is: 0.94

NetStream.Buffer.Full, currentTime is: 0.94

 

One problem is that Buffer.Empty is fired long after the video starts
playing. A different result occurs by changing the default bufferTime
setting from 0.1 seconds to something longer. If the bufferTime is five
seconds, the output window shows this:

 

NetStream.Play.Start, currentTime is: 0

NetStream.Buffer.Full, currentTime is: 1.044

 

Shouldn't Buffer.Full fire before the video starts playing? In all the tests
I've done, this event fires between half a second to one second after the
video has started. And why does changing the bufferTime cause the
Buffer.Empty event to not fire at all?

 

TIA for any insight.

 

Wendy

 

 

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to