Flex 4.5 Video, NetStream, Start Buffering after calling ns.togglePause in NetStatus Handler to prevent autoplay
Posted on 2011-09-22
I'm working on a video player built on the Flex Framework. I'm using NetConnection, NetStream to stream from a wowza server.
I do not want the video to autoplay when loading. The only way I found to prevent this is by calling ns.togglePause() in the netStatusHandler. this works fine. However I would like to start the buffering right away. the only way I've found is to delay the initial pause in the netStatusHandler by 3 seconds, with a timer. This works but is a little dirty as the video sometimes plays a bit before the pause. But the video continues to buffer when paused, this is the behavior I'm looking for. I wish to accomplish this without using a delay to call ns.togglePause.
Is there a way to force buffering after calling ns.togglePause() in the netStatusHandler?