views:

48

answers:

1

Hello I wanted to know which event determines if an external video is loaded (using Action Script 3, Flex SDK 3.4 compiler and FlashDevelop -VideoEvent is not present here-).

I'm using a flash.media.video component

I've tried with NetStatusEvent.NET_STATUS and "NetStream.Buffer.Full" but it does not seem to work.

Thank you.

A: 

I'm having a similar issue....

First off, as far as the FLex/Flash NetStream class goes, there's two things loading, the Buffer, and the whole video file. The whole video is exposed through the netStreamInstance.bytesLoaded and .bytesTotal properties. The buffer is found at .bufferLength property, signifying how many seconds have preloaded into the buffer at the current moment. The .bufferTime property specifies how much buffer will load before showing the stream.

What I am having an issue with now, is how to re-adjust the buffer in real time for slower connections. I've managed to time the buffer loading and calculate how much buffer will be needed to play through without stopping, but then there's another issue:

Say I have a 120 second video (2 minutes) and it's calculated that I need to buffer for 35 seconds on the slow connection speed (I use Charles for bandwidth Throttle) so that playback will not catch up with the end of the loaded movie... once it starts playing, if the playback gets closer than the 35 seconds from current end of the loading movie, it pauses and waits for the buffer to fill up again- but I don't want this! I already had it wait long enough before it started playing, i expect it will come within a few seconds of the loading progress as it reaches the end of the movie- i don't want it to stop every time it's less than 35 seconds in the buffer... UGH what a PAIN

one giant media