This project was about recording a few seconds of work and reproducing it. We decided to do that with Red5
Streaming (biggest reason was that it is for free…). A few hours before the final final final (but this is the most final) deadline we saw that we could not have two flashplayers opened streaming voice at once. Debugging we found the Netstream.Publish.BadName that caused that nothing could be recorded, a silent killer!!!
Reading about Netstream publish at livedocs:
“Don’t use this method to let a client play a stream that has already been published and recorded”
ok and what should I do?? reading a few lines below:
“When you record a stream using Flash Media Server, the server creates a file and stores it in a subdirectory in the application’s directory on the server. Each stream is stored in a directory whose name matches the application instance name passed to
NetConnection.connect(). The server creates these directories automatically; you don’t have to create one for each application instance. For example, the following code shows how you would connect to a specific instance of an application stored in a directory named lectureSeries in your application’s directory. A file named lecture.flv is stored in a subdirectory named /yourAppsFolder/lectureSeries/streams/Monday: “
Ok then, the solution to the problem was not in the netstream, it was at the netconnection! That ment we had to connect to the red5 server but forcing it to record to a unique folder so that each publishing of the netstream pointent to a unique “publishing name”. For that we decitedt to create a folder with the getTimer();
_randomFolder = String(getTimer());
works perfectly the only disadvantage is that on the server there are a lot of created folders….