My custom built Flash video player (AS3) has code in it to automatically recover from temporary losses of connectivity with the Flash Media Server from which it is streaming video. The code works essentially like this:
- On NetConnection.Connect.Closed, attempt reconnection
- On successful re-connection, call ns.play() to resume playback of the video stream
This works.
But my timeline resets to zero because of step #2 above. According to Flash docs (http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#time), the Netstream "time" property "is set to 0 when NetStream.play() is called with reset set to 1 or true."
That "time" property is read only as well so there doesn't seem to be much I can do about it. I can't exactly set it to something like a "lastPosition" variable which is what I'd like to do.
I've tried various arguments in the play() call in attempt to prevent the zero out of the time property. Like...
ns.play(streamName, lastPosition, -1, 0);
The last argument sets "reset" to false. That didn't help though. "time" property still zeros out on the call to play().
So even if I begin playing a file 100 seconds in, the NetStream "time" property reflects "0". No good. Should reflect "100".
Is there another property that I'm missing here that reflects the true playback position in the file or am I doing something else wrong?