getting stream in onpublish
I have an application that streams live video between two stations to create a "conference". I am working on recording these streams for later playback. The two sides can connect at different times. What I want to do is make it so that the recording only starts when both sides are connected and then it ends when either of them disconnect. That way the videos at least start and stop at the same time. I have been using the code below, but it's not working like I would expect. This code is in the OnPublish event. First I determine what the id of the other connecting stream is. Then, I try to use that to start recording both streams at once. My main problem so far is that I can't seem to retrieve the other stream. The stream name that is being published matches iOtherStationNumber in the admin console, but the program never makes it into the " if (sOther)" part. I always get the "sOther is nothing message".
var sOther = Stream.get(iOtherStationNumber);
if (sOther)
{
trace("setting to record");
sOther.play(iOtherStationNumber);
sOther.record();
myStream.record();
trace("set to record");
}
else
{
trace("sOther is nothing");
}
