Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In flash as3 webcam recorder how to reconnect or republish after connection loss

I have a flash as3 based webcam video recorder that publishes the webcam video stream of a user to a Flash Media Server (FMS). The trouble I have is that when the connection of the user drops due to erratic internet connection, the recording stops abruptly in between and the video file is more often than not, corrupted. I can use the NetConnection.Connect.Closed and NetConnection.Connect.NetworkChange events of the NetConnection class to detect a connection drop and reconnect to the server without any problems. But on attaching the newly reconnected NetConnection object to the NetStream object, the recording is reset and starts all over.

In the case of playback using an FMS, the re-attaching of a new NetConnection to the NetStream, there are ways to resume the playback from the last position as shown in the documentation here: http://help.adobe.com/en_US/flashmediaserver/devguide/WSae44d1d92c7021ff-1f5381712889cd7b56-8000.html. But while publishing / recording, I can't resume the recording once i have re-connected. Is there a way to work around this? Ping me in the comments if the question is not clear. Thanks.

like image 861
fijas Avatar asked Nov 11 '22 21:11

fijas


1 Answers

Note, I've never done this, so I don't know how it would work w/files that are corrupted, but there is an option to append to an existing stream (or append with a gap), when publishing a NetStream. The second parameter of the publish() method specifies how to publish the stream:

ns.publish('myStreamName', 'append');
like image 147
Sunil D. Avatar answered Nov 15 '22 05:11

Sunil D.