Skip to main content
July 8, 2012
Question

FMS: is there some secret reference I don't know about?

  • July 8, 2012
  • 1 reply
  • 3204 views

I have scoured these boards, adobe's site, and the interwebs, and I have seen many times the simple question asked, when dev'ing FMS 4.5:

Why am I getting this "Method not found: releaseStream/FCPublish"?

It isn't that I don't understand the problem (the function doesn't exist in whatever custom application being written), and know the solution (add the function in), but I can find absolutely no documentation of how and why these functions are called (among many others), nor even a formal API definition of what they are. Is there any documentation that clearly states what functions FMS calls, at what times, in what order... i.e., a reference?

I have written several custom server applications for FMS, and I have never been able to find out what is going in - I can find plenty of resources that say: "add this function in here", and "set up this function to handle this event", but I have no idea what order the events might occur, or even what all the possible events are...

releaseStream is my favorite in this regard: a google search for "FMS releasestream" only showed 2 relevant results, both from adobe group/forums, both of which were (broadly) the question and answer above (it's missing, add it in.)

    This topic has been closed for replies.

    1 reply

    July 9, 2012

    It's not FMS invoking those methods, it's the client application. It's likely an encoder such as Flash Media Live Encoder or Wirecast making those calls.

    the typical method invocations from clients are

    FCPublish

    FCUnPublish

    releaseStream

    You can catch these events on the server side by defining matching methods on the client object, or on the Client prototype.

    July 10, 2012

    Okay, as I said in my post, I understand what they are and how to use them. And yes, at the time I was using FMLE 3.2. But you missed my point: There doesn't seem to be any documentation around the calls that are made and when they are made. You made a good point: it is being dispatched by the encoder... Okay, so I checked the FMLE documentation, and no luck there either.

    Also, while surely some of these calls made by the encoder may be custom defined by the encoder, Adobe must be setting (requiring), at the least, the names of these functions to match something *they* define... otherwise the custom FMS apps I write wouldn't necessarily work with all encoders (and I have tried with FMLE and several other non-adobe big-brand encoders.)

    I mean, FCPublish is FCPublish; if encoder X dispatches a call to Client function called foo, it's not going to do jack - it still must be called FCPublish. Am I missing something?

    Thanks for the reply!

    July 11, 2012

    If a client (the encoder in your case) invokes a remote method that isn't defined, it won't prevent the FMS application from continuing to run, and if the client application is written in such a way that it can continue on after the remote method invocation fails, the client will continue to run.

    FCPublish and FCUnpublish (although seemingly undocumented), have been around since the first version of FMS (initially named Flash Communication Server, hence the "FC" in the names), and they are implemented by a number of encoders. FCPublish is invoked before the encoder starts publishing. FCPublish takes a single argument, that being the stream name the encoder intends to publish. The server method should return a string, that string being the actual stream name the encoder should use for publishing.

    So, if an encoder is properly written, it will invoke FCPublish before it starts publishing. If the invocation fails, the encoder should publish anyway. if the method returns a string, it should publish a stream using the name returned.

    FCUnpublish is called just after publishing stops, and the method takes the same single argument as FCPublish. The idea here is to give your server application notification of the unpublish event so you can clean up anything you need to.

    Neither of these methods are required by FMS. You can choose to use them if you need them.

    I hope that clears things up?