please can you tell me how can i make chunk files with serverside actionscript? as i see in documentation there is only one method to record
stream.record();
and i can't give to it filename. as i understand recorded stream filename is the same that i set from FMLE stream name, but how can i change it?
I like to approach it by recording to a new server side stream instead of directly recording the client's publish stream. A rough example would be something like this (I didn't test the code... this is just an example):
application.onPublish = function(client, stream){
client.publishingStreamName = stream.name;
application.chunkRecording(client);
}
application.onDisconnect = function(client){
clearInterval(client.chunkInterval);
if(client.recordingStream){
client.recordingStream.play(false);
client.recordingStream.record(false);
}
}
application.chunkRecording = function(client){
clearInterval(client.chunkInterval);
// Stop any old recording
if(client.recordingStream){
client.recordingStream.play(false);
client.recordingStream.record(false);
}
// Start the new recording. Create a new name for the stream based on the time.
var recordStreamName = client.publishingStreamName + "-" + new Date().getTime();
client.recordingStream = Stream.get(recordStreamName);
client.recordingStream.record();
// Run me again in an hour.
client.chunkInterval - setInterval(application, "chunkRecording", 3600000, client);
}