I have been creating a custom video player for the web. On some machines that I run this on it will start loading the .flv file then no progress will be made for 30 seconds to one minute then show that the video is completely loaded. I am checking how much has been loaded using a bytesLoaded / bytesTotal
in an Event.ENTER_FRAME
. When traced separately what seems to be happening when it shows fully loaded the bytesTotal
value changes to the current bytesLoaded
value causing my video player to register that my load percentage to be 1. I have traced out the NetStatus event.code value and there is no update to show that there has been any sort of error. All I get are a NetStream.Play.Start
NetStream.Buffer.Full
and then it will wait and reset the bytes total value.
So what I am asking is if there a way to handle this problem?
There doesn't seem to be a specific answer to this problem. I have since made another attempt at the problem and there are two lessons that I have learned.
1) You can code around most shortcomings in the netstream class by not allowing it to attempt to seek past the loaded point using the bytesLoaded
, bytesTotal
and the bufferTime
properties. This can allow you to make sure that you never allow the seek to be attempted to a time that could cause a problem.
2) Always allow the previous seek attempt to finish and handle it properly before attempting to send another.