Hello, everyone. I'm trying to build in a reconnection manager to handle when a user gets disconnected by attempting to reconnect for a set number of times at a given interval. I've been able to manage the reconnecting, but when I reconnect, telling the player to play again doesn't start or resume playback. The only solution I have found is to reset the media element on the player, which restarts the media from the beginning, rather than the time where the viewer was when the disconnect happened. I imagine I can grab the time on the connection close event handler, reset the media, and seek to the time once the player is reconnected. However, this does not seem optimal. This leads me to two questions:
1. Is there a better way to get the player to start playing the interrupted media again?
2. There is nothing that I can see in the OMSF that handles a connection being closed. Is this something that should be/will be handled?
This is a problem that's finally being addressed in Flash 10.1 via the NetStream.attach method:
This will allow you to reattach a live NetStream to a new NetConnection, which is useful for reconnecting or load-balancing. OSMF doesn't have support for this yet. Until we do, you could probably use this within your reconnection manager. Or subclass NetLoader to listen for a connection failure event, suppress the load failure, and do the reconnect.